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

Shourya Goel via libc-commits libc-commits at lists.llvm.org
Thu Oct 10 08:00:42 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
----------------
Sh0g0-1758 wrote:

I think we should let this be. Since the ISO spec is defined like this, it does not really affect the build and once _Imaginary gets supported (which I am guessing it eventually will), we will anyway have to add this. 

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


More information about the libc-commits mailing list