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 */
27 #else /* _WIN32_WCE */
29 /* Windows CE-specific definitions */
30 #define NO_CGI /* WinCE has no pipes */
31 #define NO_GUI /* temporarily until it is fixed */
32 #pragma comment(lib,"ws2")
33 /* WinCE has both Unicode and ANSI versions of GetProcAddress */
35 #define GetProcAddress GetProcAddressA
36 #include "compat_wince.h"
38 #endif /* _WIN32_WCE */
40 #define ERRNO GetLastError()
42 #define SSL_LIB L"libssl32.dll"
44 #define IS_DIRSEP_CHAR(c) ((c) == '/' || (c) == '\\')
46 #define EWOULDBLOCK WSAEWOULDBLOCK
47 #define snprintf _snprintf
48 #define vsnprintf _vsnprintf
49 #define mkdir(x,y) _mkdir(x)
50 #define popen(x,y) _popen(x, y)
51 #define pclose(x) _pclose(x)
52 #define dlopen(x,y) LoadLibraryW(x)
53 #define dlsym(x,y) (void *) GetProcAddress(x,y)
60 #ifdef _MSC_VER /* MinGW already has these */
61 typedef unsigned int uint32_t;
62 typedef unsigned short uint16_t;
63 typedef __int64 uint64_t;
64 #define S_ISDIR(x) ((x) & _S_IFDIR)
68 * POSIX dirent interface
71 char d_name[FILENAME_MAX];
76 WIN32_FIND_DATAW info;
81 extern DIR *opendir(const char *name);
82 extern int closedir(DIR *dir);
83 extern struct dirent *readdir(DIR *dir);