]> git.pond.sub.org Git - empserver/commitdiff
[_WIN32, __GNUC__]: Reorganize the include files for WIN32 to
authorRon Koenderink <rkoenderink@yahoo.ca>
Thu, 13 Jul 2006 21:14:16 +0000 (21:14 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Thu, 13 Jul 2006 21:14:16 +0000 (21:14 +0000)
separate the MinGW environment from the MSVC environment and
WIN32 environment.  Reorganize the order of the includes so
the system files are always loaded first to prevent with misc.h defines.
Remove system file includes from misc.h.

15 files changed:
include/misc.h
src/lib/commands/add.c
src/lib/commands/disa.c
src/lib/commands/enab.c
src/lib/commands/new.c
src/lib/commands/powe.c
src/lib/commands/turn.c
src/lib/common/file.c
src/lib/common/log.c
src/lib/common/wantupd.c
src/lib/player/accept.c
src/lib/player/empdis.c
src/lib/player/player.c
src/lib/subs/wu.c
src/lib/update/anno.c

index c5c7eb93aa300e0ae0b83f1b5045b73659a25aef..bb641113f75d0d2ba69a62c98930fe82854d0eb0 100644 (file)
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 
-#if defined(_WIN32)
+#ifdef _WIN32
+#ifndef __GNUC__
+
 typedef long ssize_t;
 
 /* integral mismatch, due to misuse of sector short */
 typedef long ssize_t;
 
 /* integral mismatch, due to misuse of sector short */
-#ifndef __GNUC__
 #pragma warning (disable : 4761 )
 #pragma warning (disable : 4761 )
-#endif
-
-#include <io.h>
 
 
-#define random rand
-#define srandom srand
-
-#ifdef __GNUC__
-#include <string.h>
-#else
 #define strncasecmp(s1, s2, s3) _strnicmp((s1), (s2), (s3))
 #define strncasecmp(s1, s2, s3) _strnicmp((s1), (s2), (s3))
-#endif
-#define mkdir(dir,perm) _mkdir((dir))
 
 typedef int pid_t;
 #define vsnprintf _vsnprintf
 #define snprintf _snprintf
 
 
 typedef int pid_t;
 #define vsnprintf _vsnprintf
 #define snprintf _snprintf
 
+#endif /* !__GNUC__ */
+
+#define mkdir(dir,perm) _mkdir((dir))
+#define random rand
+#define srandom srand
+
 #endif /* _WIN32 */
 
 /* This is the structure we use to keep track of the global mobility
 #endif /* _WIN32 */
 
 /* This is the structure we use to keep track of the global mobility
index 140a0901a159b95d5ad19578040e622d5664ac63..bf4fa2fecba6a8a2929940c34c24c085bd7dbd8c 100644 (file)
 #include <config.h>
 
 #include <fcntl.h>
 #include <config.h>
 
 #include <fcntl.h>
+#if defined(_WIN32) && !defined(__GNUC__)
+#include <io.h>
+#endif
+
 #include "commands.h"
 #include "land.h"
 #include "optlist.h"
 #include "commands.h"
 #include "land.h"
 #include "optlist.h"
index 109d477b1214cfae7ea2651947799361e0ca5e78..a9fda57e2d42528c015a64404d46fc34d40aef2b 100644 (file)
@@ -33,6 +33,9 @@
 
 #include <config.h>
 
 
 #include <config.h>
 
+#if defined(_WIN32) && !defined(__GNUC__)
+#include <io.h>
+#endif
 #include <fcntl.h>
 #if !defined(_WIN32)
 #include <unistd.h>
 #include <fcntl.h>
 #if !defined(_WIN32)
 #include <unistd.h>
index 9ae4972b0c6cf764240cd174fd03bbb2f786fa89..01867acc42d7b066c8fedccb86da3c0651144d9b 100644 (file)
@@ -35,6 +35,8 @@
 
 #if !defined(_WIN32)
 #include <unistd.h>
 
 #if !defined(_WIN32)
 #include <unistd.h>
+#elif defined(__GNUC__)
+#include <io.h>
 #endif
 #include "commands.h"
 #include "optlist.h"
 #endif
 #include "commands.h"
 #include "optlist.h"
index 76014fbb36913b568c9b9fd43264e871ffc23e5c..2a8a8917612b86fb4090c640926092869fb8f30e 100644 (file)
 #include <config.h>
 
 #include <fcntl.h>
 #include <config.h>
 
 #include <fcntl.h>
-#ifndef _WIN32
+#if defined(_WIN32) && !defined(__GNUC__)
+#include <io.h>
+#endif
+#if !defined(_WIN32)
 #include <unistd.h>
 #endif
 #include "commands.h"
 #include <unistd.h>
 #endif
 #include "commands.h"
index c7b526ed6ba75bbb4df3946874df20078118f202..3cae34395ce545af421ad29291e2488c9093a4f1 100644 (file)
  *     Markus Armbruster, 2006
  */
 
  *     Markus Armbruster, 2006
  */
 
-#include <config.h>
+#include <config.h>\r
+\r
+#ifdef _WIN32\r
+#include <io.h>\r
+#endif
 
 #include "commands.h"
 #include "item.h"
 
 #include "commands.h"
 #include "item.h"
index 5876cff58a000333446fef0e7aca846fe1e30dea..a269ee64ce074b72f2881615e8bafa22d95da12a 100644 (file)
@@ -36,6 +36,8 @@
 #include <errno.h>
 #if !defined(_WIN32)
 #include <unistd.h>
 #include <errno.h>
 #if !defined(_WIN32)
 #include <unistd.h>
+#elif defined(__GNUC__)
+#include <io.h>
 #endif
 #include "tel.h"
 #include "commands.h"
 #endif
 #include "tel.h"
 #include "commands.h"
index 53d1e52f16b743a4c82cf18ea750c3098b0b7508..03f489eb195eef6ba60b07544ea4150fafcda755 100644 (file)
@@ -36,6 +36,9 @@
 #include <config.h>
 
 #include <errno.h>
 #include <config.h>
 
 #include <errno.h>
+#if defined(_WIN32) && !defined(__GNUC__)
+#include <io.h>
+#endif
 #include <fcntl.h>
 #include <signal.h>
 #include <sys/types.h>
 #include <fcntl.h>
 #include <signal.h>
 #include <sys/types.h>
index 621f204a1e4cfc56b35776583f5ccfe136ba591b..22184d23ccfb87c72f45afea5c11954e4059b781 100644 (file)
@@ -33,7 +33,9 @@
 
 #include <config.h>
 
 
 #include <config.h>
 
-#include "misc.h"
+#if defined(_WIN32) && !defined(__GNUC__)
+#include <io.h>
+#endif
 #if !defined(_WIN32)
 #include <unistd.h>
 #endif
 #if !defined(_WIN32)
 #include <unistd.h>
 #endif
@@ -41,6 +43,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <time.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <time.h>
+#include "misc.h"
 #include "optlist.h"
 #include "player.h"
 #include "prototypes.h"
 #include "optlist.h"
 #include "player.h"
 #include "prototypes.h"
index 7ad016edaafad0f503a8236ce357f575f87bb99f..b3628c4363284ed0b2cd49636ff8d9e939327bec 100644 (file)
@@ -35,6 +35,9 @@
 
 #include <fcntl.h>
 #include <stdio.h>
 
 #include <fcntl.h>
 #include <stdio.h>
+#if defined(_WIN32) && !defined(__GNUC__)
+#include <io.h>
+#endif
 #include <time.h>
 #if !defined(_WIN32)
 #include <unistd.h>
 #include <time.h>
 #if !defined(_WIN32)
 #include <unistd.h>
index 3a8192ae3453d54703d57c80f267f3d1d7c1beb6..06d1fbc207c5c2d322329515f8b37aa3c12c778b 100644 (file)
@@ -38,6 +38,9 @@
 #define WIN32
 #include <winsock2.h>
 #undef NS_ALL
 #define WIN32
 #include <winsock2.h>
 #undef NS_ALL
+#ifndef __GNUC__
+#include <io.h>
+#endif
 #else
 #include <sys/types.h>
 #include <sys/socket.h>
 #else
 #include <sys/types.h>
 #include <sys/socket.h>
index cf2204eb3c3db90d479803e7de41539f1cafadf1..5d05ee252846b1ea01b508c726ed3a4d70d4dfad 100644 (file)
 #include <config.h>
 
 #include <stdio.h>
 #include <config.h>
 
 #include <stdio.h>
+#include <fcntl.h>
+#include <time.h>
+#if !defined(_WIN32)
+#include <unistd.h>
+#endif
+#include <signal.h>
+
 #include "com.h"
 #include "empio.h"
 #include "file.h"
 #include "com.h"
 #include "empio.h"
 #include "file.h"
 #include "prototypes.h"
 #include "tel.h"
 
 #include "prototypes.h"
 #include "tel.h"
 
-#include <fcntl.h>
-#include <time.h>
-#if !defined(_WIN32)
-#include <unistd.h>
-#endif
-#include <signal.h>
 
 #define KEEP_COMMANDS 50
 
 
 #define KEEP_COMMANDS 50
 
index 95af6d43bf7a8608e0496becbeb644d083747973..67c879dd5c310e22cda7554b9c9167bbfd0f89f1 100644 (file)
  */
 
 #include <config.h>
  */
 
 #include <config.h>
+#if !defined(_WIN32)
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
 
 #include "com.h"
 #include "empio.h"
 
 #include "com.h"
 #include "empio.h"
 #include "sect.h"
 #include "tel.h"
 
 #include "sect.h"
 #include "tel.h"
 
-#if !defined(_WIN32)
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
 
 static int command(void);
 static int status(void);
 
 static int command(void);
 static int status(void);
index f495387a2b1aefe958f30884cc8334d038ab7a52..389505879f5dbfe2ae0a0c4fca61cc465546c680 100644 (file)
@@ -33,6 +33,9 @@
 
 #include <config.h>
 
 
 #include <config.h>
 
+#if defined(_WIN32) && !defined(__GNUC__)
+#include <io.h>
+#endif
 #include <fcntl.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <fcntl.h>
 #include <stdarg.h>
 #include <stdlib.h>
index b374a7e3efc829d74b4478cf7c09dfd5f3d5bbd2..43b8c3c6103620e1bf62694f06503bd8b0e426ce 100644 (file)
@@ -36,6 +36,9 @@
 
 #include <config.h>
 
 
 #include <config.h>
 
+#if defined(_WIN32) && defined(__GNUC__)
+#include <io.h>
+#endif
 #include <stdio.h>
 #include <time.h>
 #include "tel.h"
 #include <stdio.h>
 #include <time.h>
 #include "tel.h"