[libc-commits] [libc] [libc][complex] Set up headers and add documentation (PR #111659)

via libc-commits libc-commits at lists.llvm.org
Thu Oct 10 07:53:09 PDT 2024


================
@@ -0,0 +1,30 @@
+//===-- Definition of macros to be used with complex functions ------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __LLVM_LIBC_MACROS_COMPLEX_MACROS_H
+#define __LLVM_LIBC_MACROS_COMPLEX_MACROS_H
+
+#ifndef __STDC_NO_COMPLEX__
+
+#define __STDC_VERSION_COMPLEX_H__ 202311L
+
+#define complex _Complex
+#define _Complex_I ((float _Complex)1.0fi)
+
+#ifdef _Imaginary
----------------
lntue wrote:

Since `_Imaginary` is currently not supported by both clang and gcc, maybe we can omit this `ifdef` for now.

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


More information about the libc-commits mailing list