Skip to content

Commit 40b8023

Browse files
committed
CI: fix build for old compilers
1 parent 7a3afa4 commit 40b8023

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/fastfetch.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@
2525
#include "options/display.h"
2626
#include "options/general.h"
2727

28-
#if __has_builtin(__builtin_types_compatible_p)
29-
#define ARRAY_SIZE(x) ({ static_assert(!__builtin_types_compatible_p(__typeof__(x), __typeof__(&*(x))), "Must not be a pointer"); sizeof(x) / sizeof(*(x)); })
30-
#else
28+
#ifdef __has_builtin
29+
#if __has_builtin(__builtin_types_compatible_p)
30+
#define ARRAY_SIZE(x) ({ static_assert(!__builtin_types_compatible_p(__typeof__(x), __typeof__(&*(x))), "Must not be a pointer"); sizeof(x) / sizeof(*(x)); })
31+
#endif
32+
#endif
33+
#ifndef ARRAY_SIZE
3134
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
3235
#endif
3336

0 commit comments

Comments
 (0)