changeset 176:0246923d4df9

trying to fix msvc builds with postgresql
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 12 Dec 2020 17:49:07 +0100
parents 1b67c6f8037c
children 02ad3ea95fca
files Framework/PostgreSQL/PostgreSQLIncludes.h Framework/PostgreSQL/PostgreSQLResult.cpp
diffstat 2 files changed, 8 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/PostgreSQL/PostgreSQLIncludes.h	Fri Dec 11 18:51:08 2020 +0100
+++ b/Framework/PostgreSQL/PostgreSQLIncludes.h	Sat Dec 12 17:49:07 2020 +0100
@@ -28,16 +28,6 @@
 #include <cmath>
 #include <Enumerations.h>
 
-/**
- * This include must be before including "c.h" from PostgreSQL,
- * otherwise the function "static bool
- * boost::date_time::special_values_parser<date_type,
- * charT>::__builtin_expect()" from Boost clashes with macro
- * "__builtin_expect()" used by PostgreSQL 11.
- **/
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/system/error_code.hpp>
-
 // PostgreSQL includes
 #include <pg_config.h>
 
@@ -45,11 +35,5 @@
 #  error PG_VERSION_NUM is not defined
 #endif
 
-#if PG_VERSION_NUM >= 110000
-#  include <postgres.h>
-#  undef LOG  // This one comes from <postgres.h>, and conflicts with <Logging.h>
-#endif
-
 #include <libpq-fe.h>
-#include <c.h>
-#include <catalog/pg_type.h>
+#include <catalog/pg_type_d.h>
--- a/Framework/PostgreSQL/PostgreSQLResult.cpp	Fri Dec 11 18:51:08 2020 +0100
+++ b/Framework/PostgreSQL/PostgreSQLResult.cpp	Sat Dec 12 17:49:07 2020 +0100
@@ -22,6 +22,13 @@
 #include "PostgreSQLIncludes.h"  // Must be the first
 #include "PostgreSQLResult.h"
 
+// Get "ntohl()" defined
+#if defined(_WIN32)
+#  include <winsock.h>
+#else
+#  include <arpa/inet.h>
+#endif
+
 #include "../Common/BinaryStringValue.h"
 #include "../Common/FileValue.h"
 #include "../Common/Integer64Value.h"