提交 bc76449f 编写于 作者: B Behdad Esfahbod

Use setmode() instead of _setmode()

Looks like Cygwin / MSVC declare it that way, and it still works on
MinGW32 cross.
上级 e9171af5
...@@ -81,6 +81,9 @@ ...@@ -81,6 +81,9 @@
/* Have sched_yield */ /* Have sched_yield */
#undef HAVE_SCHED_YIELD #undef HAVE_SCHED_YIELD
/* Define to 1 if you have the `setmode' function. */
#undef HAVE_SETMODE
/* Have Solaris __machine_*_barrier and atomic_* operations */ /* Have Solaris __machine_*_barrier and atomic_* operations */
#undef HAVE_SOLARIS_ATOMIC_OPS #undef HAVE_SOLARIS_ATOMIC_OPS
...@@ -117,9 +120,6 @@ ...@@ -117,9 +120,6 @@
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
/* Define to 1 if you have the `_setmode' function. */
#undef HAVE__SETMODE
/* Define to the sub-directory in which libtool stores uninstalled libraries. /* Define to the sub-directory in which libtool stores uninstalled libraries.
*/ */
#undef LT_OBJDIR #undef LT_OBJDIR
......
...@@ -55,7 +55,7 @@ dnl GOBJECT_INTROSPECTION_CHECK([0.9.0]) ...@@ -55,7 +55,7 @@ dnl GOBJECT_INTROSPECTION_CHECK([0.9.0])
dnl GTK_DOC_CHECK([1.15],[--flavour no-tmpl]) dnl GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
# Functions and headers # Functions and headers
AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap _setmode isatty) AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap setmode isatty)
AC_CHECK_HEADERS(unistd.h sys/mman.h io.h) AC_CHECK_HEADERS(unistd.h sys/mman.h io.h)
# Compiler flags # Compiler flags
......
...@@ -414,7 +414,7 @@ font_options_t::get_font (void) const ...@@ -414,7 +414,7 @@ font_options_t::get_font (void) const
GString *gs = g_string_new (NULL); GString *gs = g_string_new (NULL);
char buf[BUFSIZ]; char buf[BUFSIZ];
#ifdef HAVE__SETMODE #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);
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include <unistd.h> /* for isatty() */ #include <unistd.h> /* for isatty() */
#endif #endif
#ifdef HAVE_IO_H #ifdef HAVE_IO_H
#include <io.h> /* for _setmode() under Windows */ #include <io.h> /* for setmode() under Windows */
#endif #endif
#include <hb.h> #include <hb.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册