From 0fe296019746689551d224a5f6fb7e0ebe1b91dc Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 17 Sep 2011 09:59:58 -0400 Subject: [PATCH] Fix Linux build when io.h is available Bug 40953 - fail compile git: make[2]: *** [hb_view-options.o] Error 1 --- configure.ac | 2 +- util/options.cc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index e1b6bf8d9..ac41742f0 100644 --- a/configure.ac +++ b/configure.ac @@ -52,7 +52,7 @@ AC_SUBST(HB_LIBTOOL_VERSION_INFO) GTK_DOC_CHECK([1.15],[--flavour no-tmpl]) # Functions and headers -AC_CHECK_FUNCS(mprotect sysconf getpagesize mmap) +AC_CHECK_FUNCS(mprotect sysconf getpagesize mmap _setmode) AC_CHECK_HEADERS(unistd.h sys/mman.h io.h) # Compiler flags diff --git a/util/options.cc b/util/options.cc index a923a980c..fe2feafb2 100644 --- a/util/options.cc +++ b/util/options.cc @@ -439,8 +439,8 @@ font_options_t::get_font (void) const /* read it */ GString *gs = g_string_new (NULL); char buf[BUFSIZ]; -#ifdef HAVE_IO_H - _setmode (fileno (stdin), O_BINARY); +#ifdef HAVE__SETMODE + _setmode (fileno (stdin), _O_BINARY); #endif while (!feof (stdin)) { size_t ret = fread (buf, 1, sizeof (buf), stdin); @@ -579,8 +579,8 @@ output_options_t::get_file_handle (void) if (output_file) fp = fopen (output_file, "wb"); else { -#ifdef HAVE_IO_H - _setmode (fileno (stdout), O_BINARY); +#ifdef HAVE__SETMODE + _setmode (fileno (stdout), _O_BINARY); #endif fp = stdout; }