Vcsn  2.3
Be Rational
attributes.hh
Go to the documentation of this file.
1 #pragma once
2 
3 // The placement of these attributes is a bit painful.
4 //
5 // template <wet_kind WetType>
6 // ATTRIBUTE_PURE
7 // static auto
8 // equal_impl(const value_t& l, const value_t& r)
9 // -> std::enable_if_t<WetType == value_t::bitset,
10 // bool>
11 // {
12 // return l == r;
13 // }
14 
15 #if defined __clang__
16 
17 # define ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
18 # define ATTRIBUTE_CONST __attribute__((const))
19 # define ATTRIBUTE_DLLEXPORT
20 # define ATTRIBUTE_DLLIMPORT
21 # define ATTRIBUTE_HOT __attribute__((hot))
22 # define ATTRIBUTE_NORETURN [[noreturn]]
23 # define ATTRIBUTE_PURE __attribute__((pure))
24 # define ATTRIBUTE_USED __attribute__((used))
25 
26 #elif defined __GNUC__
27 
28 # define ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
29 # define ATTRIBUTE_CONST __attribute__((const))
30 # define ATTRIBUTE_DLLEXPORT __attribute__((visibility("default")))
31 # define ATTRIBUTE_DLLIMPORT ATTRIBUTE_DLLEXPORT
32 # define ATTRIBUTE_HOT __attribute__((hot))
33 # define ATTRIBUTE_NORETURN __attribute__((noreturn))
34 # define ATTRIBUTE_PURE __attribute__((pure))
35 # define ATTRIBUTE_USED __attribute__((used))
36 
37 #elif defined _MSC_VER
38 
39 # define ATTRIBUTE_ALWAYS_INLINE
40 # define ATTRIBUTE_CONST __declspec(const)
41 # define ATTRIBUTE_DLLEXPORT __declspec(dllexport)
42 # define ATTRIBUTE_DLLIMPORT __declspec(dllimport)
43 # define ATTRIBUTE_HOT
44 # define ATTRIBUTE_NORETURN [[noreturn]]
45 # define ATTRIBUTE_PURE
46 # define ATTRIBUTE_USED
47 
48 #endif