2 // (C) Copyright Tobias Schwinger
4 // Use modification and distribution are subject to the boost Software License,
5 // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
7 //------------------------------------------------------------------------------
9 #ifndef BOOST_FT_CONFIG_COMPILER_HPP_INCLUDED
10 #define BOOST_FT_CONFIG_COMPILER_HPP_INCLUDED
12 #include <boost/config.hpp>
13 #include <boost/detail/workaround.hpp>
15 #if defined(BOOST_MSVC)
17 # if BOOST_MSVC < 1310
18 # error "unsupported compiler version"
21 # ifdef BOOST_FT_AUTODETECT_CALLING_CONVENTIONS
23 // enable clrcall calling covention (call to .NET managed code) when
24 // compiling with /clr
25 # if BOOST_MSVC >= 1400 && defined(__cplusplus_cli)
26 # ifndef BOOST_FT_CC_CLRCALL
27 # define BOOST_FT_CC_CLRCALL callable_builtin
31 // Intel x86 architecture specific calling conventions
33 # define BOOST_FT_COMMON_X86_CCs callable_builtin
34 # if BOOST_MSVC < 1400
35 // version 7.1 is missing a keyword to specify the thiscall cc ...
36 # ifndef BOOST_FT_CC_IMPLICIT_THISCALL
37 # define BOOST_FT_CC_IMPLICIT_THISCALL non_variadic|member|callable_builtin
38 # ifndef BOOST_FT_CONFIG_OK
39 # pragma message("INFO| /Gd /Gr /Gz will compiler options will cause")
40 # pragma message("INFO| a compile error.")
41 # pragma message("INFO| Reconfigure Boost.FunctionTypes in this case.")
42 # pragma message("INFO| This message can be suppressed by defining")
43 # pragma message("INFO| BOOST_FT_CONFIG_OK.")
47 // ...introduced in version 8
48 # ifndef BOOST_FT_CC_THISCALL
49 # define BOOST_FT_CC_THISCALL non_variadic|member|callable_builtin
55 #elif defined(__GNUC__) && !defined(BOOST_INTEL_LINUX)
58 # error "unsupported compiler version"
61 # ifdef BOOST_FT_AUTODETECT_CALLING_CONVENTIONS
63 # if defined(__i386__)
64 # // see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20439
65 # // see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29328
66 # if BOOST_WORKAROUND(__GNUC__,BOOST_TESTED_AT(4))
67 # ifndef BOOST_FT_CC_IMPLICIT
68 # define BOOST_FT_CC_IMPLICIT member|callable_builtin
70 # define BOOST_FT_COMMON_X86_CCs non_member|callable_builtin
72 # define BOOST_FT_COMMON_X86_CCs callable_builtin
75 # ifndef BOOST_FT_CC_IMPLICIT
76 # define BOOST_FT_CC_IMPLICIT callable_builtin
81 # if (defined(BOOST_FT_CC_CDECL) || defined(BOOST_FT_COMMON_X86_CCs)) \
83 # define __cdecl __attribute__((__cdecl__))
85 # if (defined(BOOST_FT_CC_STDCALL) || defined(BOOST_FT_COMMON_X86_CCs)) \
86 && !defined(__stdcall)
87 # define __stdcall __attribute__((__stdcall__))
89 # if (defined(BOOST_FT_CC_FASTCALL) || defined(BOOST_FT_COMMON_X86_CCs)) \
90 && !defined(__fastcall)
91 # define __fastcall __attribute__((__fastcall__))
94 #elif defined(__BORLANDC__)
96 # if __BORLANDC__ < 0x550
97 # error "unsupported compiler version"
98 # elif __BORLANDC__ > 0x565
99 # pragma message("WARNING: library untested with this compiler version")
102 # ifdef BOOST_FT_AUTODETECT_CALLING_CONVENTIONS
103 # define BOOST_FT_COMMON_X86_CCs callable_builtin
106 // syntactic specialities of cc specifier
107 # define BOOST_FT_SYNTAX(result,lparen,cc_spec,type_mod,name,rparen) \
108 result() cc_spec() lparen() type_mod() name() rparen()
110 // only enable default calling convention
111 # define BOOST_FT_CC_IMPLICIT callable_builtin