[_WIN32, __GNUC__]: Reorganize the include files for WIN32 to

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.
This commit is contained in:
Ron Koenderink 2006-07-13 21:14:16 +00:00
parent b1399ebbad
commit d413884a37
15 changed files with 61 additions and 28 deletions

View file

@ -40,30 +40,26 @@
#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 */
#ifndef __GNUC__
#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))
#endif
#define mkdir(dir,perm) _mkdir((dir))
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

View file

@ -34,6 +34,10 @@
#include <config.h>
#include <fcntl.h>
#if defined(_WIN32) && !defined(__GNUC__)
#include <io.h>
#endif
#include "commands.h"
#include "land.h"
#include "optlist.h"

View file

@ -33,6 +33,9 @@
#include <config.h>
#if defined(_WIN32) && !defined(__GNUC__)
#include <io.h>
#endif
#include <fcntl.h>
#if !defined(_WIN32)
#include <unistd.h>

View file

@ -35,6 +35,8 @@
#if !defined(_WIN32)
#include <unistd.h>
#elif defined(__GNUC__)
#include <io.h>
#endif
#include "commands.h"
#include "optlist.h"

View file

@ -34,7 +34,10 @@
#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"

View file

@ -36,6 +36,10 @@
#include <config.h>
#ifdef _WIN32
#include <io.h>
#endif
#include "commands.h"
#include "item.h"
#include "land.h"

View file

@ -36,6 +36,8 @@
#include <errno.h>
#if !defined(_WIN32)
#include <unistd.h>
#elif defined(__GNUC__)
#include <io.h>
#endif
#include "tel.h"
#include "commands.h"

View file

@ -36,6 +36,9 @@
#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>

View file

@ -33,7 +33,9 @@
#include <config.h>
#include "misc.h"
#if defined(_WIN32) && !defined(__GNUC__)
#include <io.h>
#endif
#if !defined(_WIN32)
#include <unistd.h>
#endif
@ -41,6 +43,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <time.h>
#include "misc.h"
#include "optlist.h"
#include "player.h"
#include "prototypes.h"

View file

@ -35,6 +35,9 @@
#include <fcntl.h>
#include <stdio.h>
#if defined(_WIN32) && !defined(__GNUC__)
#include <io.h>
#endif
#include <time.h>
#if !defined(_WIN32)
#include <unistd.h>

View file

@ -38,6 +38,9 @@
#define WIN32
#include <winsock2.h>
#undef NS_ALL
#ifndef __GNUC__
#include <io.h>
#endif
#else
#include <sys/types.h>
#include <sys/socket.h>

View file

@ -36,6 +36,13 @@
#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"
@ -48,12 +55,6 @@
#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

View file

@ -32,6 +32,12 @@
*/
#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"
@ -48,12 +54,6 @@
#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);

View file

@ -33,6 +33,9 @@
#include <config.h>
#if defined(_WIN32) && !defined(__GNUC__)
#include <io.h>
#endif
#include <fcntl.h>
#include <stdarg.h>
#include <stdlib.h>

View file

@ -36,6 +36,9 @@
#include <config.h>
#if defined(_WIN32) && defined(__GNUC__)
#include <io.h>
#endif
#include <stdio.h>
#include <time.h>
#include "tel.h"