From: Dan Harkless Date: Tue, 25 Jan 2000 06:18:54 +0000 (+0000) Subject: On AIX 4.1, snprintf() is defined in libc.a but there's no prototype in X-Git-Tag: nmh-1_0~111 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=c466879717f7cc03e987c5fc5fc5f1c9cb522c66;p=mmh On AIX 4.1, snprintf() is defined in libc.a but there's no prototype in or elsewhere. Apparently it's not officially supported (though it seems to work perfectly and IBM apparently uses it in internal code). Anyhow, if we omit our own snprintf() and vsnprintf() prototypes when we HAVE_SNPRINTF, we get a billion warnings at compile time. Use the C preprocessor to preprocess stdio.h and make sure that there's actually a prototype. Define HAVE_SNPRINTF_PROTOTYPE if so, and use that to control our local prototype definition. Also, define strcasecmp() and strncasecmp() here all the time since we define our own versions and always use them. The only way we could get into trouble doing this would be if the vendor's versions didn't have the same parameters, but I don't see that happening. If we don't define them here, we get warnings all over the place that default prototypes are being used for 'em, and the system header to include varies from OS to OS. --- diff --git a/h/prototypes.h b/h/prototypes.h index 59841a2..4b5a0b8 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -129,11 +129,14 @@ int get_returnpath (char *, int, char *, int); /* * prototypes for compatibility functions in library */ -#ifndef HAVE_SNPRINTF +#ifndef HAVE_SNPRINTF_PROTOTYPE int snprintf (char *, size_t, const char *, ...); int vsnprintf (char *, size_t, const char *, va_list); #endif +int strcasecmp (const char *s1, const char *s2); +int strncasecmp (const char *s1, const char *s2, size_t n); + #ifndef HAVE_STRERROR char *strerror (int); #endif