File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
src/plugins/score-plugin-threedim/Threedim Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 1111
1212#include < algorithm>
1313
14+ #if (!defined(__linux__))
15+ #define SCORE_LIBC_HAS_FLOAT16 1
16+ #elif (defined(__linux__) && defined(__GLIBC__))
17+ #if __GLIBC_PREREQ(2, 40)
18+ #define SCORE_LIBC_HAS_FLOAT16 1
19+ #endif
20+ #endif
21+
22+ // when you enter the least obvious syntax competition and your opponent is clang builtins
23+ #if defined(__is_identifier)
24+ #if (!__is_identifier(_Float16))
25+ #define SCORE_COMPILER_HAS_FLOAT16 1
26+ #endif
27+ #endif
28+
1429namespace Threedim
1530{
1631struct custom_texture
@@ -209,11 +224,9 @@ class ArrayToTexture
209224
210225 case R16F:
211226 case RGBA16F:
212- // when you enter the least obvious syntax competition and your opponent is clang builtins
213- #if defined(__is_identifier)
214- #if (!__is_identifier(_Float16))
227+
228+ #if (SCORE_LIBC_HAS_FLOAT16 && SCORE_COMPILER_HAS_FLOAT16)
215229 std::copy_n (value.data (), to_copy, (_Float16*)out);
216- #endif
217230#endif
218231 break ;
219232
You can’t perform that action at this time.
0 commit comments