...
1 // This file is under GNU General Public License 3.0
6 // Windows platform specifica
8 #define _EXPORT_PEP_ENGINE_DLL
9 #pragma warning(disable : 4996)
11 // We need to make sure winsock2 is included before windows.h, or we will get redefinitions of symbols
12 // as windows.h includes winsock1.h, so we will have duplicate symbols if windows.h is included first.
13 // It seems some of our code includes sync.h before including winsock.h, leading to the failure.
14 // Including winsock2.h here fixes the problem for now...
29 #define ssize_t SSIZE_T
34 #define MIN(A, B) ((A)>(B) ? (B) : (A))
35 #define MAX(A, B) ((A)>(B) ? (A) : (B))
38 void *dlopen(const char *filename, int flag);
39 int dlclose(void *handle);
40 void *dlsym(void *handle, const char *symbol);
41 int mkstemp(char *templ);
43 time_t timegm(struct tm* tm);
46 #define strdup(A) _strdup((A))
49 #if _MSC_VER<1900 // Includes undefined case. This is a check for VS 2015, which throws an error.
50 #define snprintf(...) _snprintf(__VA_ARGS__)
54 #define strtok_r(A, B, C) strtok_s((A), (B), (C))
57 #define strncasecmp(A, B, C) _strnicmp((A), (B), (C))
60 #define strcasecmp(A, B) _stricmp((A), (B))
63 #define gmtime_r(A, B) gmtime_s((B), (A))
66 #define ftruncate(A, B) _chsize((A), (B))
69 #define ftello(A) ((off_t) _ftelli64(A))
72 char *strndup(const char *s1, size_t n);
73 char *stpcpy(char *dst, const char *src);
75 size_t strlcpy(char* dst, const char* src, size_t size);
76 size_t strlcat(char* dst, const char* src, size_t size);
78 const char *windoze_local_db(void);
79 const char *windoze_system_db(void);
80 const char *gpg_conf(void);
81 const char *gpg_agent_conf(void);
85 // on Windoze, uuid_t needs pointer semantics
86 typedef UUID pEpUUID[1];
87 #define _UUID_STRING_T
88 typedef char uuid_string_t[37];
90 void uuid_generate_random(pEpUUID out);
91 int uuid_parse(char *in, pEpUUID uu);
92 void uuid_unparse_upper(pEpUUID uu, uuid_string_t out);
95 #define inline __inline