mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 20:03:02 +01:00
Much better ways to check for things that do not work correct with plain K&R C
This commit is contained in:
parent
4daf589cc5
commit
3128735e9e
31
configure.in
31
configure.in
@ -563,30 +563,19 @@ AC_CHECK_LIB(supc++, main, XE_APPEND(-lsupc++, STATIC_CXXSUPPORT_LIB))
|
||||
AC_CHECK_LIB(gcc_eh, main, XE_APPEND(-lgcc_eh, STATIC_CXXSUPPORT_LIB))
|
||||
AC_SUBST(STATIC_CXXSUPPORT_LIB)
|
||||
|
||||
AC_LANG_PUSH(C++)
|
||||
dnl check for INFINITY in math.h
|
||||
dnl _ISOC99_SOURCE is defined to emulate C++ compilation in plain-C conftest.c
|
||||
AC_TRY_COMPILE([#define _ISOC99_SOURCE 1
|
||||
#include <math.h>],
|
||||
[double x = INFINITY;],
|
||||
[AC_DEFINE(HAVE_INFINITY, 1,
|
||||
[Define this if INFINITY is defined in math.h])])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <math.h>]], [[double x = INFINITY;]])],
|
||||
AC_DEFINE(HAVE_INFINITY, 1, [Define this if INFINITY is defined in math.h]))
|
||||
|
||||
dnl check for va_copy() in stdarg.h
|
||||
dnl _ISOC99_SOURCE is defined to emulate C++ compilation in plain-C conftest.c
|
||||
AC_TRY_COMPILE([#define _ISOC99_SOURCE 1
|
||||
#include <stdarg.h>
|
||||
void vafun(const char* fmt, ...)
|
||||
{
|
||||
va_list par, par2;
|
||||
va_start(par, fmt);
|
||||
va_copy(par2, par);
|
||||
va_end(par2);
|
||||
va_end(par);
|
||||
}
|
||||
],
|
||||
[exit(0);],
|
||||
[AC_DEFINE(HAVE_VA_COPY, 1,
|
||||
[Define this if va_copy() is defined in stdarg.h])])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <stdarg.h>
|
||||
void vafun(const char* fmt, ...) {va_list par, par2; va_start(par, fmt); va_copy(par2, par); va_end(par2); va_end(par);}]],
|
||||
[[return 0;]])],
|
||||
AC_DEFINE(HAVE_VA_COPY, 1, [Define this if va_copy() is defined in stdarg.h]))
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
dnl Check for functions
|
||||
AC_CHECK_FUNCS(gettimeofday)
|
||||
|
Loading…
Reference in New Issue
Block a user