Date: Wed, 25 Sep 1996 11:31:22 +0200 (IST) From: Eli Zaretskii To: Alex Schroeder Cc: djgpp AT delorie DOT com Subject: Re: strncasecmp!? In-Reply-To: <528m2q$eiq@rzunews.unizh.ch> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 24 Sep 1996, Alex Schroeder wrote: > > DJGPP provides strncasecmp() also. > > So I can use either one or the other? How can I provide for compilers > that provide only one of them, since I want my programm not only to > compile under DJGPP but on other systems, too. In general, this is the whole purpose of auto-configuration tools, such as GNU Autoconf. However, I doubt that you could easily implement such a beast on MSDOS, at least not as a general-purpose program. So, in this case, I suggest something like that: #ifndef HAVE_STRNCASECMP #ifdef HAVE_STRICMP #define strcasecmp(s,d) stricmp(s,d) #else /* Write your own case-insensitive comparison function and put it here. Or put an #error directive so that it won't compile. */ #endif #endif Then tell in the installation instruction to add an appropriate -D switch to the definition of CFLAGS on the Makefile.