regex: port __libc_lock_define usage to C89
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Jan 2013 15:59:12 +0000 (07:59 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Jan 2013 15:59:28 +0000 (07:59 -0800)
* lib/regex_internal.h (__libc_lock_define) [!_LIBC]: Remove.
(struct re_dfa_t): Use #ifdef instead.  '__libc_lock_define (, lock)'
does not conform to C89, as it has an empty macro argument.
Reported by Aharon Robbins in
<http://sourceware.org/ml/libc-alpha/2012-12/msg00456.html>.

ChangeLog
lib/regex_internal.h

index de1c81c..cab9521 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-01-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       regex: port __libc_lock_define usage to C89
+       * lib/regex_internal.h (__libc_lock_define) [!_LIBC]: Remove.
+       (struct re_dfa_t): Use #ifdef instead.  '__libc_lock_define (, lock)'
+       does not conform to C89, as it has an empty macro argument.
+       Reported by Aharon Robbins in
+       <http://sourceware.org/ml/libc-alpha/2012-12/msg00456.html>.
+
 2013-01-01  Eric Blake  <eblake@redhat.com>
 
        maint: update all copyright year number ranges
index 32b6b67..43fae40 100644 (file)
@@ -35,7 +35,6 @@
 #if defined _LIBC
 # include <bits/libc-lock.h>
 #else
-# define __libc_lock_define(CLASS,NAME)
 # define __libc_lock_init(NAME) do { } while (0)
 # define __libc_lock_lock(NAME) do { } while (0)
 # define __libc_lock_unlock(NAME) do { } while (0)
@@ -699,7 +698,9 @@ struct re_dfa_t
 #ifdef DEBUG
   char* re_str;
 #endif
+#ifdef _LIBC
   __libc_lock_define (, lock)
+#endif
 };
 
 #define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))