summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Porter <r.porter@techsmith.com>2020-09-03 10:32:55 -0400
committerRoss Porter <r.porter@techsmith.com>2020-09-03 10:33:12 -0400
commitc37a4f92f654a7c357423babb4944e148ea407c7 (patch)
tree223e37c3ddd2971c46b6259761cb025900c246fb
parentd6990f4aaab4b947a490ab1abfd9ac6e62d66d7a (diff)
downloadlibproxy-git-c37a4f92f654a7c357423babb4944e148ea407c7.tar.gz
Use windows pipe open and close on win32
Following the pattern found here: https://github.com/libproxy/libproxy/blob/d6990f4aaab4b947a490ab1abfd9ac6e62d66d7a/libproxy/url.cpp#L23, This commit uses the _popen and _pclose functions from windows `stdio.h` (included in the existing code via `<cstdio>` on windows builds). - https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/popen-wpopen?view=vs-2019 - https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/pclose?view=vs-2019
-rw-r--r--libproxy/modules/config_kde.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libproxy/modules/config_kde.cpp b/libproxy/modules/config_kde.cpp
index e16078b..7eb8be7 100644
--- a/libproxy/modules/config_kde.cpp
+++ b/libproxy/modules/config_kde.cpp
@@ -19,13 +19,19 @@
******************************************************************************/
#include <sys/stat.h>
-#include <unistd.h>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <sstream>
+#ifdef WIN32
+#define popen _popen
+#define pclose _pclose
+#else
+#include <unistd.h>
+#endif
+
#include "../extension_config.hpp"
using namespace libproxy;