Version 0.99.03
[nasm/avx512.git] / compiler.h
blob8ceb9ee9d79983c3ce9a703905e08f3a08b8e1d2
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 * ----------------------------------------------------------------------- */
12 * compiler.h
14 * Compiler-specific macros for NASM. Feel free to add support for
15 * other compilers in here.
18 #ifndef COMPILER_H
19 #define COMPILER_H 1
21 #ifdef HAVE_CONFIG_H
22 # include "config.h"
23 #endif
25 #ifdef __GNUC__
26 # if __GNUC__ >= 4
27 # define HAVE_GNUC_4
28 # endif
29 # if __GNUC__ >= 3
30 # define HAVE_GNUC_3
31 # endif
32 #endif
34 #ifdef __GNUC__
35 # define _unused __attribute__((unused))
36 #else
37 # define _unused
38 #endif
40 /* Some versions of MSVC have these only with underscores in front */
42 #if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
43 # define snprintf _snprintf
44 #endif
46 #if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
47 # define vsnprintf _vsnprintf
48 #endif
50 #endif /* COMPILER_H */