windows: Add a common Windows header for platform specific wrappers

Include some more basic system headers in utils.h, so we can use that common
header on the different platforms.
This commit is contained in:
Martin Willi
2014-06-03 12:24:34 +02:00
parent b4c51061c3
commit 922ee2c529
11 changed files with 180 additions and 24 deletions
+11 -2
View File
@@ -26,9 +26,18 @@
#include <stdlib.h>
#include <stddef.h>
#include <sys/time.h>
#include <arpa/inet.h>
#include <string.h>
#ifdef WIN32
# include "windows.h"
#else
# define _GNU_SOURCE
# include <arpa/inet.h>
# include <sys/socket.h>
# include <netdb.h>
# include <netinet/in.h>
#endif
/**
* strongSwan program return codes
*/
@@ -273,7 +282,7 @@ static inline bool memeq(const void *x, const void *y, size_t len)
* TODO: since the uintXX_t types are defined by the C99 standard we should
* probably use those anyway
*/
#ifdef __sun
#if defined __sun || defined WIN32
#include <stdint.h>
typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;