[libc-commits] [libc] 0c8e12f - [libc] Fix fexcept_t type to match canonical ABI and API (#113666)
via libc-commits
libc-commits at lists.llvm.org
Wed Oct 30 10:09:38 PDT 2024
Author: Roland McGrath
Date: 2024-10-30T10:09:34-07:00
New Revision: 0c8e12fc64073a889956e790881cdf0d58018372
URL: https://github.com/llvm/llvm-project/commit/0c8e12fc64073a889956e790881cdf0d58018372
DIFF: https://github.com/llvm/llvm-project/commit/0c8e12fc64073a889956e790881cdf0d58018372.diff
LOG: [libc] Fix fexcept_t type to match canonical ABI and API (#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).
Added:
Modified:
libc/include/llvm-libc-types/fexcept_t.h
Removed:
################################################################################
diff --git a/libc/include/llvm-libc-types/fexcept_t.h b/libc/include/llvm-libc-types/fexcept_t.h
index 60687bd1318aa4..5aa09fbbaffc77 100644
--- a/libc/include/llvm-libc-types/fexcept_t.h
+++ b/libc/include/llvm-libc-types/fexcept_t.h
@@ -9,6 +9,10 @@
#ifndef LLVM_LIBC_TYPES_FEXCEPT_T_H
#define LLVM_LIBC_TYPES_FEXCEPT_T_H
-typedef int fexcept_t;
+#if defined(__x86_64__) || defined(__i386__)
+typedef unsigned short int fexcept_t;
+#else
+typedef unsigned int fexcept_t;
+#endif
#endif // LLVM_LIBC_TYPES_FEXCEPT_T_H
More information about the libc-commits
mailing list