From 38f89fbe99659e6d63937b37bd87a3edd8aba687 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Sun, 16 Aug 1998 16:25:26 +0000
Subject: [PATCH] [project @ 1998-08-16 16:25:21 by sof] Add feature test for
 O_BINARY

---
 acconfig.h     |  3 +++
 aclocal.m4     | 24 +++++++++++++++++++++++-
 mk/config.h.in |  3 +++
 3 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/acconfig.h b/acconfig.h
index 2f954a81019c..8e358385ec13 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -36,6 +36,9 @@
 /* Define if C compiler supports long long types */
 #undef HAVE_LONG_LONG
 
+/* Define if fcntl.h defines O_BINARY */
+#undef HAVE_O_BINARY
+
 /* Define if C Symbols have a leading underscore added by the compiler */
 #undef LEADING_UNDERSCORE
 
diff --git a/aclocal.m4 b/aclocal.m4
index 8ac66dff1c54..af28baab8b5e 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-dnl $Id: aclocal.m4,v 1.25 1998/08/14 15:24:10 simonm Exp $
+dnl $Id: aclocal.m4,v 1.26 1998/08/16 16:25:21 sof Exp $
 dnl 
 dnl Extra autoconf macros for the Glasgow fptools
 dnl
@@ -396,3 +396,25 @@ if test "$fptools_cv_have_long_long" = yes; then
 AC_DEFINE(HAVE_LONG_LONG)
 fi
 ])
+
+dnl *** Can we open files in binary mode? ***
+dnl 
+AC_DEFUN(FPTOOLS_O_BINARY,
+[
+AC_REQUIRE([AC_PROG_CC])
+AC_MSG_CHECKING(whether we can open files in binary mode)
+AC_CACHE_VAL(fptools_cv_have_o_binary,
+[
+AC_LANG_SAVE
+AC_LANG_C
+AC_TRY_COMPILE(,[#include <fcntl.h>
+x = O_BINARY;],
+fptools_cv_have_o_binary=yes,
+fptools_cv_have_o_binary=no)
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($fptools_cv_have_o_binary)
+if test "$fptools_cv_have_o_binary" = yes; then
+AC_DEFINE(HAVE_O_BINARY)
+fi
+])
diff --git a/mk/config.h.in b/mk/config.h.in
index 5a440e7bf726..f993d5461cef 100644
--- a/mk/config.h.in
+++ b/mk/config.h.in
@@ -84,6 +84,9 @@
 /* Define if C compiler supports long long types */
 #undef HAVE_LONG_LONG
 
+/* Define if fcntl.h defines O_BINARY */
+#undef HAVE_O_BINARY
+
 /* Define if C Symbols have a leading underscore added by the compiler */
 #undef LEADING_UNDERSCORE
 
-- 
GitLab