Fix Linux build when io.h is available
Bug 40953 - fail compile git: make[2]: *** [hb_view-options.o] Error 1
This commit is contained in:
parent
d2b3ab9ece
commit
0fe2960197
|
@ -52,7 +52,7 @@ AC_SUBST(HB_LIBTOOL_VERSION_INFO)
|
||||||
GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
|
GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
|
||||||
|
|
||||||
# Functions and headers
|
# 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)
|
AC_CHECK_HEADERS(unistd.h sys/mman.h io.h)
|
||||||
|
|
||||||
# Compiler flags
|
# Compiler flags
|
||||||
|
|
|
@ -439,8 +439,8 @@ font_options_t::get_font (void) const
|
||||||
/* read it */
|
/* read it */
|
||||||
GString *gs = g_string_new (NULL);
|
GString *gs = g_string_new (NULL);
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
#ifdef HAVE_IO_H
|
#ifdef HAVE__SETMODE
|
||||||
_setmode (fileno (stdin), O_BINARY);
|
_setmode (fileno (stdin), _O_BINARY);
|
||||||
#endif
|
#endif
|
||||||
while (!feof (stdin)) {
|
while (!feof (stdin)) {
|
||||||
size_t ret = fread (buf, 1, sizeof (buf), stdin);
|
size_t ret = fread (buf, 1, sizeof (buf), stdin);
|
||||||
|
@ -579,8 +579,8 @@ output_options_t::get_file_handle (void)
|
||||||
if (output_file)
|
if (output_file)
|
||||||
fp = fopen (output_file, "wb");
|
fp = fopen (output_file, "wb");
|
||||||
else {
|
else {
|
||||||
#ifdef HAVE_IO_H
|
#ifdef HAVE__SETMODE
|
||||||
_setmode (fileno (stdout), O_BINARY);
|
_setmode (fileno (stdout), _O_BINARY);
|
||||||
#endif
|
#endif
|
||||||
fp = stdout;
|
fp = stdout;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue