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>
This commit is contained in:
Ozkan Sezer 2019-08-07 12:51:28 +03:00 committed by H. Peter Anvin (Intel)
parent dea90380f4
commit be3e2f9d2d
2 changed files with 18 additions and 1 deletions

View file

@ -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 */

View file

@ -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)