]> Savannah Git Hosting - gnulib.git/commitdiff
Define macros for glibc
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Wed, 9 Jul 2014 09:56:49 +0000 (15:26 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 10 Jul 2014 08:25:45 +0000 (13:55 +0530)
This patch helps build error.c without warnings on glibc.

        error: Fix -Wundef warnings in glibc
        * lib/error.c [_LIBC]: Define default macros for
        glibc.
        (print_errno_message) [defined HAVE_STRERROR_R || _LIBC]:
        Check _LIBC before STRERROR_R_CHAR_P.

ChangeLog
lib/error.c

index c310fedcb5649c334cf98ad4bef6082a878b1e73..1de9b52e48b40cb13f9830351b32c4bff049b59f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2014-07-10  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+       error: Fix -Wundef warnings in glibc
+       * lib/error.c [_LIBC]: Define default macros for
+       glibc.
+       (print_errno_message) [defined HAVE_STRERROR_R || _LIBC]:
+       Check _LIBC before STRERROR_R_CHAR_P.
+
        error: Sync from glibc master
        * lib/error.c [_LIBC]: Remove INTUSE usage.
        (error_tail): Remove unused macro ALLOCA_LIMIT.
index 9a3525a8829aca9d1de80d8e5d07827fec4e239b..7b99cd7310bfe37c9439cf853a8a4909d3ab7eca 100644 (file)
@@ -39,6 +39,9 @@
 # include <stdint.h>
 # include <wchar.h>
 # define mbsrtowcs __mbsrtowcs
+# define USE_UNLOCKED_IO 0
+# define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b)
+# define _GL_ARG_NONNULL(a)
 #endif
 
 #if USE_UNLOCKED_IO
@@ -171,7 +174,7 @@ print_errno_message (int errnum)
 
 #if defined HAVE_STRERROR_R || _LIBC
   char errbuf[1024];
-# if STRERROR_R_CHAR_P || _LIBC
+# if _LIBC || STRERROR_R_CHAR_P
   s = __strerror_r (errnum, errbuf, sizeof errbuf);
 # else
   if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)