+ 19.3 Diagnostics library, Assertions: <cassert>
[lightlibc++.git] / include / lightlibc++ / compiler.hpp
blobbf2dc5e6333333fcb5605cc819ffb2f59de5d676
1 /*
2 Permission is granted to use, modify, and / or redistribute at will.
4 This includes removing authorship notices, re-use of code parts in
5 other software (with or without giving credit), and / or creating a
6 commercial product based on it.
8 This permission is not revocable by the author.
10 This software is provided as-is. Use it at your own risk. There is
11 no warranty whatsoever, neither expressed nor implied, and by using
12 this software you accept that the author(s) shall not be held liable
13 for any loss of data, loss of service, or other damages, be they
14 incidental or consequential. Your only option other than accepting
15 this is not to use the software at all.
17 #ifndef _LIGHTLIBCPP_COMPILER_HPP
18 #define _LIGHTLIBCPP_COMPILER_HPP
22 #ifdef __GNUC__
23 /**
24 *\english
25 * Used to declare a function that does not return. This allows the compiler
26 * better optimisations.
27 *\endenglish
28 *\german
29 * Wird benutzt um eine Funktion zu deklarieren, die nicht zum aufrufenden
30 * Code zurückkehrt. Dies erlaubt dem Compiler besser zu optimieren.
31 *\endgerman
33 #define _LIGHTLIBCPP_NORETURN __attribute__((noreturn))
35 /**
36 *\english
37 * Used to declare classes, functions, variables and types deprecated. When
38 * a deprecated entity is used, the compiler issues a warning or an error
39 *\endenglish
40 *\german
41 * Wird benutzt um Klassen, Funktionen, Variablen und Typen als veraltet zu
42 * markieren. Bei Benutzung eines dieser Objekte wird der Compiler eine
43 * Warnung oder eine Fehlermeldung ausgeben.
44 *\endgerman
46 #define _LIGHTLIBCPP_DEPRECATED __attribute__((deprecated))
48 #ifdef _LIGHTLIBCPP_CPP10_STRICT
49 /**
50 *\english
51 * See _LIGHTLIBCPP_DEPRECATED for an explanation of what the define does,
52 * This define however is used to indicate that a C++03 feature is
53 * deprecated with C++10.
54 *\endenglish
55 *\german
56 * Siehe _LIGHTLIBCPP_DEPRECATED. Dieses Makro wird im Gegensatz zu
57 * _LIGHTLIBCPP_DEPRECATED verwendet um anzuzeigen, dass das Feature von
58 * C++03 mit C++10 als veraltet ist.
59 *\endgerman
61 #define _LIGHTLIBCPP_DEPRECATED_CPP10 _LIGHTLIBCPP_DEPRECATED
62 #else
63 #define _LIGHTLIBCPP_DEPRECATED_CPP10
64 #endif
66 #ifndef __EXCEPTIONS
67 #define _LIGHTLIBCPP_NO_EXCEPTIONS 1
68 #endif
70 #ifndef __GXX_RTTI
71 #define _LIGHTLIBCPP_NO_RTTI 1
72 #endif
74 #else
75 #error Your compiler is not supported
76 #endif
80 #endif