2 * Copyright (c) 2004-2007 Sergey Lyubka <valenok@gmail.com>
5 * "THE BEER-WARE LICENSE" (Revision 42):
6 * Sergey Lyubka wrote this file. As long as you retain this notice you
7 * can do whatever you want with this stuff. If we meet some day, and you think
8 * this stuff is worth it, you can buy me a beer in return.
11 /* Tip from Justin Maximilian, suppress errors from winsock2.h */
23 #ifdef _MSC_VER /* pragmas not valid on MinGW */
24 #pragma comment(lib,"ws2_32")
25 #pragma comment(lib,"user32")
26 #pragma comment(lib,"comctl32")
27 #pragma comment(lib,"comdlg32")
28 #pragma comment(lib,"shell32")
30 #pragma comment(linker,"/subsystem:console")
32 #pragma comment(linker,"/subsystem:windows")
39 #else /* _WIN32_WCE */
41 /* Windows CE-specific definitions */
42 #define NO_CGI /* WinCE has no pipes */
43 #define NO_GUI /* temporarily until it is fixed */
44 #pragma comment(lib,"ws2")
45 /* WinCE has both Unicode and ANSI versions of GetProcAddress */
47 #define GetProcAddress GetProcAddressA
48 #include "compat_wince.h"
50 #endif /* _WIN32_WCE */
52 #define ERRNO GetLastError()
54 #define SSL_LIB L"libssl32.dll"
56 #define IS_DIRSEP_CHAR(c) ((c) == '/' || (c) == '\\')
58 #define EWOULDBLOCK WSAEWOULDBLOCK
59 #define snprintf _snprintf
60 #define vsnprintf _vsnprintf
61 #define mkdir(x,y) _mkdir(x)
62 #define popen(x,y) _popen(x, y)
63 #define pclose(x) _pclose(x)
64 #define dlopen(x,y) LoadLibraryW(x)
65 #define dlsym(x,y) (void *) GetProcAddress(x,y)
72 #ifdef _MSC_VER /* MinGW already has these */
73 typedef unsigned int uint32_t;
74 typedef unsigned short uint16_t;
75 typedef __int64 uint64_t;
76 #define S_ISDIR(x) ((x) & _S_IFDIR)
80 * POSIX dirent interface
83 char d_name[FILENAME_MAX];
88 WIN32_FIND_DATAW info;
93 extern DIR *opendir(const char *name);
94 extern int closedir(DIR *dir);
95 extern struct dirent *readdir(DIR *dir);