[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/7] dirent: Redefine dirfd macro as a rpl function always
From: |
KO Myung-Hun |
Subject: |
[PATCH 6/7] dirent: Redefine dirfd macro as a rpl function always |
Date: |
Tue, 19 Jan 2021 01:40:12 +0900 |
On OS/2 kLIBC, dirfd is defined as a macro not a function. Because of
this, dirfd is not redefined as rpl function in C++ mode. As a result,
the following error occurs:
-----
./../gllib/dirent.h:689:1: error: 'dirfd' was not declared in this scope; did
you mean 'gnulib::dirfd'?
689 | _GL_CXXALIASWARN (dirfd);
| ^~~~~~~~~~~~~~~~
./../gllib/dirent.h:669:1: note: 'gnulib::dirfd' declared here
669 | _GL_CXXALIAS_RPL (dirfd, int, (DIR *));
| ^~~~~~~~~~~~~~~~
-----
* lib/dirent.in.h (dirfd): Redefine dirfd macro as a rpl function always.
---
lib/dirent.in.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/dirent.in.h b/lib/dirent.in.h
index 2e2c5119a..14ce5b987 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)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) || defined dirfd
+ /* If dirfd is a macro, re-define it as a rpl function always. */
# undef dirfd
# define dirfd rpl_dirfd
# endif
--
2.22.0
- [PATCH 1/7] spawn: Use special invocation for <spawn.h> on OS/2 kLIBC, KO Myung-Hun, 2021/01/18
- [PATCH 2/7] yield: Fix linkage to threadlib on OS/2 kLIBC, KO Myung-Hun, 2021/01/18
- [PATCH 4/7] stdlib: putenv() needs a cast on OS/2 kLIBC, KO Myung-Hun, 2021/01/18
- [PATCH 5/7] zerosize-ptr: Fix compilation on OS/2 kLIBC, KO Myung-Hun, 2021/01/18
- [PATCH 6/7] dirent: Redefine dirfd macro as a rpl function always,
KO Myung-Hun <=
- [PATCH 3/7] stddef: Fix compilation for max_align_t on OS/2 kLIBC, KO Myung-Hun, 2021/01/18
- [PATCH 7/7] spawn-pipe: Fix SIGSEGV on OS/2 kLIBC, KO Myung-Hun, 2021/01/18
- Re: [PATCH 1/7] spawn: Use special invocation for <spawn.h> on OS/2 kLIBC, Bruno Haible, 2021/01/19