Skip to content

Commit 95e8a7c

Browse files
authored
[libc][stdfix] Use __FRACT_FBIT__ for fixed point support detection instead of compiler version. (#81820)
Now that `__FRACT_FBIT__` and related macros are added in #81207, it is safer to use them for fixed point support detection, so that codes that do not use fixed point types will not fail to build when `-ffixed-point` is missing.
1 parent fcb5a98 commit 95e8a7c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

libc/include/llvm-libc-macros/stdfix-macros.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
#ifndef __LLVM_LIBC_MACROS_STDFIX_MACROS_H
1010
#define __LLVM_LIBC_MACROS_STDFIX_MACROS_H
1111

12-
#ifdef __clang__
13-
#if (!defined(__cplusplus) || (__clang_major__ >= 18))
12+
#ifdef __FRACT_FBIT__
1413
// _Fract and _Accum types are available
1514
#define LIBC_COMPILER_HAS_FIXED_POINT
16-
#endif // __cplusplus
17-
#endif // __clang__
15+
#endif // __FRACT_FBIT__
1816

1917
#ifdef LIBC_COMPILER_HAS_FIXED_POINT
2018

0 commit comments

Comments
 (0)