From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82179 invoked by alias); 13 Nov 2017 09:51:56 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 81856 invoked by uid 9078); 13 Nov 2017 09:51:55 -0000 Date: Mon, 13 Nov 2017 09:51:00 -0000 Message-ID: <20171113095155.81849.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] newlib/.../getreent.c: Allow to be provided by host and do so for RTEMS X-Act-Checkin: newlib-cygwin X-Git-Author: Joel Sherrill X-Git-Refname: refs/heads/master X-Git-Oldrev: 181fe5d2edacfd1578fe881c857dda7eae9ec104 X-Git-Newrev: b1a388799dc98e6d1451fb73aa71097cbf9f37d9 X-SW-Source: 2017-q4/txt/msg00016.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b1a388799dc98e6d1451fb73aa71097cbf9f37d9 commit b1a388799dc98e6d1451fb73aa71097cbf9f37d9 Author: Joel Sherrill Date: Wed Oct 11 07:57:44 2017 -0500 newlib/.../getreent.c: Allow to be provided by host and do so for RTEMS RTEMS provides the option to have a global or per-thread reentrancy as part of application configuration. As part of this, RTEMS provides the implementation of __getreent() as appropriate. Allow the target to determine if this method is present in libc.a. Diff: --- newlib/configure.host | 4 ++-- newlib/libc/reent/getreent.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/newlib/configure.host b/newlib/configure.host index fb3362b..3e950d8 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -586,7 +586,7 @@ case "${host}" in default_newlib_io_long_double="yes" default_newlib_io_pos_args="yes" CC="${CC} -I${cygwin_srcdir}/include" - newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED -D_COMPILING_NEWLIB -DHAVE_BLKSIZE -DHAVE_FCNTL -DMALLOC_PROVIDED" + newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DGETREENT_PROVIDED -DSIGNAL_PROVIDED -D_COMPILING_NEWLIB -DHAVE_BLKSIZE -DHAVE_FCNTL -DMALLOC_PROVIDED" syscall_dir=syscalls ;; *-*-phoenix*) @@ -605,7 +605,7 @@ case "${host}" in default_newlib_io_long_long="yes" default_newlib_io_c99_formats="yes" newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB" - newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC" +newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DGETREENT_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC" # turn off unsupported items in posix directory newlib_cflags="${newlib_cflags} -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT -D_NO_GETPASS -D_NO_SIGSET -D_NO_WORDEXP -D_NO_POPEN -D_NO_POSIX_SPAWN" ;; diff --git a/newlib/libc/reent/getreent.c b/newlib/libc/reent/getreent.c index 60ae6fb..124abce 100644 --- a/newlib/libc/reent/getreent.c +++ b/newlib/libc/reent/getreent.c @@ -1,5 +1,11 @@ /* default reentrant pointer when multithread enabled */ +#ifdef GETREENT_PROVIDED + +int _dummy_getreent; + +#else + #include <_ansi.h> #include @@ -12,3 +18,5 @@ _DEFUN_VOID(__getreent) { return _impure_ptr; } + +#endif