From 9cd9d63152f3368c55432b3a2aec6f90ddd062d0 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Tue, 19 Jan 2021 19:23:39 +0100 Subject: [PATCH] dirent: Fix compilation error in C++ mode on OS/2 kLIBC. * lib/dirent.in.h (dirfd): Redefine dirfd macro as a rpl function always. --- ChangeLog | 6 ++++++ lib/dirent.in.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 357c231be8..94a6b5f52c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-01-19 KO Myung-Hun + + 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 zerosize-ptr: Fix compilation on OS/2 kLIBC. 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 -- 2.39.5