aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOzkan Sezer <sezero@users.sourceforge.net>2019-08-07 12:51:28 +0300
committerH. Peter Anvin (Intel) <hpa@zytor.com>2019-08-07 17:53:38 -0700
commitbe3e2f9d2d9c88b3a50c19636b924ac58e68c516 (patch)
tree61044cf7a5da92a24ac43c1131ecb467fb68b9d8
parentdea90380f42ae3318e54fc9afd59c6dbc90aa55e (diff)
downloadnasm-be3e2f9d2d9c88b3a50c19636b924ac58e68c516.tar.gz
nasm-be3e2f9d2d9c88b3a50c19636b924ac58e68c516.tar.xz
nasm-be3e2f9d2d9c88b3a50c19636b924ac58e68c516.zip
update watcom config file.
also a tiny change to nasm_file_exists() so that it builds with c89 compilers. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-rw-r--r--config/watcom.h15
-rw-r--r--nasmlib/file.c4
2 files changed, 18 insertions, 1 deletions
diff --git a/config/watcom.h b/config/watcom.h
index 029a36f8..1ef2ee74 100644
--- a/config/watcom.h
+++ b/config/watcom.h
@@ -49,6 +49,9 @@
#define HAVE_DECL_STRNCASECMP 1
#define HAVE_DECL_STRNICMP 1
#define HAVE_INTTYPES_H 1
+#ifndef __LINUX__
+#define HAVE_IO_H 1
+#endif
#define HAVE_LIMITS_H 1
#define HAVE_MEMORY_H 1
#define HAVE_SNPRINTF 1
@@ -71,4 +74,16 @@
#define STDC_HEADERS 1
#define inline __inline
+#define HAVE_ACCESS
+#define HAVE_STRUCT_STAT
+#define HAVE_STAT
+#define HAVE_FSTAT
+#define HAVE_FILENO
+#ifdef __LINUX__
+#define HAVE_FTRUNCATE
+#else
+#define HAVE_CHSIZE
+#define HAVE__CHSIZE
+#endif
+
#endif /* NASM_CONFIG_WATCOM_H */
diff --git a/nasmlib/file.c b/nasmlib/file.c
index 2e662a19..e2e6c553 100644
--- a/nasmlib/file.c
+++ b/nasmlib/file.c
@@ -224,6 +224,9 @@ static const os_fopenflag fopenflags_rb[3] = { 'r', 'b', 0 };
*/
bool nasm_file_exists(const char *filename)
{
+#ifndef os_access
+ FILE *f;
+#endif
os_filename osfname;
bool exists;
@@ -234,7 +237,6 @@ bool nasm_file_exists(const char *filename)
#ifdef os_access
exists = os_access(osfname, R_OK) == 0;
#else
- FILE *f;
f = os_fopen(osfname, fopenflags_rb);
exists = f != NULL;
if (f)