This fixes a compilation error on DragonFly BSD 6.0.
* lib/glob.in.h: Don't include <libc-config.h>. Don't define __USE_GNU.
Include glob-libc.gl.h instead of glob-libc.h.
* modules/glob-h (Makefile.am): Arrange to create glob-libc.gl.h from
glob-libc.h.
* lib/libc-config.h: Add comment.
+2021-06-06 Bruno Haible <bruno@clisp.org>
+
+ glob-h: Avoid conflict with preprocessor macros owned by the system.
+ This fixes a compilation error on DragonFly BSD 6.0.
+ * lib/glob.in.h: Don't include <libc-config.h>. Don't define __USE_GNU.
+ Include glob-libc.gl.h instead of glob-libc.h.
+ * modules/glob-h (Makefile.am): Arrange to create glob-libc.gl.h from
+ glob-libc.h.
+ * lib/libc-config.h: Add comment.
+
2021-06-06 Dmitry V. Levin <ldv@altlinux.org>
* tests/test-regex.c (tests): Add test cases for *+ and ** regressions
/* Preparations for including the standard GNU C Library header. */
-# ifndef __attribute_maybe_unused__
-# include <libc-config.h>
-# endif
-
# include <stddef.h>
/* On some systems, such as AIX 5.1, <sys/stat.h> does a "#define stat stat64".
rely on 'struct stat'. */
# include <sys/stat.h>
-# ifndef __USE_GNU
-# define __USE_GNU 1
-# endif
-
# if @REPLACE_GLOB@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define glob rpl_glob
/* Now the standard GNU C Library header should work. */
-# include "glob-libc.h"
+# include "glob-libc.gl.h"
#endif
When compiled as part of glibc this is a no-op; when compiled as
part of Gnulib this includes Gnulib's <config.h> and defines macros
- that glibc library code would normally assume. */
+ that glibc library code would normally assume.
+
+ Note: This header file MUST NOT be included by public header files
+ of Gnulib. */
#include <config.h>
endif
MOSTLYCLEANFILES += glob.h glob.h-t
+BUILT_SOURCES += glob-libc.gl.h
+
+glob-libc.gl.h: glob-libc.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e '/__BEGIN_DECLS/{ s/__BEGIN_DECLS/#ifdef __cplusplus%extern "C" {%#endif/; y/%/\n/; }' \
+ -e '/__END_DECLS/{ s/__END_DECLS/#ifdef __cplusplus%}%#endif/; y/%/\n/; }' \
+ -e 's|__THROW||g' \
+ -e 's|defined __USE_MISC|1|' \
+ -e 's|ifdef __USE_GNU|if 1|' \
+ -e 's|ifdef __USE_LARGEFILE64|if 0|' \
+ < $(srcdir)/glob-libc.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += glob-libc.gl.h glob-libc.gl.h-t
+
+
Include:
<glob.h>