Bug 591511 – hh-blob.c does not compile using mingw on windows
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 13 Aug 2009 09:25:23 +0000 (05:25 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 2 Nov 2009 19:40:42 +0000 (14:40 -0500)
Check for sys/mman.h, not mprotect().

src/hb-blob.c

index 178bc8e..2abd4ca 100644 (file)
 
 #include "hb-blob.h"
 
-#ifdef HAVE_MPROTECT
+#ifdef HAVE_SYS_MMAN_H
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif /* HAVE_UNISTD_H */
 #include <sys/mman.h>
-#endif /* HAVE_MPROTECT */
+#endif /* HAVE_SYS_MMAN_H */
 
 struct _hb_blob_t {
   hb_reference_count_t ref_count;
@@ -244,7 +244,7 @@ hb_blob_try_writeable_inplace (hb_blob_t *blob)
 
   hb_mutex_lock (blob->lock);
 
-#ifdef HAVE_MPROTECT
+#ifdef HAVE_SYS_MMAN_H
   if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITEABLE) {
     unsigned int pagesize, mask, length;
     const char *addr;
@@ -286,7 +286,7 @@ hb_blob_try_writeable_inplace (hb_blob_t *blob)
             addr, addr+length, length);
 #endif
   }
-#else /* !HAVE_MPROTECT */
+#else /* !HAVE_SYS_MMAN_H */
 #warning "No way to make readonly memory writeable.  This is suboptimal."
 #endif