Skip to content

Commit 3c99b48

Browse files
committed
added C++ <complex>
1 parent a494909 commit 3c99b48

File tree

9 files changed

+1246
-6
lines changed

9 files changed

+1246
-6
lines changed

src/libc/include/complex.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#ifndef _COMPLEX_H
22
#define _COMPLEX_H
33

4+
#ifdef __cplusplus
5+
6+
#include <complex>
7+
8+
#else /* __cplusplus */
9+
410
#ifndef __FAST_MATH__
511
#warning "-ffast-math is required for complex multiplication and division to work properly at this time"
612
#endif
713

8-
#ifndef __cplusplus
914
#define complex _Complex
10-
#endif
1115

1216
#ifdef _Imaginary
1317
#define imaginary _Imaginary
@@ -121,4 +125,6 @@ double _Complex catanh(double _Complex);
121125
float _Complex catanhf(float _Complex);
122126
long double _Complex catanhl(long double _Complex);
123127

128+
#endif /* __cplusplus */
129+
124130
#endif /* _COMPLEX_H */

src/libc/include/tgmath.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#ifdef __cplusplus
55

66
#include <cmath>
7+
#include <complex>
78

89
#else /* __cplusplus */
910

src/libcxx/header_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <algorithm>
33
#include <bit>
44
#include <cassert>
5+
#include <ccomplex>
56
#include <cctype>
67
#include <cerrno>
78
#include <cfenv>
@@ -10,6 +11,7 @@
1011
#include <ciso646>
1112
#include <climits>
1213
#include <cmath>
14+
#include <complex>
1315
#if __cplusplus >= 201907L
1416
#include <concepts>
1517
#endif // __cplusplus >= 201907L
@@ -45,6 +47,7 @@
4547
#include <assert.h>
4648
#include <byteswap.h>
4749
#include <cdefs.h>
50+
#include <complex.h>
4851
#include <ctype.h>
4952
#include <errno.h>
5053
#include <fenv.h>

src/libcxx/include/__config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
#define _EZCXX_NODEBUG __attribute__((__nodebug__))
1515
#define _EZCXX_TEMPLATE_VIS __attribute__ ((__type_visibility__("default")))
1616
#define _EZCXX_LIFETIMEBOUND [[_Clang::__lifetimebound__]]
17+
#define _EZCXX_INLINE_VISIBILITY _EZCXX_HIDE_FROM_ABI
1718

1819
#endif // _EZCXX_CONFIG

src/libcxx/include/ccomplex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// -*- C++ -*-
2+
#ifndef _EZCXX_CCOMPLEX
3+
#define _EZCXX_CCOMPLEX
4+
5+
#include <complex>
6+
7+
#pragma clang system_header
8+
9+
#endif // _EZCXX_CCOMPLEX

0 commit comments

Comments
 (0)