Skip to content

Commit 522b6b4

Browse files
committed
Fix missing else case for if __has_builtin(__builtin_assume_aligned)
1 parent 91f4860 commit 522b6b4

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

include/kernel_float/macros.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@
5151

5252
// TOOD: check if this way is support across all compilers
5353
#if defined(__has_builtin)
54-
#if __has_builtin(__builtin_assume_aligned) && 0
55-
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) \
56-
static_cast<TYPE*>(__builtin_assume_aligned(static_cast<TYPE*>(PTR), (ALIGNMENT)))
57-
#endif
54+
#if __has_builtin(__builtin_assume_aligned)
55+
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) \
56+
static_cast<TYPE*>(__builtin_assume_aligned(static_cast<TYPE*>(PTR), (ALIGNMENT)))
57+
#else
58+
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) (PTR)
59+
#endif
5860
#else
5961
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) (PTR)
6062
#endif

single_include/kernel_float.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
//================================================================================
1818
// this file has been auto-generated, do not modify its contents!
19-
// date: 2023-10-24 14:14:37.228322
20-
// git hash: 28f811af866d73bef37acd541bac6a95df9a94c3
19+
// date: 2024-04-26 09:45:38.335903
20+
// git hash: 91f4860ae4ece05ec4d8e198d62d9486efa761db
2121
//================================================================================
2222

2323
#ifndef KERNEL_FLOAT_MACROS_H
@@ -73,10 +73,12 @@
7373

7474
// TOOD: check if this way is support across all compilers
7575
#if defined(__has_builtin)
76-
#if __has_builtin(__builtin_assume_aligned) && 0
77-
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) \
78-
static_cast<TYPE*>(__builtin_assume_aligned(static_cast<TYPE*>(PTR), (ALIGNMENT)))
79-
#endif
76+
#if __has_builtin(__builtin_assume_aligned)
77+
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) \
78+
static_cast<TYPE*>(__builtin_assume_aligned(static_cast<TYPE*>(PTR), (ALIGNMENT)))
79+
#else
80+
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) (PTR)
81+
#endif
8082
#else
8183
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) (PTR)
8284
#endif

0 commit comments

Comments
 (0)