summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assemble.c2
-rw-r--r--compiler.h18
-rw-r--r--configure.in7
-rw-r--r--crc64.c1
-rw-r--r--disasm.c2
-rw-r--r--eval.c2
-rw-r--r--float.c2
-rw-r--r--hashtbl.c2
-rw-r--r--labels.c2
-rw-r--r--lib/snprintf.c2
-rw-r--r--lib/vsnprintf.c2
-rw-r--r--listing.c2
-rw-r--r--macros.pl2
-rw-r--r--nasm.c2
-rw-r--r--nasm.h3
-rw-r--r--nasmlib.c8
-rw-r--r--nasmlib.h25
-rw-r--r--ndisasm.c2
-rw-r--r--outform.c2
-rw-r--r--output/outaout.c2
-rw-r--r--output/outas86.c2
-rw-r--r--output/outbin.c2
-rw-r--r--output/outcoff.c2
-rw-r--r--output/outdbg.c2
-rw-r--r--output/outelf32.c2
-rw-r--r--output/outelf64.c2
-rw-r--r--output/outieee.c2
-rw-r--r--output/outmacho.c2
-rw-r--r--output/outobj.c2
-rw-r--r--output/outrdf.c2
-rw-r--r--output/outrdf2.c2
-rw-r--r--parser.c2
-rwxr-xr-xpptok.pl1
-rw-r--r--preproc.c2
-rw-r--r--rdoff/collectn.c3
-rw-r--r--rdoff/hash.c2
-rw-r--r--rdoff/ldrdf.c2
-rw-r--r--rdoff/rdf2bin.c2
-rw-r--r--rdoff/rdf2ihx.c2
-rw-r--r--rdoff/rdfdump.c2
-rw-r--r--rdoff/rdflib.c2
-rw-r--r--rdoff/rdfload.c2
-rw-r--r--rdoff/rdlar.c2
-rw-r--r--rdoff/rdlib.c2
-rw-r--r--rdoff/rdoff.c2
-rw-r--r--rdoff/rdx.c2
-rw-r--r--rdoff/segtab.c2
-rw-r--r--rdoff/symtab.c3
-rwxr-xr-xregs.pl5
-rw-r--r--stdscan.c2
-rw-r--r--sync.c2
-rwxr-xr-xtokhash.pl1
52 files changed, 133 insertions, 24 deletions
diff --git a/assemble.c b/assemble.c
index 6adaec6..c3a9049 100644
--- a/assemble.c
+++ b/assemble.c
@@ -82,6 +82,8 @@
* used for conditional jump over longer jump
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
diff --git a/compiler.h b/compiler.h
index 798466f..0f7261c 100644
--- a/compiler.h
+++ b/compiler.h
@@ -13,15 +13,25 @@
*
* Compiler-specific macros for NASM. Feel free to add support for
* other compilers in here.
+ *
+ * This header file should be included before any other header.
*/
-#ifndef COMPILER_H
-#define COMPILER_H 1
+#ifndef NASM_COMPILER_H
+#define NASM_COMPILER_H 1
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+/* Request as many features as we can */
+#define _GNU_SOURCE
+#define _ISO99_SOURCE
+#define _POSIX_SOURCE
+#define _POSIX_C_SOURCE 200112L
+#define _XOPEN_SOURCE 600
+#define _XOPEN_SOURCE_EXTENDED
+
#ifdef __GNUC__
# if __GNUC__ >= 4
# define HAVE_GNUC_4
@@ -38,9 +48,9 @@
#endif
/* Some versions of MSVC have these only with underscores in front */
-#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>
+#include <stdio.h>
#ifndef HAVE_SNPRINTF
# ifdef HAVE__SNPRINTF
@@ -58,4 +68,4 @@ int vsnprintf(char *, size_t, const char *, va_list);
# endif
#endif
-#endif /* COMPILER_H */
+#endif /* NASM_COMPILER_H */
diff --git a/configure.in b/configure.in
index b97f536..009720a 100644
--- a/configure.in
+++ b/configure.in
@@ -82,6 +82,9 @@ fi
dnl Check for <inttypes.h> or add a substitute version
AC_CHECK_HEADERS(inttypes.h, , CFLAGS="$CFLAGS -I\$(top_srcdir)/inttypes")
+dnl The standard header for str*casecmp is <strings.h>
+AC_CHECK_HEADERS(strings.h)
+
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
@@ -107,6 +110,10 @@ if $missing; then
XOBJS="$XOBJS lib/snprintf.o"
fi
+AC_CHECK_FUNCS(strcasecmp stricmp)
+AC_CHECK_FUNCS(strncasecmp strnicmp)
+AC_CHECK_FUNCS(strsep)
+
AC_CHECK_FUNCS(getuid)
AC_CHECK_FUNCS(getgid)
diff --git a/crc64.c b/crc64.c
index da41e7d..fc165b7 100644
--- a/crc64.c
+++ b/crc64.c
@@ -1,3 +1,4 @@
+#include "compiler.h"
#include <inttypes.h>
#include <ctype.h>
diff --git a/disasm.c b/disasm.c
index 724d0bf..dc75470 100644
--- a/disasm.c
+++ b/disasm.c
@@ -8,6 +8,8 @@
* initial version 27/iii/95 by Simon Tatham
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <string.h>
#include <limits.h>
diff --git a/eval.c b/eval.c
index a75c5ba..aa564e2 100644
--- a/eval.c
+++ b/eval.c
@@ -8,6 +8,8 @@
* initial version 27/iii/95 by Simon Tatham
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
diff --git a/float.c b/float.c
index 357bcb7..64a77b8 100644
--- a/float.c
+++ b/float.c
@@ -8,6 +8,8 @@
* initial version 13/ix/96 by Simon Tatham
*/
+#include "compiler.h"
+
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/hashtbl.c b/hashtbl.c
index cbe2a1b..5dd743d 100644
--- a/hashtbl.c
+++ b/hashtbl.c
@@ -4,6 +4,8 @@
* Efficient dictionary hash table class.
*/
+#include "compiler.h"
+
#include <inttypes.h>
#include <string.h>
#include "nasm.h"
diff --git a/labels.c b/labels.c
index 5a1fd13..2d2630d 100644
--- a/labels.c
+++ b/labels.c
@@ -6,6 +6,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/lib/snprintf.c b/lib/snprintf.c
index f56a492..de4d96d 100644
--- a/lib/snprintf.c
+++ b/lib/snprintf.c
@@ -4,6 +4,8 @@
* Implement snprintf() in terms of vsnprintf()
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
diff --git a/lib/vsnprintf.c b/lib/vsnprintf.c
index 2c9399a..976b0ea 100644
--- a/lib/vsnprintf.c
+++ b/lib/vsnprintf.c
@@ -5,6 +5,8 @@
* that don't have them...
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
diff --git a/listing.c b/listing.c
index 1d432e5..226a026 100644
--- a/listing.c
+++ b/listing.c
@@ -8,6 +8,8 @@
* initial version 2/vii/97 by Simon Tatham
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
diff --git a/macros.pl b/macros.pl
index 0934d17..596277d 100644
--- a/macros.pl
+++ b/macros.pl
@@ -19,7 +19,7 @@ undef $tasm_count;
open(OUTPUT,">macros.c") or die "unable to open macros.c\n";
print OUTPUT "/* This file auto-generated from standard.mac by macros.pl" .
-" - don't edit it */\n\n#include <stddef.h>\n\nstatic const char *stdmac[] = {\n";
+" - don't edit it */\n\n#include \"compiler.h\"\n\nstatic const char *stdmac[] = {\n";
foreach $fname ( @ARGV ) {
open(INPUT,$fname) or die "unable to open $fname\n";
diff --git a/nasm.c b/nasm.c
index 7a4ac55..b28f4f7 100644
--- a/nasm.c
+++ b/nasm.c
@@ -6,6 +6,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
diff --git a/nasm.h b/nasm.h
index a120ccd..3c49130 100644
--- a/nasm.h
+++ b/nasm.h
@@ -11,10 +11,11 @@
#ifndef NASM_NASM_H
#define NASM_NASM_H
+#include "compiler.h"
+
#include <stdio.h>
#include <inttypes.h>
#include "version.h" /* generated NASM version macros */
-#include "compiler.h"
#include "nasmlib.h"
#include "insnsi.h" /* For enum opcode */
diff --git a/nasmlib.c b/nasmlib.c
index 6f0e6af..d045a2a 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -6,6 +6,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -144,7 +146,7 @@ char *nasm_strndup(char *s, size_t len)
return p;
}
-#if !defined(stricmp) && !defined(strcasecmp)
+#ifndef nasm_stricmp
int nasm_stricmp(const char *s1, const char *s2)
{
while (*s1 && tolower(*s1) == tolower(*s2))
@@ -158,7 +160,7 @@ int nasm_stricmp(const char *s1, const char *s2)
}
#endif
-#if !defined(strnicmp) && !defined(strncasecmp)
+#ifndef nasm_strnicmp
int nasm_strnicmp(const char *s1, const char *s2, int n)
{
while (n > 0 && *s1 && tolower(*s1) == tolower(*s2))
@@ -172,7 +174,7 @@ int nasm_strnicmp(const char *s1, const char *s2, int n)
}
#endif
-#if !defined(strsep)
+#ifndef nasm_strsep
char *nasm_strsep(char **stringp, const char *delim)
{
char *s = *stringp;
diff --git a/nasmlib.h b/nasmlib.h
index a2544fc..64afa45 100644
--- a/nasmlib.h
+++ b/nasmlib.h
@@ -9,9 +9,14 @@
#ifndef NASM_NASMLIB_H
#define NASM_NASMLIB_H
+#include "compiler.h"
+
#include <inttypes.h>
#include <stdio.h>
-#include "compiler.h"
+#include <string.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
/*
* If this is defined, the wrappers around malloc et al will
@@ -98,27 +103,23 @@ char *nasm_strndup_log(char *, int, char *, size_t);
* ANSI doesn't guarantee the presence of `stricmp' or
* `strcasecmp'.
*/
-#if defined(stricmp) || defined(strcasecmp)
-#if defined(stricmp)
-#define nasm_stricmp stricmp
-#else
+#if defined(HAVE_STRCASECMP)
#define nasm_stricmp strcasecmp
-#endif
+#elif defined(HAVE_STRICMP)
+#define nasm_stricmp stricmp
#else
int nasm_stricmp(const char *, const char *);
#endif
-#if defined(strnicmp) || defined(strncasecmp)
-#if defined(strnicmp)
-#define nasm_strnicmp strnicmp
-#else
+#if defined(HAVE_STRNCASECMP)
#define nasm_strnicmp strncasecmp
-#endif
+#elif defined(HAVE_STRNICMP)
+#define nasm_strnicmp strnicmp
#else
int nasm_strnicmp(const char *, const char *, int);
#endif
-#if defined(strsep)
+#if defined(HAVE_STRSEP)
#define nasm_strsep strsep
#else
char *nasm_strsep(char **stringp, const char *delim);
diff --git a/ndisasm.c b/ndisasm.c
index ea4dc53..a666431 100644
--- a/ndisasm.c
+++ b/ndisasm.c
@@ -6,6 +6,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
diff --git a/outform.c b/outform.c
index 1cdd5be..3f4d18f 100644
--- a/outform.c
+++ b/outform.c
@@ -9,6 +9,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
diff --git a/output/outaout.c b/output/outaout.c
index d5358b4..6c9bf24 100644
--- a/output/outaout.c
+++ b/output/outaout.c
@@ -7,6 +7,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outas86.c b/output/outas86.c
index 135ddda..4bfbb04 100644
--- a/output/outas86.c
+++ b/output/outas86.c
@@ -7,6 +7,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outbin.c b/output/outbin.c
index a1c51c8..b5a7524 100644
--- a/output/outbin.c
+++ b/output/outbin.c
@@ -44,6 +44,8 @@
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outcoff.c b/output/outcoff.c
index 8eb8c06..44a41e5 100644
--- a/output/outcoff.c
+++ b/output/outcoff.c
@@ -7,6 +7,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outdbg.c b/output/outdbg.c
index 0dda75a..43c6504 100644
--- a/output/outdbg.c
+++ b/output/outdbg.c
@@ -7,6 +7,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outelf32.c b/output/outelf32.c
index fbc98d6..ca91848 100644
--- a/output/outelf32.c
+++ b/output/outelf32.c
@@ -7,6 +7,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outelf64.c b/output/outelf64.c
index e87d8bd..5f77bb1 100644
--- a/output/outelf64.c
+++ b/output/outelf64.c
@@ -7,6 +7,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outieee.c b/output/outieee.c
index 19b2575..145fcaf 100644
--- a/output/outieee.c
+++ b/output/outieee.c
@@ -36,6 +36,8 @@
*
* David Lindauer, LADsoft
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outmacho.c b/output/outmacho.c
index 86700f8..545fa27 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -10,6 +10,8 @@
/* Most of this file is, like Mach-O itself, based on a.out. For more
* guidelines see outaout.c. */
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outobj.c b/output/outobj.c
index c411edd..2f7079e 100644
--- a/output/outobj.c
+++ b/output/outobj.c
@@ -7,6 +7,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outrdf.c b/output/outrdf.c
index cd311de..d3fbb92 100644
--- a/output/outrdf.c
+++ b/output/outrdf.c
@@ -12,6 +12,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/output/outrdf2.c b/output/outrdf2.c
index c98bead..82ac0ec 100644
--- a/output/outrdf2.c
+++ b/output/outrdf2.c
@@ -9,6 +9,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/parser.c b/parser.c
index 31c3612..fc1f0cf 100644
--- a/parser.c
+++ b/parser.c
@@ -8,6 +8,8 @@
* initial version 27/iii/95 by Simon Tatham
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
diff --git a/pptok.pl b/pptok.pl
index f918e35..ee49648 100755
--- a/pptok.pl
+++ b/pptok.pl
@@ -138,6 +138,7 @@ if ($what eq 'c') {
die if ($n & ($n-1));
+ print OUT "#include \"compiler.h\"\n";
print OUT "#include <inttypes.h>\n";
print OUT "#include <ctype.h>\n";
print OUT "#include \"nasmlib.h\"\n";
diff --git a/preproc.c b/preproc.c
index 1ee07ad..5d97d1e 100644
--- a/preproc.c
+++ b/preproc.c
@@ -34,6 +34,8 @@
* detoken is used to convert the line back to text
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
diff --git a/rdoff/collectn.c b/rdoff/collectn.c
index ad43d85..317c528 100644
--- a/rdoff/collectn.c
+++ b/rdoff/collectn.c
@@ -4,8 +4,9 @@
* This file is public domain.
*/
-#include "collectn.h"
+#include "compiler.h"
#include <stdlib.h>
+#include "collectn.h"
void collection_init(Collection * c)
{
diff --git a/rdoff/hash.c b/rdoff/hash.c
index 34a8edc..8b1d3cf 100644
--- a/rdoff/hash.c
+++ b/rdoff/hash.c
@@ -8,6 +8,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include "hash.h"
const uint32_t consttab[] = {
diff --git a/rdoff/ldrdf.c b/rdoff/ldrdf.c
index e28f284..cd07fe7 100644
--- a/rdoff/ldrdf.c
+++ b/rdoff/ldrdf.c
@@ -24,6 +24,8 @@
* under DOS. '#define STINGY_MEMORY' may help a little.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/rdoff/rdf2bin.c b/rdoff/rdf2bin.c
index e556186..0b3f999 100644
--- a/rdoff/rdf2bin.c
+++ b/rdoff/rdf2bin.c
@@ -2,6 +2,8 @@
* rdf2bin.c - convert an RDOFF object file to flat binary
*/
+#include "compiler.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/rdoff/rdf2ihx.c b/rdoff/rdf2ihx.c
index a0238da..94ba1cb 100644
--- a/rdoff/rdf2ihx.c
+++ b/rdoff/rdf2ihx.c
@@ -4,6 +4,8 @@
* Note that this program only writes 16-bit HEX.
*/
+#include "compiler.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/rdoff/rdfdump.c b/rdoff/rdfdump.c
index 691241d..8330557 100644
--- a/rdoff/rdfdump.c
+++ b/rdoff/rdfdump.c
@@ -2,6 +2,8 @@
* rdfdump.c - dump RDOFF file header.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/rdoff/rdflib.c b/rdoff/rdflib.c
index 6abd13c..b4bf6d6 100644
--- a/rdoff/rdflib.c
+++ b/rdoff/rdflib.c
@@ -23,6 +23,8 @@
* content size, followed by data.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
diff --git a/rdoff/rdfload.c b/rdoff/rdfload.c
index cd24c2d..063724e 100644
--- a/rdoff/rdfload.c
+++ b/rdoff/rdfload.c
@@ -17,6 +17,8 @@
* - support for segment relocations (hard to do in ANSI C)
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/rdoff/rdlar.c b/rdoff/rdlar.c
index df813d1..1d4cd43 100644
--- a/rdoff/rdlar.c
+++ b/rdoff/rdlar.c
@@ -3,6 +3,8 @@
* Copyright (c) 2002 RET & COM Research.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
diff --git a/rdoff/rdlib.c b/rdoff/rdlib.c
index c094a56..a6ae156 100644
--- a/rdoff/rdlib.c
+++ b/rdoff/rdlib.c
@@ -2,6 +2,8 @@
* rdlib.c - routines for manipulating RDOFF libraries (.rdl)
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/rdoff/rdoff.c b/rdoff/rdoff.c
index ac72279..2539499 100644
--- a/rdoff/rdoff.c
+++ b/rdoff/rdoff.c
@@ -15,6 +15,8 @@
* make it portable.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/rdoff/rdx.c b/rdoff/rdx.c
index 82210a6..26be0c4 100644
--- a/rdoff/rdx.c
+++ b/rdoff/rdx.c
@@ -12,6 +12,8 @@
files. You can use these files in your own program to load RDOFF objects
and execute the code in them in a similar way to what is shown here. */
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
diff --git a/rdoff/segtab.c b/rdoff/segtab.c
index 8ee1b7b..e1a3ddf 100644
--- a/rdoff/segtab.c
+++ b/rdoff/segtab.c
@@ -1,3 +1,5 @@
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include "segtab.h"
diff --git a/rdoff/symtab.c b/rdoff/symtab.c
index 6026ccd..ce54d8e 100644
--- a/rdoff/symtab.c
+++ b/rdoff/symtab.c
@@ -7,6 +7,9 @@
* redistributable under the licence given in the file "Licence"
* distributed in the NASM archive.
*/
+
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/regs.pl b/regs.pl
index 9dde682..404c2f6 100755
--- a/regs.pl
+++ b/regs.pl
@@ -78,7 +78,7 @@ close(REGS);
if ( $fmt eq 'h' ) {
# Output regs.h
- print "/* automatically generated from $file - do not edit */\n";
+ print "/* automatically generated from $file - do not edit */\n\n";
$expr_regs = 1;
printf "#define EXPR_REG_START %d\n", $expr_regs;
print "enum reg_enum {\n";
@@ -101,7 +101,8 @@ if ( $fmt eq 'h' ) {
print "\n";
} elsif ( $fmt eq 'c' ) {
# Output regs.c
- print "/* automatically generated from $file - do not edit */\n";
+ print "/* automatically generated from $file - do not edit */\n\n";
+ print "#include \"compiler.h\"\n\n";
print "static const char * const reg_names[] = "; $ch = '{';
# This one has no dummy entry for 0
foreach $reg ( sort(keys(%regs)) ) {
diff --git a/stdscan.c b/stdscan.c
index aecbd4a..934fdf5 100644
--- a/stdscan.c
+++ b/stdscan.c
@@ -1,3 +1,5 @@
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sync.c b/sync.c
index 562c59d..b60d2a4 100644
--- a/sync.c
+++ b/sync.c
@@ -6,6 +6,8 @@
* distributed in the NASM archive.
*/
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
diff --git a/tokhash.pl b/tokhash.pl
index 2265bd0..b5e85aa 100755
--- a/tokhash.pl
+++ b/tokhash.pl
@@ -168,6 +168,7 @@ if ($output eq 'h') {
print " */\n";
print "\n";
+ print "#include \"compiler.h\"\n";
print "#include <string.h>\n";
print "#include \"nasm.h\"\n";
print "#include \"hashtbl.h\"\n";