Skip to content

Commit 491d2f1

Browse files
committed
reorganized libcxx headers and replaced __abs_overloads and __cmath_type_traits to improve maintainability
1 parent 1533db4 commit 491d2f1

11 files changed

Lines changed: 967 additions & 1021 deletions

File tree

src/libc/include/__math_def.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,9 @@ double expm1(double);
139139
float expm1f(float);
140140
long double expm1l(long double);
141141

142-
#ifndef _ABS_FLOAT_DEFINED
143-
#define _ABS_FLOAT_DEFINED
144142
double fabs(double);
145143
float fabsf(float);
146144
long double fabsl(long double);
147-
#endif /* _ABS_FLOAT_DEFINED */
148145

149146
double fdim(double, double);
150147
float fdimf(float, float);

src/libc/include/math.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
#ifndef _MATH_H
22
#define _MATH_H
33

4-
#ifdef __cplusplus
5-
6-
#include <cmath>
7-
8-
#else /* __cplusplus */
9-
104
#include <__math_def.h>
115

6+
#ifndef __cplusplus
7+
128
static inline __attribute__((__always_inline__))
139
bool __signbitf(float __x) {
1410
if (__builtin_constant_p(__x)) {

src/libc/include/stdio.h

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -133,49 +133,4 @@ void perror(const char *str);
133133

134134
__END_DECLS
135135

136-
#ifdef __cplusplus
137-
namespace std {
138-
using ::size_t;
139-
using ::FILE;
140-
141-
using ::fopen;
142-
using ::freopen;
143-
using ::fclose;
144-
using ::fflush;
145-
using ::ferror;
146-
using ::feof;
147-
using ::clearerr;
148-
using ::fread;
149-
using ::fwrite;
150-
using ::ftell;
151-
using ::fseek;
152-
using ::rewind;
153-
using ::fgetc;
154-
using ::fgets;
155-
using ::ungetc;
156-
using ::fputc;
157-
using ::fputs;
158-
using ::remove;
159-
using ::rename;
160-
using ::getchar;
161-
using ::putchar;
162-
using ::puts;
163-
using ::getc;
164-
using ::putc;
165-
using ::printf;
166-
using ::vprintf;
167-
using ::sprintf;
168-
using ::vsprintf;
169-
using ::snprintf;
170-
using ::vsnprintf;
171-
using ::fprintf;
172-
using ::vfprintf;
173-
using ::asprintf;
174-
using ::vasprintf;
175-
using ::sscanf;
176-
using ::vsscanf;
177-
using ::perror;
178-
} /* namespace std */
179-
#endif /* __cplusplus */
180-
181136
#endif /* _STDIO_H */

src/libc/include/stdlib.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ void quick_exit(int) __NOEXCEPT __attribute__((noreturn));
104104

105105
void _Exit(int) __NOEXCEPT __attribute__((noreturn));
106106

107-
#ifndef _ABS_INT_DEFINED
108-
#define _ABS_INT_DEFINED
109-
110107
int abs(int n);
111108
long labs(long n);
112109
long long llabs(long long n);
@@ -115,8 +112,6 @@ long long llabs(long long n);
115112
signed __int48 i48abs(signed __int48 n) __NOEXCEPT_CONST;
116113
#endif /* __SIZEOF_INT48__ */
117114

118-
#endif /* _ABS_INT_DEFINED */
119-
120115
div_t div(int numer, int denom);
121116

122117
ldiv_t ldiv(long numer, long denom);

src/libcxx/include/__abs_overloads

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/libcxx/include/__cmath_type_traits

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)