Do test for get{host,serv}byname_r in C++ mode, so non visible declarations

cannot break compilation of gsocket.cpp.
Replaced AC_LANG_SAVE/RESTORE by AC_LANG_PUSH/POP for consistency.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2006-01-28 13:52:17 +00:00
parent e8027adbb6
commit c52e0d0e51

View File

@@ -1402,8 +1402,7 @@ dnl is -traditional needed for correct compilations
dnl adds -traditional for gcc if needed
AC_PROG_GCC_TRADITIONAL
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
dnl C++-compiler checks
dnl defines CXX with the compiler to use
@@ -1415,7 +1414,7 @@ dnl see CFLAGS line above
CXXFLAGS=${CXXFLAGS:=}
AC_BAKEFILE_PROG_CXX
AC_LANG_RESTORE
AC_LANG_POP
dnl ranlib command
dnl defines RANLIB with the appropriate command
@@ -1670,8 +1669,7 @@ case "${host}" in
dnl ---------------------------------------------------------------------
dnl (non-OS/2-only piece)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_CACHE_CHECK([for strcasecmp() in string.h], ac_cv_string_strcasecmp, [
AC_TRY_LINK([
@@ -1707,7 +1705,7 @@ case "${host}" in
fi
fi
AC_LANG_RESTORE
AC_LANG_POP
dnl (end of non-OS/2-only piece)
;;
esac
@@ -1897,8 +1895,7 @@ if test "x$wx_largefile" = "xyes"; then
[if -D__STDC_EXT__ is required],
wx_cv_STDC_EXT_required,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_TRY_COMPILE(
[],
[
@@ -1909,7 +1906,7 @@ if test "x$wx_largefile" = "xyes"; then
wx_cv_STDC_EXT_required=no,
wx_cv_STDC_EXT_required=yes
)
AC_LANG_RESTORE
AC_LANG_POP
]
)
if test "x$wx_cv_STDC_EXT_required" = "xyes"; then
@@ -2643,13 +2640,12 @@ if test "$wxUSE_EXPAT" != "no"; then
AC_CACHE_CHECK([if expat.h is valid C++ header],
wx_cv_expat_is_not_broken,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([#include <expat.h>],[],
wx_cv_expat_is_not_broken=yes,
wx_cv_expat_is_not_broken=no
)
AC_LANG_RESTORE
AC_LANG_POP
]
)
if test "$wx_cv_expat_is_not_broken" = "yes" ; then
@@ -3971,8 +3967,7 @@ AC_CHECK_TYPES(ssize_t)
dnl check what exactly size_t is on this machine - this is necessary to avoid
dnl ambiguous overloads in several places, notably wx/string.h and wx/array.h
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_CACHE_CHECK([if size_t is unsigned int],
wx_cv_size_t_is_uint,
[
@@ -4019,7 +4014,7 @@ else
fi
fi
AC_LANG_RESTORE
AC_LANG_POP
dnl ---------------------------------------------------------------------------
dnl Checks for structures
@@ -4098,8 +4093,7 @@ fi
dnl *printf() functions sometimes are available in the library but not
dnl prototyped -- if this is the case, we can't use them from C++ code, but to
dnl detect this we have to use C++ compiler for testing
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
dnl check for vsnprintf() -- a safe version of vsprintf())
dnl
@@ -4253,7 +4247,7 @@ if test "$wxUSE_UNICODE" = yes; then
[AC_MSG_RESULT([no])]);
fi
AC_LANG_RESTORE
AC_LANG_POP
if test "x$ac_cv_header_fnmatch_h" = "xyes"; then
AC_CHECK_FUNCS(fnmatch)
@@ -4269,11 +4263,10 @@ if test "$TOOLKIT" != "MSW"; then
dnl check for available version of iconv()
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AM_ICONV
LIBS="$LIBICONV $LIBS"
AC_LANG_RESTORE
AC_LANG_POP
dnl check for POSIX signals if we need them
if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
@@ -4285,8 +4278,7 @@ if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
fi
if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler,
[
@@ -4303,7 +4295,7 @@ if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
])
])
AC_LANG_RESTORE
AC_LANG_POP
AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
fi
@@ -4311,8 +4303,7 @@ fi
dnl backtrace() and backtrace_symbols() for wxStackWalker
if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace,
[
@@ -4353,7 +4344,7 @@ if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
fi
fi
AC_LANG_RESTORE
AC_LANG_POP
fi
if test "$wxUSE_STACKWALKER" = "yes" -a "$USE_WIN32" != "1" -a "$USE_UNIX" != "1"; then
@@ -4392,8 +4383,7 @@ AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
if test "$wx_cv_func_statfs" = "yes"; then
dnl check whether we have its dcelaration too: some systems (AIX 4) lack it
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl,
AC_TRY_COMPILE(
[
@@ -4412,7 +4402,7 @@ if test "$wx_cv_func_statfs" = "yes"; then
wx_cv_func_statfs_decl=no
)
)
AC_LANG_RESTORE
AC_LANG_POP
if test "$wx_cv_func_statfs_decl" = "yes"; then
AC_DEFINE(HAVE_STATFS_DECL)
@@ -4443,8 +4433,7 @@ else
dnl
dnl for this check C++ compiler has to be used as passing incompatible
dnl pointers is just a warning and not an error in C
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_CACHE_CHECK(for statvfs argument type, wx_cv_type_statvfs_t,
AC_TRY_COMPILE(
@@ -4480,7 +4469,7 @@ else
)
)
AC_LANG_RESTORE
AC_LANG_POP
if test "$wx_cv_type_statvfs_t" != "unknown"; then
AC_DEFINE(HAVE_STATVFS)
@@ -4556,12 +4545,11 @@ AC_CHECK_FUNCS(uname gethostname, break)
dnl check for MT-safe version of strtok (on DEC Alpha, it's ok for C compiler
dnl but not for C++ one - hence change language)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_CHECK_FUNCS(strtok_r)
AC_LANG_RESTORE
AC_LANG_POP
dnl check for inet_addr and inet_aton (these may live either in libc, or in
dnl libnsl or libresolv or libsocket)
@@ -5001,6 +4989,7 @@ dnl safety issues and supports IPv6, however there currently is no code
dnl for it, so testing for it is temporarily disabled and we are restricted
dnl to gethostbyname_r/gethostbyaddr_r and getservbyname_r
AC_LANG_PUSH(C++)
dnl AC_CHECK_FUNC(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO), [
dnl no getaddrinfo, so check for gethostbyname_r and
dnl related functions (taken from python's configure.in)
@@ -5028,6 +5017,7 @@ dnl AC_CHECK_FUNC(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO), [
dnl check to fit this case, if it's really needed. - SN )
dnl ]
dnl )
AC_LANG_POP
if test "$wxUSE_THREADS" = "yes"; then
AC_DEFINE(wxUSE_THREADS)
@@ -5572,8 +5562,7 @@ if test "$wxUSE_DATETIME" = "yes"; then
if test "$ac_cv_func_strptime" = "yes"; then
AC_CACHE_CHECK([for strptime declaration], wx_cv_func_strptime_decl,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_TRY_COMPILE(
[
#include <time.h>
@@ -5585,7 +5574,7 @@ if test "$wxUSE_DATETIME" = "yes"; then
wx_cv_func_strptime_decl=yes,
wx_cv_func_strptime_decl=no
)
AC_LANG_RESTORE
AC_LANG_POP
]
)
fi
@@ -5687,8 +5676,7 @@ if test "$wxUSE_DATETIME" = "yes"; then
wx_cv_func_gettimeofday_has_2_args,
[
dnl on some _really_ old systems it takes only 1 argument
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_TRY_COMPILE(
[
@@ -5716,7 +5704,7 @@ if test "$wxUSE_DATETIME" = "yes"; then
]
)
)
AC_LANG_RESTORE
AC_LANG_POP
])
if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then
@@ -6108,8 +6096,7 @@ if test "$USE_WIN32" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \
if test "$ac_cv_header_ole2_h" = "yes" ; then
if test "$GCC" = yes ; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG_PUSH(C++)
AC_MSG_CHECKING([if g++ requires -fvtable-thunks])
AC_TRY_COMPILE([#include <windows.h>
@@ -6118,7 +6105,7 @@ if test "$USE_WIN32" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(yes)
WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fvtable-thunks"])
AC_LANG_RESTORE
AC_LANG_POP
LIBS=" -lrpcrt4 -loleaut32 -lole32 -luuid$LIBS"
if test "$wxUSE_OLE" = "yes" ; then
AC_DEFINE(wxUSE_OLE)