* [PATCH v2] Cygwin: syscalls.cc: Include ../stdio/local.h
@ 2022-05-12 7:08 Sebastian Huber
2022-05-12 8:15 ` Corinna Vinschen
0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Huber @ 2022-05-12 7:08 UTC (permalink / raw)
To: newlib
Include Newlib internal ../stdio/local.h for the _fwalk_reent() declaration.
Add C++ support to local.h
---
newlib/libc/stdio/local.h | 5 +++++
winsup/cygwin/syscalls.cc | 5 ++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h
index 30c534dcd..abe5c380a 100644
--- a/newlib/libc/stdio/local.h
+++ b/newlib/libc/stdio/local.h
@@ -23,6 +23,7 @@
*/
#include <_ansi.h>
+#include <sys/cdefs.h>
#include <reent.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -140,6 +141,8 @@
#endif /* __SINGLE_THREAD__ || __IMPL_UNLOCKED__ */
+__BEGIN_DECLS
+
extern wint_t __fgetwc (struct _reent *, FILE *);
extern wint_t __fputwc (struct _reent *, wchar_t, FILE *);
extern u_char *__sccl (char *, u_char *fmt);
@@ -338,3 +341,5 @@ typedef enum __packed {
extern const __CH_CLASS __chclass[256];
extern const __STATE __state_table[MAX_STATE][MAX_CH_CLASS];
extern const __ACTION __action_table[MAX_STATE][MAX_CH_CLASS];
+
+__END_DECLS
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 1cecaa017..885498a1a 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -64,6 +64,8 @@ details. */
#include "child_info.h"
#include <cygwin/fs.h> /* needed for RENAME_NOREPLACE */
+#include "../../newlib/libc/stdio/local.h" /* needed for _fwalk_reent() */
+
#undef _close
#undef _lseek
#undef _open
@@ -3057,9 +3059,6 @@ _cygwin_istext_for_stdio (int fd)
return 1;
}
-/* internal newlib function */
-extern "C" int _fwalk_reent (struct _reent *ptr, int (*function) (struct _reent *, FILE *));
-
static int
setmode_helper (struct _reent *ptr __unused, FILE *f)
{
--
2.35.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] Cygwin: syscalls.cc: Include ../stdio/local.h
2022-05-12 7:08 [PATCH v2] Cygwin: syscalls.cc: Include ../stdio/local.h Sebastian Huber
@ 2022-05-12 8:15 ` Corinna Vinschen
0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2022-05-12 8:15 UTC (permalink / raw)
To: newlib
On May 12 09:08, Sebastian Huber wrote:
> Include Newlib internal ../stdio/local.h for the _fwalk_reent() declaration.
> Add C++ support to local.h
As I wrote in my last reply to patch 9, please don't include
internal newlib headers. Let's move these declarations, as far
as they are required from Cygwin, to sys/reeent.h or sys/stdio.h,
or some other adequate system header.
Thanks,
Corinna
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-12 8:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 7:08 [PATCH v2] Cygwin: syscalls.cc: Include ../stdio/local.h Sebastian Huber
2022-05-12 8:15 ` Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).