MSVC includes for inet/sockets
authorElizabeth Smith <elizabeths@fb.com>
Thu, 10 Jul 2014 22:19:57 +0000 (15:19 -0700)
committerTudor Bosman <tudorb@fb.com>
Mon, 14 Jul 2014 19:13:56 +0000 (12:13 -0700)
Summary:
MSVC has all the sockets and internet functionality required except for one missing item - which can safely be defined to a windows specific type
But it requires a different set of headers than on *nix systems

Test Plan: fbconfig -r folly && fbmake runtests

Reviewed By: delong.j@fb.com

FB internal diff: D1413265

folly/detail/IPAddress.h

index ef8b85a6751709445bad88f7c1bf350ef957038f..a9ffe4d90de54f46d43881fa1241704be3103a8a 100644 (file)
 #include <vector>
 
 extern "C" {
+#ifndef _MSC_VER
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+// missing in socket headers
+#define sa_family_t ADDRESS_FAMILY
+#endif
+
 #include <sys/types.h>
 }