forked from cppalliance/mrdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
53 changed files
with
3,769 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// Licensed 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 | ||
// | ||
// Copyright (c) 2024 Alan de Freitas ([email protected]) | ||
// | ||
// Official repository: https://github.com/cppalliance/mrdocs | ||
// | ||
|
||
#ifndef MRDOCS_SHARE_HEADERS_LIBC_STUBS_ASSERT_H | ||
#define MRDOCS_SHARE_HEADERS_LIBC_STUBS_ASSERT_H | ||
|
||
#define assert(...) ((void)0) | ||
|
||
#endif // MRDOCS_SHARE_HEADERS_LIBC_STUBS_ASSERT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
// | ||
// Licensed 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 | ||
// | ||
// Copyright (c) 2024 Alan de Freitas ([email protected]) | ||
// | ||
// Official repository: https://github.com/cppalliance/mrdocs | ||
// | ||
|
||
#ifndef MRDOCS_SHARE_HEADERS_LIBC_STUBS_COMPLEX_H | ||
#define MRDOCS_SHARE_HEADERS_LIBC_STUBS_COMPLEX_H | ||
|
||
// Types | ||
#define imaginary _Imaginary | ||
#define complex _Complex | ||
|
||
// Constants | ||
#define _Imaginary_I ((float _Imaginary)1.0) | ||
#define _Complex_I ((float _Complex)1.0) | ||
#define I _Complex_I | ||
|
||
// Manipulation | ||
#define CMPLX(x, y) ((double _Complex)((x) + _Complex_I * (y))) | ||
#define CMPLXF(x, y) ((float _Complex)((x) + _Complex_I * (y))) | ||
#define CMPLXL(x, y) ((long double _Complex)((x) + _Complex_I * (y))) | ||
|
||
double creal(double _Complex z); | ||
float crealf(float _Complex z); | ||
long double creall(long double _Complex z); | ||
|
||
double cimag(double _Complex z); | ||
float cimagf(float _Complex z); | ||
long double cimagl(long double _Complex z); | ||
|
||
double cabs(double _Complex z); | ||
float cabsf(float _Complex z); | ||
long double cabsl(long double _Complex z); | ||
|
||
double carg(double _Complex z); | ||
float cargf(float _Complex z); | ||
long double cargl(long double _Complex z); | ||
|
||
double _Complex conj(double _Complex z); | ||
float _Complex conjf(float _Complex z); | ||
long double _Complex conjl(long double _Complex z); | ||
|
||
double _Complex cproj(double _Complex z); | ||
float _Complex cprojf(float _Complex z); | ||
long double _Complex cprojl(long double _Complex z); | ||
|
||
// Exponential functions | ||
double _Complex cexp(double _Complex z); | ||
float _Complex cexpf(float _Complex z); | ||
long double _Complex cexpl(long double _Complex z); | ||
|
||
double _Complex clog(double _Complex z); | ||
float _Complex clogf(float _Complex z); | ||
long double _Complex clogl(long double _Complex z); | ||
|
||
// Power functions | ||
double _Complex cpow(double _Complex x, double _Complex y); | ||
float _Complex cpowf(float _Complex x, float _Complex y); | ||
long double _Complex cpowl(long double _Complex x, long double _Complex y); | ||
|
||
double _Complex csqrt(double _Complex z); | ||
float _Complex csqrtf(float _Complex z); | ||
long double _Complex csqrtl(long double _Complex z); | ||
|
||
// Trigonometric functions | ||
double _Complex csin(double _Complex z); | ||
float _Complex csinf(float _Complex z); | ||
long double _Complex csinl(long double _Complex z); | ||
|
||
double _Complex ccos(double _Complex z); | ||
float _Complex ccosf(float _Complex z); | ||
long double _Complex ccosl(long double _Complex z); | ||
|
||
double _Complex ctan(double _Complex z); | ||
float _Complex ctanf(float _Complex z); | ||
long double _Complex ctanl(long double _Complex z); | ||
|
||
double _Complex casin(double _Complex z); | ||
float _Complex casinf(float _Complex z); | ||
long double _Complex casinl(long double _Complex z); | ||
|
||
double _Complex cacos(double _Complex z); | ||
float _Complex cacosf(float _Complex z); | ||
long double _Complex cacosl(long double _Complex z); | ||
|
||
double _Complex catan(double _Complex z); | ||
float _Complex catanf(float _Complex z); | ||
long double _Complex catanl(long double _Complex z); | ||
|
||
// Hyperbolic functions | ||
double _Complex csinh(double _Complex z); | ||
float _Complex csinhf(float _Complex z); | ||
long double _Complex csinhl(long double _Complex z); | ||
|
||
double _Complex ccosh(double _Complex z); | ||
float _Complex ccoshf(float _Complex z); | ||
long double _Complex ccoshl(long double _Complex z); | ||
|
||
double _Complex ctanh(double _Complex z); | ||
float _Complex ctanhf(float _Complex z); | ||
long double _Complex ctanhl(long double _Complex z); | ||
|
||
double _Complex casinh(double _Complex z); | ||
float _Complex casinhf(float _Complex z); | ||
long double _Complex casinhl(long double _Complex z); | ||
|
||
double _Complex cacosh(double _Complex z); | ||
float _Complex cacoshf(float _Complex z); | ||
long double _Complex cacoshl(long double _Complex z); | ||
|
||
double _Complex catanh(double _Complex z); | ||
float _Complex catanhf(float _Complex z); | ||
long double _Complex catanhl(long double _Complex z); | ||
|
||
#endif // MRDOCS_SHARE_HEADERS_LIBC_STUBS_COMPLEX_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// Licensed 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 | ||
// | ||
// Copyright (c) 2024 Alan de Freitas ([email protected]) | ||
// | ||
// Official repository: https://github.com/cppalliance/mrdocs | ||
// | ||
|
||
#ifndef MRDOCS_SHARE_HEADERS_LIBC_STUBS_CTYPE_H | ||
#define MRDOCS_SHARE_HEADERS_LIBC_STUBS_CTYPE_H | ||
|
||
// Character classification | ||
int isalnum( int ch ); | ||
int isalpha( int ch ); | ||
int islower( int ch ); | ||
int isupper( int ch ); | ||
int isdigit( int ch ); | ||
int isxdigit( int ch ); | ||
int iscntrl( int ch ); | ||
int isgraph( int ch ); | ||
int isspace( int ch ); | ||
int isblank( int ch ); | ||
int isprint( int ch ); | ||
int ispunct( int ch ); | ||
|
||
// Character manipulation | ||
int tolower( int ch ); | ||
int toupper( int ch ); | ||
|
||
#endif // MRDOCS_SHARE_HEADERS_LIBC_STUBS_CTYPE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Licensed 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 | ||
// | ||
// Copyright (c) 2024 Alan de Freitas ([email protected]) | ||
// | ||
// Official repository: https://github.com/cppalliance/mrdocs | ||
// | ||
|
||
#ifndef MRDOCS_SHARE_HEADERS_LIBC_STUBS_ERRNO_H | ||
#define MRDOCS_SHARE_HEADERS_LIBC_STUBS_ERRNO_H | ||
|
||
#include "stddef.h" | ||
|
||
// Define errno as a thread-local variable | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
// Thread-local storage for errno | ||
extern __thread errno_t __errno; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
// Error codes | ||
#define EDOM 1 | ||
#define ERANGE 2 | ||
#define EILSEQ 3 | ||
|
||
#define errno (__errno) | ||
|
||
#endif // MRDOCS_SHARE_HEADERS_LIBC_STUBS_ERRNO_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// Licensed 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 | ||
// | ||
// Copyright (c) 2024 Alan de Freitas ([email protected]) | ||
// | ||
// Official repository: https://github.com/cppalliance/mrdocs | ||
// | ||
|
||
#ifndef MRDOCS_SHARE_HEADERS_LIBC_STUBS_FENV_H | ||
#define MRDOCS_SHARE_HEADERS_LIBC_STUBS_FENV_H | ||
|
||
// Types | ||
typedef struct { | ||
unsigned int __control_word; | ||
unsigned int __status_word; | ||
unsigned int __tag_word; | ||
unsigned int __other_flags; | ||
} fenv_t; | ||
|
||
typedef unsigned int fexcept_t; | ||
|
||
// Functions | ||
int feclearexcept(int excepts); | ||
int fetestexcept(int excepts); | ||
int feraiseexcept(int excepts); | ||
int fegetexceptflag(fexcept_t* flagp, int excepts); | ||
int fesetexceptflag(const fexcept_t* flagp, int excepts); | ||
int fegetround(void); | ||
int fesetround(int round); | ||
int fegetenv(fenv_t* envp); | ||
int fesetenv(const fenv_t* envp); | ||
int feholdexcept(fenv_t* envp); | ||
int feupdateenv(const fenv_t* envp); | ||
|
||
// Macros for floating-point exceptions | ||
#define FE_ALL_EXCEPT 0x3F | ||
#define FE_DIVBYZERO 0x04 | ||
#define FE_INEXACT 0x20 | ||
#define FE_INVALID 0x01 | ||
#define FE_OVERFLOW 0x08 | ||
#define FE_UNDERFLOW 0x10 | ||
|
||
// Macros for floating-point rounding direction | ||
#define FE_DOWNWARD 0x400 | ||
#define FE_TONEAREST 0x000 | ||
#define FE_TOWARDZERO 0xC00 | ||
#define FE_UPWARD 0x800 | ||
|
||
// Default floating-point environment | ||
extern const fenv_t* FE_DFL_ENV; | ||
|
||
#endif // MRDOCS_SHARE_HEADERS_LIBC_STUBS_FENV_H |
Oops, something went wrong.