summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-11-23 11:22:54 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-11-23 11:22:54 +0100
commitc7b3ab9553dea50ae7151d9847c1b62a0213f275 (patch)
treef1c10468823d27232d85cb6bfb858824e3597718
parentdeb5839a5b0d11c4a079a7939fe88aa07101aecc (diff)
downloadmupdf-c7b3ab9553dea50ae7151d9847c1b62a0213f275.tar.xz
Fix mu-threads build on linux.
-rw-r--r--Makefile7
-rw-r--r--source/helpers/mu-threads/mu-threads.c6
2 files changed, 8 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 4798c748..7b7eccda 100644
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,8 @@ ALL_DIR += $(OUT)/cbz
ALL_DIR += $(OUT)/html
ALL_DIR += $(OUT)/gprf
ALL_DIR += $(OUT)/tools
-ALL_DIR += $(OUT)/helper
+ALL_DIR += $(OUT)/helpers
+ALL_DIR += $(OUT)/helpers/mu-threads
ALL_DIR += $(OUT)/platform/x11
ALL_DIR += $(OUT)/platform/x11/curl
ALL_DIR += $(OUT)/platform/gl
@@ -83,7 +84,7 @@ FITZ_HDR := include/mupdf/fitz.h $(wildcard include/mupdf/fitz/*.h)
PDF_HDR := include/mupdf/pdf.h $(wildcard include/mupdf/pdf/*.h)
SVG_HDR := include/mupdf/svg.h
HTML_HDR := include/mupdf/html.h
-THREAD_HDR := include/mupdf/helper/mu-threads.h
+THREAD_HDR := include/mupdf/helpers/mu-threads.h
FITZ_SRC := $(wildcard source/fitz/*.c)
PDF_SRC := $(wildcard source/pdf/*.c)
@@ -92,7 +93,7 @@ SVG_SRC := $(wildcard source/svg/*.c)
CBZ_SRC := $(wildcard source/cbz/*.c)
HTML_SRC := $(wildcard source/html/*.c)
GPRF_SRC := $(wildcard source/gprf/*.c)
-THREAD_SRC := source/helper/mu-threads.c
+THREAD_SRC := $(wildcard source/helpers/mu-threads/*.c)
FITZ_SRC_HDR := $(wildcard source/fitz/*.h)
PDF_SRC_HDR := $(wildcard source/pdf/*.h) source/pdf/pdf-name-table.h
diff --git a/source/helpers/mu-threads/mu-threads.c b/source/helpers/mu-threads/mu-threads.c
index bbc87d1a..847c3368 100644
--- a/source/helpers/mu-threads/mu-threads.c
+++ b/source/helpers/mu-threads/mu-threads.c
@@ -245,7 +245,7 @@ int mu_create_thread(mu_thread *th, mu_thread_fn *fn, void *arg)
void mu_destroy_thread(mu_thread *th)
{
- const static mu_thread empty = { 0 };
+ const static mu_thread empty; /* static objects are always initialized to zero */
if (memcmp(th, &empty, sizeof(empty)) == 0)
return;
@@ -261,9 +261,11 @@ int mu_create_mutex(mu_mutex *mutex)
void mu_destroy_mutex(mu_mutex *mutex)
{
- const static mu_mutex empty = { 0 };
+ const static mu_mutex empty; /* static objects are always initialized to zero */
+
if (memcmp(mutex, &empty, sizeof(empty)) == 0)
return;
+
(void)pthread_mutex_destroy(&mutex->mutex);
*mutex = empty;
}