1 /* ----------------------------------------------------------------------- *
3 * Copyright 2007 The NASM Authors - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the license given in the file "License"
7 * distributed in the NASM archive.
9 * ----------------------------------------------------------------------- */
14 * Compiler-specific macros for NASM. Feel free to add support for
15 * other compilers in here.
17 * This header file should be included before any other header.
20 #ifndef NASM_COMPILER_H
21 #define NASM_COMPILER_H 1
27 /* __STRICT_ANSI__ buggers up MinGW, so disable it */
29 # undef __STRICT_ANSI__
32 /* This is required to get the standard <inttypes.h> macros when compiling
33 with a C++ compiler. This must be defined *before* <inttypes.h> is
34 included, directly or indirectly. */
35 #define __STDC_CONSTANT_MACROS 1
36 #define __STDC_LIMIT_MACROS 1
37 #define __STDC_FORMAT_MACROS 1
49 # define _unused __attribute__((unused))
54 /* Some versions of MSVC have these only with underscores in front */
60 # ifdef HAVE__SNPRINTF
61 # define snprintf _snprintf
63 int snprintf(char *, size_t, const char *, ...);
67 #ifndef HAVE_VSNPRINTF
68 # ifdef HAVE__VSNPRINT
69 # define vsnprintf _vsnprintf
71 int vsnprintf(char *, size_t, const char *, va_list);
75 #ifndef __cplusplus /* C++ has false, true, bool as keywords */
76 # ifdef HAVE_STDBOOL_H
79 typedef enum { false, true } bool;
83 #endif /* NASM_COMPILER_H */