diff --git a/ports/win32/check/config.h b/ports/win32/check/config.h index 8ab68e9..8096eae 100644 --- a/ports/win32/check/config.h +++ b/ports/win32/check/config.h @@ -1,4 +1,6 @@ -/* config.h for check-0.9.8 on win32 under MSVC */ +/* config.h for check-0.9.8 on win32 under MSVC/MinGW */ + +#ifdef _MSC_VER typedef unsigned int pid_t; typedef unsigned int uint32_t; @@ -16,6 +18,9 @@ typedef unsigned int uint32_t; #pragma warning (disable: 4090) /* const assigned to non-const */ #pragma warning (disable: 4996) /* fileno is deprecated */ +#endif /* _ MSC_VER */ + + #define LWIP_UNITTESTS_NOFORK #include diff --git a/ports/win32/include/arch/cc.h b/ports/win32/include/arch/cc.h index 8c64b5d..ca270a8 100644 --- a/ports/win32/include/arch/cc.h +++ b/ports/win32/include/arch/cc.h @@ -32,25 +32,11 @@ #ifndef __ARCH_CC_H__ #define __ARCH_CC_H__ -#if 1 -/* Include some files for defining library routines */ #include /* printf, fflush, FILE */ #include /* abort */ -#else -/* Declare fuction prototypes for assert/diag/error - leads to some warnings, - * but good to test if no includes are missing. */ -int printf(const char *format, ...); -void abort(void); -struct _iobuf; -typedef struct _iobuf FILE; -int fflush(FILE *stream); -#endif - - - -/** @todo fix some warnings: don't use #pragma if compiling with cygwin gcc */ -#ifndef __GNUC__ #include + +#ifdef _MSC_VER #pragma warning (disable: 4244) /* disable conversion warning (implicit integer promotion!) */ #pragma warning (disable: 4127) /* conditional expression is constant */ #pragma warning (disable: 4996) /* 'strncpy' was declared deprecated */ @@ -78,12 +64,19 @@ typedef u32_t sys_prot_t; /* Define (sn)printf formatters for these lwIP types */ #define X8_F "02x" #define U16_F "hu" -#define S16_F "hd" -#define X16_F "hx" #define U32_F "lu" #define S32_F "ld" #define X32_F "lx" -#define SZT_F U32_F + +#ifdef __GNUC__ +#define S16_F "d" +#define X16_F "uX" +#define SZT_F "u" +#else +#define S16_F "hd" +#define X16_F "hx" +#define SZT_F "lu" +#endif /* Compiler hints for packing structures */ #define PACK_STRUCT_STRUCT @@ -99,8 +92,10 @@ typedef u32_t sys_prot_t; printf("Assertion \"%s\" failed at line %d in %s\n", message, __LINE__, __FILE__); \ fflush(NULL);handler;} } while(0) +#ifdef _MSC_VER /* C runtime functions redefined */ #define snprintf _snprintf +#endif u32_t dns_lookup_external_hosts_file(const char *name);