]> git.proxmox.com Git - ceph.git/blame - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/libproxy/support-windows.patch
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / libproxy / support-windows.patch
CommitLineData
1e59de90
TL
1diff --git a/cmake/paths.cmk b/cmake/paths.cmk
2index 593ebc1..bbf8754 100644
3--- a/cmake/paths.cmk
4+++ b/cmake/paths.cmk
5@@ -1,4 +1,4 @@
6-if(WIN32 AND NOT MINGW)
7+if(0)
8 set(CMAKE_INSTALL_PREFIX "" CACHE PATH "Install prefix")
9 set(BIN_INSTALL_DIR . CACHE PATH "Binary install dir")
10 set(LIB_INSTALL_DIR . CACHE PATH "Library install dir")
11diff --git a/libproxy/cmake/devfiles.cmk b/libproxy/cmake/devfiles.cmk
12index 0301dce..0eb5f83 100644
13--- a/libproxy/cmake/devfiles.cmk
14+++ b/libproxy/cmake/devfiles.cmk
15@@ -1,4 +1,4 @@
16-if(NOT WIN32 OR MINGW)
17+if(1)
18 # PkgConfig file
19 set (PKGCONFIG_PREFIX ${CMAKE_INSTALL_PREFIX})
20
21diff --git a/libproxy/cmake/libproxy.cmk b/libproxy/cmake/libproxy.cmk
22index aab7593..465685f 100644
23--- a/libproxy/cmake/libproxy.cmk
24+++ b/libproxy/cmake/libproxy.cmk
25@@ -21,5 +21,5 @@ set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/proxy.cpp
26 set_target_properties(libproxy PROPERTIES PREFIX "" VERSION 1.0.0 SOVERSION 1)
27 set_target_properties(libproxy PROPERTIES INTERFACE_LINK_LIBRARIES "")
28 set_target_properties(libproxy PROPERTIES LINK_INTERFACE_LIBRARIES "")
29-install(TARGETS libproxy DESTINATION ${LIB_INSTALL_DIR})
30+install(TARGETS libproxy RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
31 install(FILES proxy.h DESTINATION ${INCLUDE_INSTALL_DIR})
32diff --git a/libproxy/modules/config_kde.cpp b/libproxy/modules/config_kde.cpp
33index b9bd241..73b978e 100644
34--- a/libproxy/modules/config_kde.cpp
35+++ b/libproxy/modules/config_kde.cpp
36@@ -19,7 +19,9 @@
37 ******************************************************************************/
38
39 #include <sys/stat.h>
40+#if !defined(WIN32)
41 #include <unistd.h>
42+#endif
43
44 #include <algorithm>
45 #include <cstdlib>
46@@ -137,7 +139,11 @@ private:
47 string command_output(const string &cmdline) throw (runtime_error) {
48 // Capture stderr as well
49 const string command = "(" + cmdline + ")2>&1";
50+#if !defined(WIN32)
51 FILE *pipe = popen(command.c_str(), "r");
52+#else
53+ FILE *pipe = _popen(command.c_str(), "r");
54+#endif
55 if (!pipe)
56 throw runtime_error("Unable to run command");
57
58@@ -148,7 +154,11 @@ private:
59 result += buffer; // TODO: If this throws bad_alloc, pipe is leaked
60 }
61
62+#if !defined(WIN32)
63 if(pclose(pipe) != 0)
64+#else
65+ if(_pclose(pipe) != 0)
66+#endif
67 throw runtime_error("Command failed");
68
69 // Trim newlines and whitespace at end
70diff --git a/libproxy/url.cpp b/libproxy/url.cpp
71index b61a9bc..021763e 100644
72--- a/libproxy/url.cpp
73+++ b/libproxy/url.cpp
74@@ -33,7 +33,9 @@
75 #include <cstdlib> // For atoi()
76 #include <sys/stat.h> // For stat()
77 #include <algorithm> // For transform()
78+#if !defined(WIN32)
79 #include <unistd.h> // For read() close()
80+#endif
81
82 #ifdef WIN32
83 #include <io.h>