summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKO Myung-Hun <komh78@gmail.com>2021-01-19 19:23:39 +0100
committerBruno Haible <bruno@clisp.org>2021-01-19 19:24:24 +0100
commit9cd9d63152f3368c55432b3a2aec6f90ddd062d0 (patch)
treec6b3615c30398192a9c0fde236a0c5cdf9b1eb88
parent70e3c12fb708a02c2326d571e11ae53aef8c45f0 (diff)
downloadgnulib-9cd9d63152f3368c55432b3a2aec6f90ddd062d0.tar.gz
dirent: Fix compilation error in C++ mode on OS/2 kLIBC.
* lib/dirent.in.h (dirfd): Redefine dirfd macro as a rpl function always.
-rw-r--r--ChangeLog6
-rw-r--r--lib/dirent.in.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 357c231be8..94a6b5f52c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
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.
* tests/zerosize-ptr.h [OS/2 kLIBC]: Don't use mmap().
diff --git a/lib/dirent.in.h b/lib/dirent.in.h
index 2e2c5119a1..4666972b15 100644
--- a/lib/dirent.in.h
+++ b/lib/dirent.in.h
@@ -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