]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
if no strerror_r prototype is found, we provide our own to prevent picky
authorDaniel Stenberg <daniel@haxx.se>
Thu, 6 May 2004 10:49:40 +0000 (10:49 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 6 May 2004 10:49:40 +0000 (10:49 +0000)
compilers to warn

acinclude.m4
lib/strerror.c

index 3bfb11246f3d2bce3009f828e8c9847b690fa505..a582a4eec225660c0e4265d975868cc5b2550e45 100644 (file)
@@ -396,6 +396,17 @@ AC_DEFUN([CURL_CHECK_STRERROR_R],
        AC_MSG_RESULT(no))])])
 
   if test "x$strerror_r" = "xyes"; then
+
+    dnl check if strerror_r is properly declared in the headers
+    AC_CHECK_DECL(strerror_r, ,
+     AC_DEFINE(HAVE_NO_STRERROR_R_DECL, 1, [we have no strerror_r() proto])
+,
+[#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+])
+
     dnl determine if this strerror_r() is glibc or POSIX
     AC_MSG_CHECKING([for a glibc strerror_r API])
     AC_TRY_RUN([
index 6cc87091bc33dc7c23d28f3f17c5985a630df48e..d5c80d1a6da218443cf4e9bb2028bc1084416bc3 100644 (file)
 #define _MPRINTF_REPLACE /* use our functions only */
 #include <curl/mprintf.h>
 
+#ifdef HAVE_NO_STRERROR_R_DECL
+#ifdef HAVE_POSIX_STRERROR_R
+/* seen on AIX 5100-02 gcc 2.9 */
+extern int strerror_r(int errnum, char *strerrbuf, size_t buflen);
+#else
+extern char *strerror_r(int errnum, char *buf, size_t buflen);
+#endif
+#endif
+
 const char *
 curl_easy_strerror(CURLcode error)
 {