[libc-commits] [libc] [libc] Add `*_HAS_SUBNORM` to `float.h` (PR #102182)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Tue Aug 6 10:00:56 PDT 2024
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/102182
Summary:
These should be defined, since we provide `float.h` it will override the
Clang resource dir and not provide it.
>From d72d772f32cd6134cd26b24f3cd7b62cd303cca9 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Tue, 6 Aug 2024 11:59:26 -0500
Subject: [PATCH] [libc] Add `*_HAS_SUBNORM` to `float.h`
Summary:
These should be defined, since we provide `float.h` it will override the
Clang resource dir and not provide it.
---
libc/include/llvm-libc-macros/float-macros.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/libc/include/llvm-libc-macros/float-macros.h b/libc/include/llvm-libc-macros/float-macros.h
index 81c1df868bf6c..a25ef60a293d3 100644
--- a/libc/include/llvm-libc-macros/float-macros.h
+++ b/libc/include/llvm-libc-macros/float-macros.h
@@ -161,6 +161,18 @@
#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
#endif // LDBL_MAX_10_EXP
+#ifndef FLT_HAS_SUBNORM
+#define FLT_HAS_SUBNORM __FLT_HAS_DENORM__
+#endif // FLT_HAS_SUBNORM
+
+#ifndef DBL_HAS_SUBNORM
+#define DBL_HAS_SUBNORM __DBL_HAS_DENORM__
+#endif // DBL_HAS_SUBNORM
+
+#ifndef LDBL_HAS_SUBNORM
+#define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__
+#endif // LDBL_HAS_SUBNORM
+
// TODO: Add FLT16 and FLT128 constants.
#endif // LLVM_LIBC_MACROS_FLOAT_MACROS_H
More information about the libc-commits
mailing list