2010-03-07 Bruno Haible <bruno@clisp.org>
+ glob: Avoid #define replacements in C++ mode.
+ * lib/glob.in.h: Include c++defs.h, warn-on-use.h.
+ (_gl_glob_errfunc_fn): New type.
+ (glob, globfree, glob_pattern_p): In C++, define a namespaced alias
+ symbol.
+ * modules/glob (Depends-on): Add c++defs, warn-on-use.
+ (Makefile.am): Update glob.h rule.
+
fcntl-h: Avoid #define replacements in C++ mode.
* lib/fcntl.in.h: Include c++defs.h.
(fcntl, open, openat): In C++, define a namespaced alias symbol.
# define __THROW
#endif
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
/* The definition of _GL_ARG_NONNULL is copied here. */
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
#ifndef __size_t
# define __size_t size_t
#endif
/* Now the standard GNU C Library header should work. */
#include "glob-libc.h"
+__BEGIN_DECLS
+typedef int (*_gl_glob_errfunc_fn) (const char *, int);
+__END_DECLS
+
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# undef glob
+# undef globfree
+# undef glob_pattern_p
+_GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
+ _gl_glob_errfunc_fn __errfunc,
+ glob_t *_Restrict_ __pglob));
+_GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob));
+_GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote));
+# if 0 /* The C function name is rpl_glob, not glob. */
+_GL_CXXALIASWARN (glob);
+_GL_CXXALIASWARN (globfree);
+_GL_CXXALIASWARN (glob_pattern_p);
+# endif
+#endif
+
#endif /* _GL_GLOB_H */
Depends-on:
alloca
arg-nonnull
+c++defs
d-type
dirfd
extensions
strdup
sys_stat
unistd
+warn-on-use
malloc-posix
configure.ac:
# We need the following in order to create <glob.h> when the system
# doesn't have one that works with the given compiler.
-glob.h: glob.in.h $(ARG_NONNULL_H)
+glob.h: glob.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/glob.in.h; \
} > $@-t && \
mv -f $@-t $@