public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: newlib@sourceware.org
Subject: [PATCH v2] Cygwin: syscalls.cc: Include ../stdio/local.h
Date: Thu, 12 May 2022 09:08:14 +0200	[thread overview]
Message-ID: <20220512070814.69477-1-sebastian.huber@embedded-brains.de> (raw)

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


             reply	other threads:[~2022-05-12  7:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12  7:08 Sebastian Huber [this message]
2022-05-12  8:15 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220512070814.69477-1-sebastian.huber@embedded-brains.de \
    --to=sebastian.huber@embedded-brains.de \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).