dirent: Avoid #define replacements in C++ mode.
[gnulib.git] / modules / dirent
index 0e75c7b..9b99dbc 100644 (file)
@@ -8,6 +8,7 @@ m4/unistd_h.m4
 
 Depends-on:
 arg-nonnull
+c++defs
 include_next
 warn-on-use
 
@@ -19,7 +20,7 @@ BUILT_SOURCES += dirent.h
 
 # We need the following in order to create <dirent.h> when the system
 # doesn't have one that works with the given compiler.
-dirent.h: dirent.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+dirent.h: dirent.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -36,6 +37,7 @@ dirent.h: dirent.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
              -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
              -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|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)/dirent.in.h; \