Skip to content

Commit 25305cf

Browse files
committed
ci: older libc (< 2.36?) do not support _Float16
1 parent 9a15ada commit 25305cf

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/plugins/score-plugin-threedim/Threedim/ArrayToBuffer.hpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@
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+
1429
namespace Threedim
1530
{
1631
struct 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

0 commit comments

Comments
 (0)