Skip to content

Commit 9471b6e

Browse files
frobtechNoumanAmir657
authored andcommitted
[libc] Fix fexcept_t type to match canonical ABI and API (llvm#113666)
In glibc and musl, fexcept_t is unsigned short int on x86 and unsigned int on other machines that llvm-libc supports. Match that ABI (only different from before on x86) and API (different everywhere as it was previously signed).
1 parent 7ffefb3 commit 9471b6e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libc/include/llvm-libc-types/fexcept_t.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
#ifndef LLVM_LIBC_TYPES_FEXCEPT_T_H
1010
#define LLVM_LIBC_TYPES_FEXCEPT_T_H
1111

12-
typedef int fexcept_t;
12+
#if defined(__x86_64__) || defined(__i386__)
13+
typedef unsigned short int fexcept_t;
14+
#else
15+
typedef unsigned int fexcept_t;
16+
#endif
1317

1418
#endif // LLVM_LIBC_TYPES_FEXCEPT_T_H

0 commit comments

Comments
 (0)