# HG changeset patch # User Sebastien Jodogne # Date 1607798747 -3600 # Node ID 02ad3ea95fcaa44cc4ff0cfe1fb300a5f22cdf10 # Parent 0246923d4df9e29f507f1153934b40b1d818daf3 fix build on ubuntu 16.04 diff -r 0246923d4df9 -r 02ad3ea95fca Framework/PostgreSQL/PostgreSQLIncludes.h --- a/Framework/PostgreSQL/PostgreSQLIncludes.h Sat Dec 12 17:49:07 2020 +0100 +++ b/Framework/PostgreSQL/PostgreSQLIncludes.h Sat Dec 12 19:45:47 2020 +0100 @@ -28,6 +28,13 @@ #include #include +// Get "ntohl()" defined +#if defined(_WIN32) +# include +#else +# include +#endif + // PostgreSQL includes #include @@ -35,5 +42,12 @@ # error PG_VERSION_NUM is not defined #endif +#if PG_VERSION_NUM >= 110000 +# include +#else +# include +# undef LOG // This one comes from , and conflicts with +# include +#endif + #include -#include diff -r 0246923d4df9 -r 02ad3ea95fca Framework/PostgreSQL/PostgreSQLResult.cpp --- a/Framework/PostgreSQL/PostgreSQLResult.cpp Sat Dec 12 17:49:07 2020 +0100 +++ b/Framework/PostgreSQL/PostgreSQLResult.cpp Sat Dec 12 19:45:47 2020 +0100 @@ -22,13 +22,6 @@ #include "PostgreSQLIncludes.h" // Must be the first #include "PostgreSQLResult.h" -// Get "ntohl()" defined -#if defined(_WIN32) -# include -#else -# include -#endif - #include "../Common/BinaryStringValue.h" #include "../Common/FileValue.h" #include "../Common/Integer64Value.h" diff -r 0246923d4df9 -r 02ad3ea95fca Resources/CMake/PostgreSQLConfiguration.cmake --- a/Resources/CMake/PostgreSQLConfiguration.cmake Sat Dec 12 17:49:07 2020 +0100 +++ b/Resources/CMake/PostgreSQLConfiguration.cmake Sat Dec 12 19:45:47 2020 +0100 @@ -195,9 +195,9 @@ endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h;winsock2.h;ws2tcpip.h") + set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h;winsock2.h;ws2tcpip.h;float.h;math.h") else() - set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h;sys/socket.h;netdb.h") + set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h;sys/socket.h;netdb.h;float.h;math.h") endif() check_type_size("size_t" SIZEOF_SIZE_T) @@ -221,6 +221,8 @@ check_function_exists(strlcpy HAVE_STRLCPY) check_function_exists(getpeereid HAVE_GETPEEREID) check_function_exists(getpeerucred HAVE_GETPEERUCRED) + check_function_exists(isinf HAVE_ISINF) + check_function_exists(isnan HAVE_ISNAN) check_symbol_exists(strlcpy "stdio.h;string.h" HAVE_DECL_STRLCPY) if (NOT HAVE_DECL_STRLCPY) @@ -392,10 +394,15 @@ ${LIBPQ_SOURCES_DIR}/src/port/open.c ${LIBPQ_SOURCES_DIR}/src/port/pgsleep.c ${LIBPQ_SOURCES_DIR}/src/port/system.c - ${LIBPQ_SOURCES_DIR}/src/port/win32error.c ${LIBPQ_SOURCES_DIR}/src/port/win32setlocale.c ) + if (CMAKE_COMPILER_IS_GNUCXX OR + (MSVC AND MSVC_VERSION GREATER 1800)) + # Starting Visual Studio 2013 (version 1800), it is necessary to also add "win32error.c" + LIST(APPEND LIBPQ_SOURCES ${LIBPQ_SOURCES_DIR}/src/port/win32error.c) + endif() + if (MSVC) include_directories( ${LIBPQ_SOURCES_DIR}/src/include/port/win32_msvc