1 #ifndef __XBT_SELECT_COMPILER_FEATURES_H__
2 #define __XBT_SELECT_COMPILER_FEATURES_H__
5 /* select_compiler_features.h - compiler features selection */
7 /* Copyright (c) 2006, 2007, 2010. The SimGrid Team.
8 * All rights reserved. */
10 /* This program is free software; you can redistribute it and/or modify it
11 * under the terms of the license (GNU LGPL) which comes with this package. */
13 #define _XBT_COMPILER_RESOLVED 0
16 /* Borland compilers */
17 #if defined (__BORLANDC__)
18 #define _XBT_COMPILER_NAME "Borland C/C++"
19 #define _XBT_COMPILER_VENDOR "Inprise Corporation"
20 #define _XBT_BORLAND_COMPILER 2
21 /* version macro : __BORLANDC__ */
22 /* version format : ? */
23 #define _XBT_COMPILER_VERSION __BORLANDC__
24 #define _XBT_COMPILER_VERSION_FORMAT "?"
26 #undef _XBT_COMPILER_RESOLVED
27 #define _XBT_COMPILER_RESOLVED 1
30 /* Microsoft Visual C++ compiler */
32 #define _XBT_VISUALC_COMPILER
39 #if defined(__GNUC_PATCHLEVEL__)
40 #define __GNUC_VERSION__ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
42 #define __GNUC_VERSION__ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
45 #define _XBT_COMPILER_NAME "GCC"
46 #define _XBT_COMPILER_VENDOR "GNU"
47 #define _XBT_GCC_COMPILER 2
48 /* version macro : __GNUC_VERSION__ */
49 /* version format : VVRRPP (VV = Version, RR = Revision, PP = Patch) */
50 #define _XBT_COMPILER_VERSION __GNUC_VERSION__
51 #define _XBT_COMPILER_VERSION_FORMAT "VVRRPP (VV = Version, RR = Revision, PP = Patch)"
53 #undef _XBT_COMPILER_RESOLVED
54 #define _XBT_COMPILER_RESOLVED 1
60 /* Returns the compiler name. */
61 #define _xbt_get_compiler_name() _XBT_COMPILER_NAME
63 /* Returns the compiler vendor. */
64 #define _xbt_get_compiler_vendor() _XBT_COMPILER_VENDOR
66 /* Returns 1 if the compiler is resolved (0 in the other case). */
67 #define _xbt_is_compiler_resolved() _XBT_COMPILER_RESOLVED
69 /* Returns the compiler version. */
70 #define _xbt_get_compiler_version() _XBT_STRINGIZE(_XBT_COMPILER_VERSION)
72 /* Returns the compiler version format. */
73 #define _xbt_get_compiler_version_format() _XBT_COMPILER_VERSION_FORMAT
77 #endif /* #ifndef __XBT_SELECT_FEATURES_COMPILER_H__ */