summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Garcia Illera <agarciaillera@gmail.com>2022-10-23 17:50:54 +1100
committerAlberto Garcia Illera <agarciaillera@gmail.com>2022-10-23 17:50:54 +1100
commitb45477dfc47794a5897cc807f88ada7dd99305fc (patch)
treeca9f3c3c652c2214edfed4375223931260ea5772
parent63b85f2c36f8298275a972ab4384dc6addc9fa1a (diff)
downloadlibproxy-git-b45477dfc47794a5897cc807f88ada7dd99305fc.tar.gz
_WIN32 to WIN32 and remove already imported headers in windows
-rw-r--r--libproxy/modules/pacrunner_duktape.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/libproxy/modules/pacrunner_duktape.cpp b/libproxy/modules/pacrunner_duktape.cpp
index bfa43a3..a32d946 100644
--- a/libproxy/modules/pacrunner_duktape.cpp
+++ b/libproxy/modules/pacrunner_duktape.cpp
@@ -19,13 +19,10 @@
******************************************************************************/
#include "../extension_pacrunner.hpp"
-#ifdef _WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#pragma comment(lib, "Ws2_32.lib")
-#else
+#ifndef WIN32
#include <unistd.h> // gethostname
#endif
+
using namespace libproxy;
#include <duktape.h>
@@ -81,7 +78,7 @@ static duk_ret_t myIpAddress(duk_context *ctx) {
class duktape_pacrunner : public pacrunner {
public:
duktape_pacrunner(string pac, const url& pacurl) : pacrunner(pac, pacurl) {
-#ifdef _WIN32
+#ifdef WIN32
// On windows, we need to initialize the winsock dll first.
WSADATA WsaData;
WSAStartup(MAKEWORD(2, 0), &WsaData);
@@ -114,7 +111,7 @@ public:
~duktape_pacrunner() {
duk_destroy_heap(this->ctx);
-#ifdef _WIN32
+#ifdef WIN32
WSACleanup();
#endif
}