1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

setup.h handles definition of _REENTRANT based on NEED_REENTRANT

definition which might be defined in config.h or config-*.h files
This commit is contained in:
Yang Tse 2008-07-27 03:16:37 +00:00
parent 3d4fb5136d
commit 1ac1212925
5 changed files with 32 additions and 33 deletions

View File

@ -310,7 +310,7 @@ dnl CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R
dnl ------------------------------------------------- dnl -------------------------------------------------
dnl Checks if the preprocessor _REENTRANT definition dnl Checks if the preprocessor _REENTRANT definition
dnl makes several _r functions compiler visible. dnl makes several _r functions compiler visible.
dnl Internal macro for CONFIGURE_REENTRANT. dnl Internal macro for CARES_CONFIGURE_REENTRANT.
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R], [ AC_DEFUN([CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R], [
# #
@ -351,23 +351,18 @@ dnl -------------------------------------------------
dnl This macro ensures that configuration tests done dnl This macro ensures that configuration tests done
dnl after this will execute with preprocessor symbol dnl after this will execute with preprocessor symbol
dnl _REENTRANT defined. This macro also ensures that dnl _REENTRANT defined. This macro also ensures that
dnl the generated config file will equally define it. dnl the generated config file defines NEED_REENTRANT
dnl Internal macro for CONFIGURE_REENTRANT. dnl and that in turn setup.h will define _REENTRANT.
dnl Internal macro for CARES_CONFIGURE_REENTRANT.
AC_DEFUN([CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT], [ AC_DEFUN([CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT], [
AH_VERBATIM([NEED_REENTRANT], AC_DEFINE(NEED_REENTRANT, 1,
[/* Configure process defines NEED_REENTRANT to 1 when it finds out that */ [Define to 1 if _REENTRANT preprocessor symbol must be defined.])
/* _REENTRANT is required or already defined for proper configuration. */
@%:@undef NEED_REENTRANT
@%:@if defined(NEED_REENTRANT) && !defined(_REENTRANT)
@%:@ define _REENTRANT
@%:@endif])
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
[@%:@ifndef _REENTRANT [@%:@ifndef _REENTRANT
@%:@ define _REENTRANT @%:@ define _REENTRANT
@%:@endif] @%:@endif]
_ACEOF _ACEOF
AC_DEFINE(NEED_REENTRANT, 1, [])
]) ])

View File

@ -40,13 +40,15 @@
#endif /* HAVE_CONFIG_H */ #endif /* HAVE_CONFIG_H */
/* /*
* Solaris needs _REENTRANT set for a few function prototypes and * HP-UX needs _REENTRANT set for a few function prototypes and
* things to appear in the system header files. Unixware needs it * things to appear in the system header files. Unixware needs it
* to build proper reentrant code. Others may also need it. * to build proper reentrant code. Others may also need it.
*/ */
#ifndef _REENTRANT #ifdef NEED_REENTRANT
# define _REENTRANT # ifndef _REENTRANT
# define _REENTRANT
# endif
#endif #endif
/* /*

View File

@ -73,13 +73,15 @@
#endif /* HAVE_CONFIG_H */ #endif /* HAVE_CONFIG_H */
/* /*
* Solaris needs _REENTRANT set for a few function prototypes and * HP-UX needs _REENTRANT set for a few function prototypes and
* things to appear in the system header files. Unixware needs it * things to appear in the system header files. Unixware needs it
* to build proper reentrant code. Others may also need it. * to build proper reentrant code. Others may also need it.
*/ */
#ifndef _REENTRANT #ifdef NEED_REENTRANT
# define _REENTRANT # ifndef _REENTRANT
# define _REENTRANT
# endif
#endif #endif
/* /*

View File

@ -332,7 +332,7 @@ dnl CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R
dnl ------------------------------------------------- dnl -------------------------------------------------
dnl Checks if the preprocessor _REENTRANT definition dnl Checks if the preprocessor _REENTRANT definition
dnl makes several _r functions compiler visible. dnl makes several _r functions compiler visible.
dnl Internal macro for CONFIGURE_REENTRANT. dnl Internal macro for CURL_CONFIGURE_REENTRANT.
AC_DEFUN([CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R], [ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R], [
# #
@ -373,23 +373,18 @@ dnl -------------------------------------------------
dnl This macro ensures that configuration tests done dnl This macro ensures that configuration tests done
dnl after this will execute with preprocessor symbol dnl after this will execute with preprocessor symbol
dnl _REENTRANT defined. This macro also ensures that dnl _REENTRANT defined. This macro also ensures that
dnl the generated config file will equally define it. dnl the generated config file defines NEED_REENTRANT
dnl Internal macro for CONFIGURE_REENTRANT. dnl and that in turn setup.h will define _REENTRANT.
dnl Internal macro for CURL_CONFIGURE_REENTRANT.
AC_DEFUN([CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT], [ AC_DEFUN([CURL_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT], [
AH_VERBATIM([NEED_REENTRANT], AC_DEFINE(NEED_REENTRANT, 1,
[/* Configure process defines NEED_REENTRANT to 1 when it finds out that */ [Define to 1 if _REENTRANT preprocessor symbol must be defined.])
/* _REENTRANT is required or already defined for proper configuration. */
@%:@undef NEED_REENTRANT
@%:@if defined(NEED_REENTRANT) && !defined(_REENTRANT)
@%:@ define _REENTRANT
@%:@endif])
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
[@%:@ifndef _REENTRANT [@%:@ifndef _REENTRANT
@%:@ define _REENTRANT @%:@ define _REENTRANT
@%:@endif] @%:@endif]
_ACEOF _ACEOF
AC_DEFINE(NEED_REENTRANT, 1, [])
]) ])

View File

@ -72,11 +72,16 @@
#endif /* HAVE_CONFIG_H */ #endif /* HAVE_CONFIG_H */
#if defined(CURLDEBUG) && defined(CURLTOOLDEBUG) /*
/* This is an ugly hack for CURLDEBUG conditions only. We need to include * HP-UX needs _REENTRANT set for a few function prototypes and
the file here, since it might set the _FILE_OFFSET_BITS define, which must * things to appear in the system header files. Unixware needs it
be set BEFORE all normal system headers. */ * to build proper reentrant code. Others may also need it.
#include "../lib/setup.h" */
#ifdef NEED_REENTRANT
# ifndef _REENTRANT
# define _REENTRANT
# endif
#endif #endif
/* /*