aboutsummaryrefslogtreecommitdiff
path: root/ports/mosquitto/0001-win64-cmake.patch
blob: 70888b63723980b3f63bce17d42c7cc18a5eef2c (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
--- a/config.h
+++ b/config.h
@@ -16,7 +16,7 @@
 #  define EPROTO ECONNABORTED
 #endif

-#ifdef WIN32
+#ifdef WIN32 || WIN64
 #  ifndef strcasecmp
 #    define strcasecmp strcmpi
 #  endif
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -4,8 +4,8 @@
 if (${WITH_THREADING} STREQUAL ON)
        add_definitions("-DWITH_THREADING")
        if (WIN32)
-               set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib)
-               set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
+               set (PTHREAD_LIBRARIES ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/pthreadsVC2.lib)
+               set (PTHREAD_INCLUDE_DIR ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include)
        else (WIN32)
                find_library(LIBPTHREAD pthread)
                if (LIBPTHREAD)
--- a/lib/net_mosq.h
+++ b/lib/net_mosq.h
@@ -20,7 +20,12 @@
 #include <unistd.h>
 #else
 #include <winsock2.h>
+#if defined(_MSC_VER) && _MSC_VER > 1900
+#undef ssize_t
 typedef int ssize_t;
+#else
+typedef int ssize_t;
+#endif
 #endif

 #include <mosquitto_internal.h>