dirent: Fix compilation error in C++ mode on OS/2 kLIBC.
authorKO Myung-Hun <komh78@gmail.com>
Tue, 19 Jan 2021 18:23:39 +0000 (19:23 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 19 Jan 2021 18:24:24 +0000 (19:24 +0100)
* lib/dirent.in.h (dirfd): Redefine dirfd macro as a rpl function
always.

ChangeLog
lib/dirent.in.h

index 357c231be860ebe547108b6d640cc1cb74bd3033..94a6b5f52c59ee3c365314664892235eb4efe957 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-19  KO Myung-Hun  <komh78@gmail.com>
+
+       dirent: Fix compilation error in C++ mode on OS/2 kLIBC.
+       * lib/dirent.in.h (dirfd): Redefine dirfd macro as a rpl function
+       always.
+
 2021-01-19  KO Myung-Hun  <komh78@gmail.com>
 
        zerosize-ptr: Fix compilation on OS/2 kLIBC.
index 2e2c5119a11b7ecddd82dbd2548fa255b1a3704d..4666972b15084df38079c870cb5829c01e9c52c8 100644 (file)
@@ -154,7 +154,8 @@ _GL_WARN_ON_USE (closedir, "closedir is not portable - "
 /* Return the file descriptor associated with the given directory stream,
    or -1 if none exists.  */
 # if @REPLACE_DIRFD@
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+/* On kLIBC, dirfd() is a macro that does not work.  Undefine it.  */
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE) || defined dirfd
 #   undef dirfd
 #   define dirfd rpl_dirfd
 #  endif