# HG changeset patch # User Sebastien Jodogne # Date 1607859450 -3600 # Node ID 48aa43c14bb3689ff87f67fc0aec11c81cb35e95 # Parent 02ad3ea95fcaa44cc4ff0cfe1fb300a5f22cdf10 definition of isinf() and isnan() in msvc2008 diff -r 02ad3ea95fca -r 48aa43c14bb3 Resources/CMake/PostgreSQLConfiguration.cmake --- a/Resources/CMake/PostgreSQLConfiguration.cmake Sat Dec 12 19:45:47 2020 +0100 +++ b/Resources/CMake/PostgreSQLConfiguration.cmake Sun Dec 13 12:37:30 2020 +0100 @@ -62,11 +62,33 @@ ## if (CMAKE_SYSTEM_NAME STREQUAL "Windows") + if (EXISTS ${AUTOGENERATED_DIR}/pg_config_os.h) + set(FirstRun OFF) + else() + set(FirstRun ON) + endif() + configure_file( ${LIBPQ_SOURCES_DIR}/src/include/port/win32.h ${AUTOGENERATED_DIR}/pg_config_os.h COPYONLY) + if (FirstRun) + # This is needed on MSVC2008 to have an implementation of "isinf()" and "isnan()" + file(APPEND ${AUTOGENERATED_DIR}/pg_config_os.h " +#if defined(_MSC_VER) +# include +# include +# if !defined(isinf) +# define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 : ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0)) +# endif +# if !defined(isnan) +# define isnan(d) (_isnan(d)) +# endif +#endif +") + endif() + elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") add_definitions( -D_GNU_SOURCE