aboutsummaryrefslogtreecommitdiff
path: root/libf2c
diff options
context:
space:
mode:
authorLoren J. Rittle <ljrittle@acm.org>2002-01-15 17:27:05 +0000
committerLoren J. Rittle <ljrittle@gcc.gnu.org>2002-01-15 17:27:05 +0000
commit82598228f08d373948f195d474ccc6a7aa9b2aab (patch)
tree70b8d0097b66bac140aa33b35c78d03d426cabb2 /libf2c
parent751a1458e27cfb31650ed19368a1dc48ee0289a5 (diff)
downloadgcc-82598228f08d373948f195d474ccc6a7aa9b2aab.zip
gcc-82598228f08d373948f195d474ccc6a7aa9b2aab.tar.gz
gcc-82598228f08d373948f195d474ccc6a7aa9b2aab.tar.bz2
configure.in: Remove fcntl.h check; never define _POSIX_SOURCE, NO_FCNTL or OPEN_DECL.
* libI77/configure.in: Remove fcntl.h check; never define _POSIX_SOURCE, NO_FCNTL or OPEN_DECL. Add check for tmpnam(). * libI77/configure: Rebuilt. * libI77/config.h.in: Rebuilt. * libI77/Makefile.in: Remove all traces of rawio.h from dependencies lists. * libI77/fio.h (FSEEK): Unroll -j1.7 -j1.6 made 2002-01-04. * libI77/open.c (f_open): Use HAVE_TMPNAM. * libI77/rawio.h: Remove file. From-SVN: r48875
Diffstat (limited to 'libf2c')
-rw-r--r--libf2c/ChangeLog12
-rw-r--r--libf2c/libI77/Makefile.in6
-rw-r--r--libf2c/libI77/config.h.in12
-rwxr-xr-xlibf2c/libI77/configure164
-rw-r--r--libf2c/libI77/configure.in6
-rw-r--r--libf2c/libI77/fio.h6
-rw-r--r--libf2c/libI77/open.c2
-rw-r--r--libf2c/libI77/rawio.h45
8 files changed, 108 insertions, 145 deletions
diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog
index 2c9d0a3..f19d502 100644
--- a/libf2c/ChangeLog
+++ b/libf2c/ChangeLog
@@ -1,3 +1,15 @@
+2002-01-15 Loren J. Rittle <ljrittle@acm.org>
+
+ * libI77/configure.in: Remove fcntl.h check; never define
+ _POSIX_SOURCE, NO_FCNTL or OPEN_DECL. Add check for tmpnam().
+ * libI77/configure: Rebuilt.
+ * libI77/config.h.in: Rebuilt.
+ * libI77/Makefile.in: Remove all traces of rawio.h from
+ dependencies lists.
+ * libI77/fio.h (FSEEK): Unroll -j1.7 -j1.6 made 2002-01-04.
+ * libI77/open.c (f_open): Use HAVE_TMPNAM.
+ * libI77/rawio.h: Remove file.
+
2002-01-14 John David Anglin <dave@hiauly1.hia.nrc.ca>
* libI77/configure.in (_LARGEFILE_SOURCE): AC_DEFINE.
diff --git a/libf2c/libI77/Makefile.in b/libf2c/libI77/Makefile.in
index 16941a7..ff0d8e1 100644
--- a/libf2c/libI77/Makefile.in
+++ b/libf2c/libI77/Makefile.in
@@ -98,8 +98,8 @@ dfe.lo: fio.h config.h
dfe.lo: dfe.c fmt.h
dolio.lo: dolio.c config.h
due.lo: due.c fio.h config.h
-endfile.lo: endfile.c fio.h rawio.h config.h
-err.lo: err.c fio.h rawio.h config.h
+endfile.lo: endfile.c fio.h config.h
+err.lo: err.c fio.h config.h
fmt.lo: fio.h config.h
fmt.lo: fmt.c fmt.h
fmtlib.lo: fmtlib.c config.h
@@ -116,7 +116,7 @@ lread.lo: lread.c fp.h
lwrite.lo: fio.h
lwrite.lo: fmt.h
lwrite.lo: lwrite.c lio.h
-open.lo: open.c fio.h rawio.h config.h
+open.lo: open.c fio.h config.h
rdfmt.lo: fio.h config.h
rdfmt.lo: fmt.h
rdfmt.lo: rdfmt.c fp.h
diff --git a/libf2c/libI77/config.h.in b/libf2c/libI77/config.h.in
index 4cd0191..3ae78d1 100644
--- a/libf2c/libI77/config.h.in
+++ b/libf2c/libI77/config.h.in
@@ -6,9 +6,6 @@
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
-
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
@@ -30,6 +27,9 @@
/* Define if you have the tempnam function. */
#undef HAVE_TEMPNAM
+/* Define if you have the tmpnam function. */
+#undef HAVE_TMPNAM
+
/* Get Single Unix Specification semantics */
#undef _XOPEN_SOURCE
@@ -45,12 +45,6 @@
/* Define for HP-UX ftello and fseeko extension. */
#undef _LARGEFILE_SOURCE
-/* Define if fcntl.h is missing. */
-#undef NO_FCNTL
-
-/* Define if fcntl.h is missing. */
-#undef OPEN_DECL
-
/* Define if we do not have Unix Stdio. */
#undef NON_UNIX_STDIO
diff --git a/libf2c/libI77/configure b/libf2c/libI77/configure
index be2c8f4..e064fba 100755
--- a/libf2c/libI77/configure
+++ b/libf2c/libI77/configure
@@ -1105,64 +1105,19 @@ fi
echo "$ac_t""$g77_cv_sys_mingw32" 1>&6
-ac_safe=`echo "fcntl.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for fcntl.h""... $ac_c" 1>&6
-echo "configure:1111: checking for fcntl.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1116 "configure"
-#include "confdefs.h"
-#include <fcntl.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- test $g77_cv_header_posix = yes && cat >> confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-cat >> confdefs.h <<\EOF
-#define NO_FCNTL 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define OPEN_DECL 1
-EOF
-
-fi
-
-
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1155: checking for working const" >&5
+echo "configure:1110: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1160 "configure"
+#line 1115 "configure"
#include "confdefs.h"
int main() {
/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x = {0,0};
+typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
@@ -1205,7 +1160,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1226,12 +1181,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1230: checking for size_t" >&5
+echo "configure:1185: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1235 "configure"
+#line 1190 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1264,12 +1219,12 @@ fi
# Apparently positive result on cygwin loses re. NON_UNIX_STDIO
# (as of cygwin b18). Likewise on mingw.
echo $ac_n "checking for fstat""... $ac_c" 1>&6
-echo "configure:1268: checking for fstat" >&5
+echo "configure:1223: checking for fstat" >&5
if eval "test \"`echo '$''{'ac_cv_func_fstat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1273 "configure"
+#line 1228 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char fstat(); below. */
@@ -1292,7 +1247,7 @@ fstat();
; return 0; }
EOF
-if { (eval echo configure:1296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_fstat=yes"
else
@@ -1312,7 +1267,7 @@ else
fi
echo $ac_n "checking need for NON_UNIX_STDIO""... $ac_c" 1>&6
-echo "configure:1316: checking need for NON_UNIX_STDIO" >&5
+echo "configure:1271: checking need for NON_UNIX_STDIO" >&5
if test $g77_cv_sys_cygwin32 = yes \
|| test $g77_cv_sys_mingw32 = yes \
|| test $ac_cv_func_fstat = no; then
@@ -1328,12 +1283,12 @@ fi
for ac_func in fseeko
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1332: checking for $ac_func" >&5
+echo "configure:1287: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1337 "configure"
+#line 1292 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1356,7 +1311,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1383,12 +1338,12 @@ done
for ac_func in ftello
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1387: checking for $ac_func" >&5
+echo "configure:1342: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1392 "configure"
+#line 1347 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1411,7 +1366,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1438,12 +1393,12 @@ done
for ac_func in ftruncate
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1442: checking for $ac_func" >&5
+echo "configure:1397: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1447 "configure"
+#line 1402 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1466,7 +1421,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1493,12 +1448,12 @@ done
for ac_func in mkstemp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1497: checking for $ac_func" >&5
+echo "configure:1452: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1502 "configure"
+#line 1457 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1521,7 +1476,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1548,12 +1503,67 @@ done
for ac_func in tempnam
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1552: checking for $ac_func" >&5
+echo "configure:1507: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1512 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in tmpnam
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1562: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1557 "configure"
+#line 1567 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1576,7 +1586,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1606,19 +1616,19 @@ done
# However, on my sunos4/gcc setup unistd.h leads us wrongly to believe
# we're posix-conformant, so always do the test.
echo $ac_n "checking for ansi/posix sprintf result""... $ac_c" 1>&6
-echo "configure:1610: checking for ansi/posix sprintf result" >&5
+echo "configure:1620: checking for ansi/posix sprintf result" >&5
if test "$cross_compiling" = yes; then
g77_cv_sys_sprintf_ansi=no
else
cat > conftest.$ac_ext <<EOF
-#line 1615 "configure"
+#line 1625 "configure"
#include "confdefs.h"
#include <stdio.h>
/* does sprintf return the number of chars transferred? */
main () {char foo[2]; (sprintf(foo, "1") == 1) ? exit(0) : exit(1);}
EOF
-if { (eval echo configure:1622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
g77_cv_sys_sprintf_ansi=yes
else
@@ -1649,9 +1659,9 @@ fi
# define NON_ANSI_RW_MODES on unix (can't hurt)
echo $ac_n "checking NON_ANSI_RW_MODES""... $ac_c" 1>&6
-echo "configure:1653: checking NON_ANSI_RW_MODES" >&5
+echo "configure:1663: checking NON_ANSI_RW_MODES" >&5
cat > conftest.$ac_ext <<EOF
-#line 1655 "configure"
+#line 1665 "configure"
#include "confdefs.h"
#ifdef unix
yes
@@ -1696,12 +1706,12 @@ EOF
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1700: checking for off_t" >&5
+echo "configure:1710: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1705 "configure"
+#line 1715 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
diff --git a/libf2c/libI77/configure.in b/libf2c/libI77/configure.in
index 3998002..988a8e5 100644
--- a/libf2c/libI77/configure.in
+++ b/libf2c/libI77/configure.in
@@ -124,11 +124,6 @@ AC_CACHE_VAL(g77_cv_sys_mingw32,
AC_MSG_RESULT($g77_cv_sys_mingw32)
-AC_CHECK_HEADER(fcntl.h,
- test $g77_cv_header_posix = yes && AC_DEFINE(_POSIX_SOURCE),
- AC_DEFINE(NO_FCNTL, 1, [Define if fcntl.h is missing.])
- AC_DEFINE(OPEN_DECL, 1, [Define if fcntl.h is missing.]))
-
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
@@ -154,6 +149,7 @@ AC_CHECK_FUNCS(ftello)
AC_CHECK_FUNCS(ftruncate)
AC_CHECK_FUNCS(mkstemp)
AC_CHECK_FUNCS(tempnam)
+AC_CHECK_FUNCS(tmpnam)
# posix will guarantee the right behaviour for sprintf, else we can't be
# sure; HEADER_STDC wouldn't be the right check in sunos4, for instance.
diff --git a/libf2c/libI77/fio.h b/libf2c/libI77/fio.h
index 59526e7..8c6d274 100644
--- a/libf2c/libI77/fio.h
+++ b/libf2c/libI77/fio.h
@@ -18,11 +18,7 @@
/* Only use fseeko/ftello if they are both there. */
#if defined (HAVE_FSEEKO) && defined (HAVE_FTELLO)
-/* The cast helps in any case where the fseeko() prototype is somehow missing
- (perhaps because _POSIX_SOURCE is defined and the system headers try
- to keep a clean namespace in that case) even though the autoconf test
- found the non-standard function via its trivial link test. */
-#define FSEEK(a,b,c) fseeko(a, (off_t) b, c)
+#define FSEEK fseeko
#define FTELL ftello
#else
#define FSEEK fseek
diff --git a/libf2c/libI77/open.c b/libf2c/libI77/open.c
index 75c8971..9457ccc 100644
--- a/libf2c/libI77/open.c
+++ b/libf2c/libI77/open.c
@@ -231,7 +231,7 @@ integer f_open(olist *a)
(void) strcpy (buf, s);
free (s);
#else /* ! defined (HAVE_TEMPNAM) */
-#ifdef _POSIX_SOURCE
+#ifdef HAVE_TMPNAM
tmpnam(buf);
#else
(void) strcpy(buf,"tmp.FXXXXXX");
diff --git a/libf2c/libI77/rawio.h b/libf2c/libI77/rawio.h
deleted file mode 100644
index f3a59fd..0000000
--- a/libf2c/libI77/rawio.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef KR_headers
-#if defined (MSDOS) && !defined (GO32)
-#include "io.h"
-#ifndef WATCOM
-#define close _close
-#define creat _creat
-#define open _open
-#define read _read
-#define write _write
-#endif /*WATCOM*/
-#endif /*MSDOS*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if !(defined (MSDOS) && !defined (GO32))
-#ifdef OPEN_DECL
-extern int creat(const char*,int), open(const char*,int);
-#endif
-extern int close(int);
-#if !(defined(_WIN32) && !defined(__CYGWIN32__))
-extern int read(int,void*,size_t), write(int,void*,size_t);
-#endif
-extern int unlink(const char*);
-#ifndef _POSIX_SOURCE
-#ifndef NON_UNIX_STDIO
-extern FILE *fdopen(int, const char*);
-#endif
-#endif
-#endif /*KR_HEADERS*/
-
-extern char *mktemp(char*);
-
-#ifdef __cplusplus
- }
-#endif
-#endif
-
-#ifndef NO_FCNTL
-#include <fcntl.h>
-#endif
-
-#ifndef O_WRONLY
-#define O_RDONLY 0
-#define O_WRONLY 1
-#endif