Awali
Another Weighted Automata library
attributes.hh
Go to the documentation of this file.
1 // This file is part of Awali.
2 // Copyright 2016-2022 Sylvain Lombardy, Victor Marsault, Jacques Sakarovitch
3 //
4 // Awali is a free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef AWALI_MISC_ATTRIBUTES_HH
18 # define AWALI_MISC_ATTRIBUTES_HH
19 
20 # if defined __clang__
21 
22 # define ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
23 # define ATTRIBUTE_CONST __attribute__((const))
24 # define ATTRIBUTE_DLLEXPORT
25 # define ATTRIBUTE_DLLIMPORT
26 # define ATTRIBUTE_HOT __attribute__((hot))
27 # define ATTRIBUTE_NORETURN [[noreturn]]
28 # define ATTRIBUTE_PURE __attribute__((pure))
29 # define ATTRIBUTE_HIDDEN
30 
31 # elif defined __GNUC__
32 
33 # define ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
34 # define ATTRIBUTE_CONST __attribute__((const))
35 # define ATTRIBUTE_DLLEXPORT __attribute__((visibility("default")))
36 # define ATTRIBUTE_DLLIMPORT ATTRIBUTE_DLLEXPORT
37 # define ATTRIBUTE_HOT __attribute__((hot))
38 # define ATTRIBUTE_NORETURN __attribute__((noreturn))
39 # define ATTRIBUTE_PURE __attribute__((pure))
40 # define ATTRIBUTE_HIDDEN __attribute__ ((visibility ("hidden")))
41 
42 # elif defined _MSC_VER
43 
44 # define ATTRIBUTE_ALWAYS_INLINE
45 # define ATTRIBUTE_CONST __declspec(const)
46 # define ATTRIBUTE_DLLEXPORT __declspec(dllexport)
47 # define ATTRIBUTE_DLLIMPORT __declspec(dllimport)
48 # define ATTRIBUTE_HOT
49 # define ATTRIBUTE_NORETURN [[noreturn]]
50 # define ATTRIBUTE_PURE
51 # define ATTRIBUTE_HIDDEN
52 
53 # endif
54 
55 
56 #endif // !AWALI_MISC_ATTRIBUTES_HH