summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
Diffstat (limited to 'pango')
-rw-r--r--pango/opentype/hb-blob.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pango/opentype/hb-blob.c b/pango/opentype/hb-blob.c
index 69390495..178bc8e1 100644
--- a/pango/opentype/hb-blob.c
+++ b/pango/opentype/hb-blob.c
@@ -28,8 +28,12 @@
#include "hb-blob.h"
+#ifdef HAVE_MPROTECT
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/mman.h>
+#endif /* HAVE_MPROTECT */
struct _hb_blob_t {
hb_reference_count_t ref_count;
@@ -240,6 +244,7 @@ hb_blob_try_writeable_inplace (hb_blob_t *blob)
hb_mutex_lock (blob->lock);
+#ifdef HAVE_MPROTECT
if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITEABLE) {
unsigned int pagesize, mask, length;
const char *addr;
@@ -281,6 +286,9 @@ hb_blob_try_writeable_inplace (hb_blob_t *blob)
addr, addr+length, length);
#endif
}
+#else /* !HAVE_MPROTECT */
+#warning "No way to make readonly memory writeable. This is suboptimal."
+#endif
done:
mode = blob->mode;