aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils/utils.h
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-10-11 14:45:56 +0200
committerMartin Willi <martin@revosec.ch>2014-06-03 12:24:34 +0200
commit922ee2c5292ba898ac1ca72c69e877af307b0bc4 (patch)
treebfa2860e468daefd2a356e5702fe23f5472b10c1 /src/libstrongswan/utils/utils.h
parentb4c51061c3c649e948324d1f3ad37ef6e48f8b96 (diff)
downloadstrongswan-922ee2c5292ba898ac1ca72c69e877af307b0bc4.tar.bz2
strongswan-922ee2c5292ba898ac1ca72c69e877af307b0bc4.tar.xz
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.
Diffstat (limited to 'src/libstrongswan/utils/utils.h')
-rw-r--r--src/libstrongswan/utils/utils.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libstrongswan/utils/utils.h b/src/libstrongswan/utils/utils.h
index 392f24e63..ca0d6b9a3 100644
--- a/src/libstrongswan/utils/utils.h
+++ b/src/libstrongswan/utils/utils.h
@@ -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;