Commit bdc5490
committed
sys.h: Fix __attribute__ usage for non-GCC compilers
Restructure MLD_INLINE and MLD_ALWAYS_INLINE into separate blocks,
each independently guarded:
MLD_INLINE:
- MSVC: __inline
- C99 or inline macro: inline
- GCC/Clang C90: __attribute__((unused)) to silence warnings
- Other C90: empty
MLD_ALWAYS_INLINE:
- MSVC: __forceinline
- GCC/Clang: MLD_INLINE __attribute__((always_inline))
- Other: MLD_INLINE
This fixes two issues:
1. If `inline` was defined as a macro before including sys.h, the MSVC
check was bypassed and __attribute__ was used, causing MSVC failures.
2. For non-MSVC/GCC/Clang compilers, __attribute__ was used
unconditionally, causing build failures.
Also fix typo: defined(clang) -> defined(__clang__)
Signed-off-by: Matthias J. Kannwischer <[email protected]>1 parent 060fdbd commit bdc5490
1 file changed
+26
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
115 | 114 | | |
116 | | - | |
117 | | - | |
118 | 115 | | |
119 | | - | |
120 | 116 | | |
121 | 117 | | |
122 | | - | |
123 | | - | |
124 | | - | |
| 118 | + | |
| 119 | + | |
125 | 120 | | |
126 | | - | |
127 | | - | |
| 121 | + | |
128 | 122 | | |
129 | | - | |
| 123 | + | |
| 124 | + | |
130 | 125 | | |
| 126 | + | |
131 | 127 | | |
132 | | - | |
133 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
134 | 138 | | |
135 | | - | |
136 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
137 | 143 | | |
138 | 144 | | |
139 | 145 | | |
| |||
209 | 215 | | |
210 | 216 | | |
211 | 217 | | |
212 | | - | |
| 218 | + | |
213 | 219 | | |
214 | 220 | | |
215 | 221 | | |
| |||
0 commit comments