[libc-commits] [libc] [libc] Implement CMPLX related macros (PR #156344)

Connector Switch via libc-commits libc-commits at lists.llvm.org
Thu Sep 4 09:34:53 PDT 2025


================
@@ -19,6 +21,18 @@
 
 // TODO: Add imaginary macros once GCC or Clang support _Imaginary builtin-type.
 
+#define CMPLX(x, y) __builtin_complex((double)(x), (double)(y))
+#define CMPLXF(x, y) __builtin_complex((float)(x), (float)(y))
+#define CMPLXL(x, y) __builtin_complex((long double)(x), (long double)(y))
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
----------------
c8ef wrote:

Done. I added another check for minor version to ensure it is a release version.

https://github.com/llvm/llvm-project/pull/156344


More information about the libc-commits mailing list