Patch by Gisle Vanem: fix Win32 port for MinGW

This commit is contained in:
Simon Goldschmidt 2011-09-29 21:43:53 +02:00
parent 288914b5c0
commit eee1d67e7a
2 changed files with 20 additions and 20 deletions

View File

@ -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 <io.h>

View File

@ -32,25 +32,11 @@
#ifndef __ARCH_CC_H__
#define __ARCH_CC_H__
#if 1
/* Include some files for defining library routines */
#include <stdio.h> /* printf, fflush, FILE */
#include <stdlib.h> /* 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 <limits.h>
#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);