src/platform_windows.h
branchkeysync-windows
changeset 1226 a4e082c43cdd
parent 1001 42e0841b71f0
child 1258 9c376b153898
     1.1 --- a/src/platform_windows.h	Fri Sep 30 21:15:32 2016 +0200
     1.2 +++ b/src/platform_windows.h	Fri Sep 30 21:16:56 2016 +0200
     1.3 @@ -4,6 +4,14 @@
     1.4  
     1.5  #pragma warning(disable : 4996)
     1.6  
     1.7 +// We need to make sure winsock2 is included before windows.h, or we will get redefinitions of symbols
     1.8 +// as windows.h includes winsock1.h, so we will have duplicate symbols if windows.h is included first.
     1.9 +// It seems some of our code includes sync.h before including winsock.h, leading to the failure.
    1.10 +// Including winsock2.h here fixes the problem for now...
    1.11 +#ifdef WIN32 
    1.12 +#include <winsock2.h>
    1.13 +#endif // WIN32 
    1.14 +
    1.15  #include <Rpc.h>
    1.16  #include <string.h>
    1.17  #include <io.h>
    1.18 @@ -62,13 +70,13 @@
    1.19  long random(void);
    1.20  
    1.21  // on Windoze, uuid_t needs pointer semantics
    1.22 -typedef UUID *uuid_t;
    1.23 +typedef UUID pEpUUID[1];
    1.24  #define _UUID_STRING_T
    1.25  typedef char uuid_string_t[37];
    1.26  
    1.27 -void uuid_generate_random(uuid_t out);
    1.28 -int uuid_parse(char *in, uuid_t uu);
    1.29 -void uuid_unparse_upper(uuid_t uu, uuid_string_t out);
    1.30 +void uuid_generate_random(pEpUUID out);
    1.31 +int uuid_parse(char *in, pEpUUID uu);
    1.32 +void uuid_unparse_upper(pEpUUID uu, uuid_string_t out);
    1.33  
    1.34  #ifndef inline
    1.35  #define inline __inline