aboutsummaryrefslogtreecommitdiff
path: root/ports/mosquitto/win64-cmake.patch
blob: 9105c403f4b9c1d4c60193071e61fca099f5cf6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e58d072..e582a25 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,12 +54,7 @@ option(WITH_THREADING "Include client library threading support?" ON)
 if (WITH_THREADING)
 	add_definitions("-DWITH_THREADING")
 	if (WIN32)
-		if (CMAKE_CL_64)
-			set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x64\\pthreadVC2.lib)
-		else (CMAKE_CL_64)
-			set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib)
-		endif (CMAKE_CL_64)
-		set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
+		find_package(pthread REQUIRED)
 	else (WIN32)
 		find_library(LIBPTHREAD pthread)
 		if (LIBPTHREAD)
diff --git a/config.h b/config.h
index b7a7616..bceb92a 100644
--- a/config.h
+++ b/config.h
@@ -27,7 +27,7 @@
 #  define EPROTO ECONNABORTED
 #endif
 
-#ifdef WIN32
+#if defined(WIN32) || defined(WIN64)
 #  ifndef strcasecmp
 #    define strcasecmp strcmpi
 #  endif
diff --git a/lib/net_mosq.h b/lib/net_mosq.h
index b843ebe..8c077eb 100644
--- a/lib/net_mosq.h
+++ b/lib/net_mosq.h
@@ -20,6 +20,9 @@ Contributors:
 #include <unistd.h>
 #else
 #include <winsock2.h>
+#if defined(_MSC_VER) && _MSC_VER > 1900
+#undef ssize_t
+#endif
 typedef SSIZE_T ssize_t;
 #endif