|
1 | 1 | /************************************************************************* |
2 | | -* Platform macros |
3 | | -* A C++ header that defines macros depending on the compilation |
4 | | -* environment and targets. |
5 | | -*------------------------------------------------------------------------ |
6 | | -* Copyright (c) 2017-2020, Daniel Almeida |
7 | | -* All rights reserved. |
8 | | -* |
9 | | -* Redistribution and use in source and binary forms, with or without |
10 | | -* modification, are permitted provided that the following conditions |
11 | | -* are met: |
12 | | -* |
13 | | -* 1. Redistributions of source code must retain the above copyright |
14 | | -* notice, this list of conditions and the following disclaimer. |
15 | | -* |
16 | | -* 2. Redistributions in binary form must reproduce the above copyright |
17 | | -* notice, this list of conditions and the following disclaimer in the |
18 | | -* documentation and/or other materials provided with the distribution. |
19 | | -* |
20 | | -* 3. Neither the name of the copyright holder nor the names of its |
21 | | -* contributors may be used to endorse or promote products derived from |
22 | | -* this software without specific prior written permission. |
23 | | -* |
24 | | -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
25 | | -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
26 | | -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
27 | | -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
28 | | -* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
29 | | -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
30 | | -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
31 | | -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
32 | | -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
33 | | -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
34 | | -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
35 | | -*************************************************************************/ |
| 2 | + * Platform macros |
| 3 | + * A C++ header that defines macros depending on the compilation |
| 4 | + * environment and targets. |
| 5 | + *------------------------------------------------------------------------ |
| 6 | + * Copyright (c) 2017-2020, Daniel Almeida |
| 7 | + * All rights reserved. |
| 8 | + * |
| 9 | + * Redistribution and use in source and binary forms, with or without |
| 10 | + * modification, are permitted provided that the following conditions |
| 11 | + * are met: |
| 12 | + * |
| 13 | + * 1. Redistributions of source code must retain the above copyright |
| 14 | + * notice, this list of conditions and the following disclaimer. |
| 15 | + * |
| 16 | + * 2. Redistributions in binary form must reproduce the above copyright |
| 17 | + * notice, this list of conditions and the following disclaimer in the |
| 18 | + * documentation and/or other materials provided with the distribution. |
| 19 | + * |
| 20 | + * 3. Neither the name of the copyright holder nor the names of its |
| 21 | + * contributors may be used to endorse or promote products derived from |
| 22 | + * this software without specific prior written permission. |
| 23 | + * |
| 24 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 25 | + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 26 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 27 | + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 28 | + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 29 | + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 30 | + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 31 | + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 32 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 33 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 34 | + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 35 | + *************************************************************************/ |
36 | 36 |
|
37 | 37 | #pragma once |
38 | 38 |
|
|
68 | 68 |
|
69 | 69 | #ifdef COMPILER_VC |
70 | 70 |
|
71 | | -#define DEPRECATED \ |
72 | | - __declspec( deprecated( "deprecated, avoid using this" ) ) |
| 71 | +#define DEPRECATED __declspec(deprecated("deprecated, avoid using this")) |
73 | 72 |
|
74 | | -#define DEPRECATED_WITH_SUBSTITUTE( substitute ) \ |
75 | | - __declspec( deprecated( "deprecated, use " #substitute " instead" ) ) |
| 73 | +#define DEPRECATED_WITH_SUBSTITUTE(substitute) \ |
| 74 | + __declspec(deprecated("deprecated, use " #substitute " instead")) |
76 | 75 |
|
77 | 76 | #else |
78 | 77 |
|
79 | | -#define DEPRECATED \ |
80 | | - __attribute__( ( deprecated( "avoid using this" ) ) ) |
| 78 | +#define DEPRECATED __attribute__((deprecated("avoid using this"))) |
81 | 79 |
|
82 | | -#define DEPRECATED_WITH_SUBSTITUTE( substitute ) \ |
83 | | - __attribute__( ( deprecated( "use " #substitute " instead" ) ) ) |
| 80 | +#define DEPRECATED_WITH_SUBSTITUTE(substitute) \ |
| 81 | + __attribute__((deprecated("use " #substitute " instead"))) |
84 | 82 |
|
85 | 83 | #endif |
86 | 84 |
|
|
133 | 131 |
|
134 | 132 | #endif |
135 | 133 |
|
136 | | -#if defined _M_IX86 || defined ___i386__ || defined __i386 || defined __X86__ || defined _X86_ || defined __I86__ |
| 134 | +#if defined _M_IX86 || defined ___i386__ || defined __i386 || \ |
| 135 | + defined __X86__ || defined _X86_ || defined __I86__ |
137 | 136 |
|
138 | 137 | #define ARCHITECTURE_X86 1 |
139 | | -#define ARCHITECTURE_X86_OLD 1 // Should disappear when the x86-64 Garry's Mod branch is merged |
| 138 | +#define ARCHITECTURE_X86_OLD \ |
| 139 | + 1 // Should disappear when the x86-64 Garry's Mod branch is merged |
140 | 140 |
|
141 | 141 | #define ARCHITECTURE_IS_X86 1 |
142 | 142 | #define ARCHITECTURE_IS_X86_64 0 |
143 | 143 |
|
144 | | -#elif defined _M_X64 || defined __amd64__ || defined __amd64 || defined __x86_64__ || defined __x86_64 |
| 144 | +#elif defined _M_X64 || defined __amd64__ || defined __amd64 || \ |
| 145 | + defined __x86_64__ || defined __x86_64 |
145 | 146 |
|
146 | 147 | #define ARCHITECTURE_X86_64 1 |
147 | 148 |
|
|
0 commit comments