summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-03-19 10:34:30 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-03-22 14:58:01 +0100
commit81c77a6b6464f5af66f851837f85ed6f9724f19e (patch)
tree1274fafb16396e27f06d9da24dc77bfb9714b0c9 /platform/x11
parent5521ff9f0c4a05c969c891a547a45094377cf780 (diff)
downloadmupdf-81c77a6b6464f5af66f851837f85ed6f9724f19e.tar.xz
Clean up windows ifdefs.
_WIN32 is always defined on windows (it means the WinAPI is available). _WIN64 is also defined on 64-bit targets. This means the test for defined(_WIN32) || defined(_WIN64) is redundant, since if _WIN64 is defined, then _WIN32 is always also defined. MSC_VER is only defined for MSVC, so split the ifdef sections in include/fitz/system.h into separate MSVC and WIN32 parts so that we can build with MinGW and other non-MSVC compilers on windows.
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/curl_stream.c10
-rw-r--r--platform/x11/pdfapp.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/platform/x11/curl_stream.c b/platform/x11/curl_stream.c
index 05a9b14a..4c265c01 100644
--- a/platform/x11/curl_stream.c
+++ b/platform/x11/curl_stream.c
@@ -21,7 +21,7 @@
#define BLOCK_SHIFT 20
#define BLOCK_SIZE (1<<BLOCK_SHIFT)
-#if defined(_WIN32) || defined(_WIN64)
+#ifdef _WIN32
#include <windows.h>
#else
#include "pthread.h"
@@ -53,7 +53,7 @@ struct curl_stream_state_s
unsigned char public_buffer[4096];
-#if defined(_WIN32) || defined(_WIN64)
+#ifdef _WIN32
void *thread;
DWORD thread_id;
HANDLE mutex;
@@ -65,7 +65,7 @@ struct curl_stream_state_s
static void fetcher_thread(curl_stream_state *state);
-#if defined(_WIN32) || defined(_WIN64)
+#ifdef _WIN32
static void
lock(curl_stream_state *state)
{
@@ -435,7 +435,7 @@ stream_close(fz_context *ctx, void *state_)
state->kill_thread = 1;
unlock(state);
-#if defined(_WIN32) || defined(_WIN64)
+#ifdef _WIN32
WaitForSingleObject(state->thread, INFINITE);
CloseHandle(state->thread);
CloseHandle(state->mutex);
@@ -528,7 +528,7 @@ fz_stream *fz_stream_from_curl(fz_context *ctx, char *filename, void (*more_data
curl_easy_setopt(handle, CURLOPT_HEADERFUNCTION, header_arrived);
-#if defined(_WIN32) || defined(_WIN64)
+#ifdef _WIN32
state->mutex = CreateMutex(NULL, FALSE, NULL);
if (state->mutex == NULL)
fz_throw(ctx, FZ_ERROR_GENERIC, "mutex creation failed");
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c
index d5f70a29..f011b5b0 100644
--- a/platform/x11/pdfapp.c
+++ b/platform/x11/pdfapp.c
@@ -131,7 +131,7 @@ void pdfapp_init(fz_context *ctx, pdfapp_t *app)
app->transition.duration = 0.25f;
app->transition.type = FZ_TRANSITION_FADE;
-#if defined(_WIN32) || defined(_WIN64)
+#ifdef _WIN32
app->colorspace = fz_device_bgr(ctx);
#else
app->colorspace = fz_device_rgb(ctx);
@@ -1951,7 +1951,7 @@ void pdfapp_oncopy(pdfapp_t *app, unsigned short *ucsbuf, int ucslen)
saw_text = 1;
if (need_newline)
{
-#if defined(_WIN32) || defined(_WIN64)
+#ifdef _WIN32
if (p < ucslen - 1)
ucsbuf[p++] = '\r';
#endif