Changeset: 87469995e34f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=87469995e34f
Modified Files:
        cmake/monetdb-defines.cmake
        geom/monetdb5/geom.c
Branch: Oct2020
Log Message:

Compiling on Windows. M_PI doesn't have to be defined by math.h and socklen_t 
requires Ws2tcpip.h header to find it


diffs (31 lines):

diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake
--- a/cmake/monetdb-defines.cmake
+++ b/cmake/monetdb-defines.cmake
@@ -299,7 +299,12 @@ macro(monetdb_configure_sizes)
   check_type_size("long int" SIZEOF_LONG_INT LANGUAGE C)
   check_type_size(double SIZEOF_DOUBLE LANGUAGE C)
   check_type_size(wchar_t SIZEOF_WCHAR_T LANGUAGE C)
+  cmake_push_check_state()
+  if(WIN32)
+    set(CMAKE_EXTRA_INCLUDE_FILES "Ws2tcpip.h")
+  endif()
   check_type_size(socklen_t HAVE_SOCKLEN_T LANGUAGE C)
+  cmake_pop_check_state()
 
   if(INT128)
     cmake_push_check_state()
diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -46,6 +46,11 @@ wkbNULLcopy(void)
 
 #ifdef HAVE_PROJ
 
+/* math.h files do not have M_PI defined */
+#ifndef M_PI
+#define M_PI   ((double) 3.14159265358979323846)       /* pi */
+#endif
+
 /** convert degrees to radians */
 static inline void
 degrees2radians(double *x, double *y, double *z)
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to