Changeset: 9188120cc74c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9188120cc74c
Modified Files:
        clients/mapilib/mapi.c
        common/options/monet_options.c
        common/stream/stream.c
        gdk/gdk_bbp.c
        gdk/gdk_utils.c
        monetdb5/mal/mal_readline.c
        monetdb5/modules/mal/mal_mapi.c
        monetdb_config.h.in
        testing/difflib.c
Branch: cmake-fun
Log Message:

Include header files where they are needed.


diffs (155 lines):

diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -693,7 +693,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#ifndef NATIVE_WIN32
+#ifdef NATIVE_WIN32
+# include <ws2tcpip.h>
+#else
 # include <unistd.h>
 # include <dirent.h>
 # include <sys/un.h>
diff --git a/common/options/monet_options.c b/common/options/monet_options.c
--- a/common/options/monet_options.c
+++ b/common/options/monet_options.c
@@ -35,6 +35,7 @@
 #endif
 
 #ifdef NATIVE_WIN32
+#include <process.h>
 #define getpid _getpid
 #else
 #include <unistd.h>
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -58,6 +58,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #ifdef NATIVE_WIN32
+#include <ws2tcpip.h>
 #include <io.h>
 #else
 # include <unistd.h>
@@ -169,6 +170,10 @@
 #define isatty _isatty
 #endif
 
+#ifndef S_ISREG
+#define S_ISREG(mode)  (((mode) & _S_IFMT) == _S_IFREG)
+#endif
+
 struct stream {
        char *name;             /* name of the stream */
        bool swapbytes;         /* whether to swap bytes */
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -83,6 +83,10 @@
 #define access(f, m)   _access(f, m)
 #endif
 
+#ifndef S_ISDIR
+#define S_ISDIR(mode)  (((mode) & _S_IFMT) == _S_IFDIR)
+#endif
+
 /*
  * The BBP has a fixed address, so re-allocation due to a growing BBP
  * caused by one thread does not disturb reads to the old entries by
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -34,6 +34,7 @@ int GDKverbose = 0;
 #endif
 
 #ifdef NATIVE_WIN32
+#include <process.h>
 #include <io.h>
 #define chdir _chdir
 #define getpid _getpid
diff --git a/monetdb5/mal/mal_readline.c b/monetdb5/mal/mal_readline.c
--- a/monetdb5/mal/mal_readline.c
+++ b/monetdb5/mal/mal_readline.c
@@ -18,6 +18,10 @@
 #include <termios.h>
 #endif
 
+#ifndef S_ISCHR
+#define S_ISCHR(mode)  (((mode) & S_IFMT) == S_IFCHR)
+#endif
+
 static void
 showCommands(void)
 {
diff --git a/monetdb5/modules/mal/mal_mapi.c b/monetdb5/modules/mal/mal_mapi.c
--- a/monetdb5/modules/mal/mal_mapi.c
+++ b/monetdb5/modules/mal/mal_mapi.c
@@ -43,6 +43,7 @@
 #endif
 #ifdef NATIVE_WIN32   /* Windows specific */
 # include <winsock2.h>
+# include <ws2tcpip.h>
 #else           /* UNIX specific */
 # include <unistd.h>     /* gethostname() */
 # include <sys/select.h>
diff --git a/monetdb_config.h.in b/monetdb_config.h.in
--- a/monetdb_config.h.in
+++ b/monetdb_config.h.in
@@ -75,10 +75,7 @@
 #include <crtdbg.h>
 #endif
 
-/* Windows include files */
-#include <process.h>
 #include <windows.h>
-#include <ws2tcpip.h>
 #endif /* _MSC_VER */
 
 /* location where binaries are installed */
@@ -297,15 +294,9 @@
 /* Define to 1 if you have the <sys/mman.h> header file. */
 #cmakedefine HAVE_SYS_MMAN_H 1
 
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#cmakedefine HAVE_SYS_RESOURCE_H 1
-
 /* Define to 1 if you have the <sys/time.h> header file. */
 #cmakedefine HAVE_SYS_TIME_H 1
 
-/* Define to 1 if you have the <sys/un.h> header file. */
-#cmakedefine HAVE_SYS_UN_H 1
-
 /* Define to 1 if you have the `times' function. */
 #cmakedefine HAVE_TIMES 1
 
@@ -528,14 +519,4 @@ typedef __uint128_t uhge;
 #define PROMPT2                "\001\002\n"    /* prompt: more data needed */
 #define PROMPT3                "\001\003\n"    /* prompt: get file content */
 
-#ifndef S_ISREG
-#define S_ISREG(mode)  (((mode) & _S_IFMT) == _S_IFREG)
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(mode)  (((mode) & _S_IFMT) == _S_IFDIR)
-#endif
-#ifndef S_ISCHR
-#define S_ISCHR(mode)  (((mode) & S_IFMT) == S_IFCHR)
-#endif
-
 #endif /* _SEEN_MONETDB_CONFIG_H */
diff --git a/testing/difflib.c b/testing/difflib.c
--- a/testing/difflib.c
+++ b/testing/difflib.c
@@ -17,7 +17,8 @@
 #include <fcntl.h>
 
 #ifdef NATIVE_WIN32
-# include <io.h>
+#include <process.h>
+#include <io.h>
 #define popen _popen
 #define pclose _pclose
 #define getpid _getpid
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to