diff options
author | Dominique Leuenberger <dimstar@opensuse.org> | 2020-09-10 14:26:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-10 14:26:46 +0200 |
commit | cd619d3e9d683237f6317f979d5c6a7290d7e429 (patch) | |
tree | 788d2102fbde91c254ab5185306aea63a63fd6d7 | |
parent | 7bb025d6950deded9dbbf6145f55fb909936cf9d (diff) | |
parent | e2784ac4dffb6db8027a7075fa1596f2fe3c0535 (diff) | |
download | libproxy-git-cd619d3e9d683237f6317f979d5c6a7290d7e429.tar.gz |
Merge pull request #131 from TechSmith/vs2019buildable
Enable building in Visual Studio 2019 without mingw.
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | libproxy/modules/config_kde.cpp | 8 | ||||
-rw-r--r-- | libproxy/url.cpp | 9 |
3 files changed, 15 insertions, 7 deletions
@@ -16,3 +16,8 @@ Temporary /libproxy/test/url-test /libproxy/test/url-encode /utils/proxy + +# ignore Visual Studio 2019 Files +/.vs +/out +CMakeSettings.json
\ No newline at end of file diff --git a/libproxy/modules/config_kde.cpp b/libproxy/modules/config_kde.cpp index f4bd158..b5954a9 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; diff --git a/libproxy/url.cpp b/libproxy/url.cpp index 672c989..cbbe6bb 100644 --- a/libproxy/url.cpp +++ b/libproxy/url.cpp @@ -20,12 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ******************************************************************************/ -#ifdef WIN32 -#include <io.h> -#define open _open -#define O_RDONLY _O_RDONLY -#define close _close -#endif + #include <fcntl.h> // For ::open() #include <cstring> // For memcpy() #include <sstream> // For int/string conversion (using stringstream) @@ -36,6 +31,8 @@ #ifdef WIN32 #include <io.h> +#define open _open +#define O_RDONLY _O_RDONLY #define close _close #define read _read #define SHUT_RDWR SD_BOTH |