File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ option(WITH_MBEDTLS "with mbedtls library" OFF)
29
29
30
30
option (WITH_KCP "compile event/kcp" OFF )
31
31
32
- if (WIN32 )
32
+ if (WIN32 OR MINGW )
33
33
option (WITH_WEPOLL "compile event/wepoll -> use iocp" ON )
34
34
option (ENABLE_WINDUMP "Windows MiniDumpWriteDump" OFF )
35
35
option (BUILD_FOR_MT "build for /MT" OFF )
@@ -126,7 +126,7 @@ endif()
126
126
if (WITH_CURL )
127
127
add_definitions (-DWITH_CURL )
128
128
set (LIBS ${LIBS} curl )
129
- if (WIN32 )
129
+ if (WIN32 OR MINGW )
130
130
set (LIBS ${LIBS} wldap32 advapi32 crypt32 )
131
131
endif ()
132
132
endif ()
@@ -156,7 +156,7 @@ if(WITH_MBEDTLS)
156
156
set (LIBS ${LIBS} mbedtls mbedx509 mbedcrypto )
157
157
endif ()
158
158
159
- if (WIN32 )
159
+ if (WIN32 OR MINGW )
160
160
add_definitions (-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_WIN32_WINNT=0x0600 )
161
161
set (LIBS ${LIBS} secur32 crypt32 winmm iphlpapi ws2_32 )
162
162
if (ENABLE_WINDUMP )
@@ -167,7 +167,7 @@ endif()
167
167
168
168
if (ANDROID )
169
169
set (LIBS ${LIBS} log )
170
- elseif (UNIX )
170
+ elseif (UNIX AND NOT MINGW )
171
171
set (LIBS ${LIBS} pthread m dl )
172
172
if (CMAKE_COMPILER_IS_GNUCC )
173
173
set (LIBS ${LIBS} rt )
@@ -181,7 +181,7 @@ endif()
181
181
# see Makefile
182
182
set (ALL_SRCDIRS . base ssl event event/kcp util cpputil evpp protocol http http/client http/server mqtt )
183
183
set (CORE_SRCDIRS . base ssl event )
184
- if (WIN32 )
184
+ if (WIN32 OR MINGW )
185
185
if (WITH_WEPOLL )
186
186
set (CORE_SRCDIRS ${CORE_SRCDIRS} event/wepoll )
187
187
endif ()
Original file line number Diff line number Diff line change 8
8
#include " httpdef.h" // import http_content_type_str_by_suffix
9
9
#include " http_page.h" // import make_index_of_page
10
10
11
- #ifdef OS_WIN
11
+ #ifdef _MSC_VER
12
12
#include < codecvt>
13
13
#endif
14
14
@@ -20,7 +20,7 @@ FileCache::FileCache() {
20
20
}
21
21
22
22
static int hv_open (char const * filepath, int flags) {
23
- #ifdef OS_WIN
23
+ #ifdef _MSC_VER
24
24
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t >> conv;
25
25
auto wfilepath = conv.from_bytes (filepath);
26
26
int fd = _wopen (wfilepath.c_str (), flags);
You can’t perform that action at this time.
0 commit comments