[_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:
parent
b1399ebbad
commit
d413884a37
15 changed files with 61 additions and 28 deletions
|
@ -40,30 +40,26 @@
|
||||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||||
#define MIN(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;
|
typedef long ssize_t;
|
||||||
|
|
||||||
/* integral mismatch, due to misuse of sector short */
|
/* 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;
|
typedef int pid_t;
|
||||||
#define vsnprintf _vsnprintf
|
#define vsnprintf _vsnprintf
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
|
||||||
|
#endif /* !__GNUC__ */
|
||||||
|
|
||||||
|
#define mkdir(dir,perm) _mkdir((dir))
|
||||||
|
#define random rand
|
||||||
|
#define srandom srand
|
||||||
|
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
/* This is the structure we use to keep track of the global mobility
|
/* This is the structure we use to keep track of the global mobility
|
||||||
|
|
|
@ -34,6 +34,10 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#if defined(_WIN32) && !defined(__GNUC__)
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "land.h"
|
#include "land.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
|
@ -33,6 +33,9 @@
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(__GNUC__)
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
|
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
|
@ -34,7 +34,10 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifndef _WIN32
|
#if defined(_WIN32) && !defined(__GNUC__)
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
#if !defined(_WIN32)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
|
@ -34,7 +34,11 @@
|
||||||
* Markus Armbruster, 2006
|
* Markus Armbruster, 2006
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
#include "tel.h"
|
#include "tel.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#if defined(_WIN32) && !defined(__GNUC__)
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
|
@ -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)
|
#if !defined(_WIN32)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,6 +43,7 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include "misc.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#if defined(_WIN32) && !defined(__GNUC__)
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
#define WIN32
|
#define WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#undef NS_ALL
|
#undef NS_ALL
|
||||||
|
#ifndef __GNUC__
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
|
@ -36,6 +36,13 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <time.h>
|
||||||
|
#if !defined(_WIN32)
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
#include "com.h"
|
#include "com.h"
|
||||||
#include "empio.h"
|
#include "empio.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
@ -48,12 +55,6 @@
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "tel.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
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#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 "com.h"
|
||||||
#include "empio.h"
|
#include "empio.h"
|
||||||
|
@ -48,12 +54,6 @@
|
||||||
#include "sect.h"
|
#include "sect.h"
|
||||||
#include "tel.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 command(void);
|
||||||
static int status(void);
|
static int status(void);
|
||||||
|
|
|
@ -33,6 +33,9 @@
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(__GNUC__)
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#if defined(_WIN32) && defined(__GNUC__)
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "tel.h"
|
#include "tel.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue