Don't define hb_blob_create_from_file if HB_NO_OPEN is defined

This commit is contained in:
Ebrahim Byagowi 2019-06-21 22:39:42 +04:30 committed by GitHub
parent 7f3b409e85
commit 12cec6c12e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -487,6 +487,7 @@ hb_blob_t::try_make_writable ()
* Mmap * Mmap
*/ */
#ifndef HB_NO_OPEN
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
# include <sys/types.h> # include <sys/types.h>
# include <sys/stat.h> # include <sys/stat.h>
@ -543,10 +544,6 @@ _hb_mapped_file_destroy (void *file_)
hb_blob_t * hb_blob_t *
hb_blob_create_from_file (const char *file_name) hb_blob_create_from_file (const char *file_name)
{ {
#ifdef HB_NO_OPEN
return hb_blob_get_empty ();
#endif
/* Adopted from glib's gmappedfile.c with Matthias Clasen and /* Adopted from glib's gmappedfile.c with Matthias Clasen and
Allison Lortie permission but changed a lot to suit our need. */ Allison Lortie permission but changed a lot to suit our need. */
#if defined(HAVE_MMAP) && !defined(HB_NO_MMAP) #if defined(HAVE_MMAP) && !defined(HB_NO_MMAP)
@ -680,3 +677,4 @@ fread_fail_without_close:
free (data); free (data);
return hb_blob_get_empty (); return hb_blob_get_empty ();
} }
#endif /* !HB_NO_OPEN */