-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
389c98e
commit f9acba8
Showing
56 changed files
with
2,357 additions
and
610 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,60 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020 Vladimir Makarov <vmakarov.gcc@gmail.com>. | ||
*/ | ||
|
||
/* See C11 5.2.4.2.2 */ | ||
static char float_str[] | ||
= "#ifndef __FLOAT_H\n" | ||
"#define __FLOAT_H\n" | ||
"\n" | ||
"#define FLT_RADIX 2\n" | ||
"\n" | ||
"#define FLT_MANT_DIG 24\n" | ||
"#define DBL_MANT_DIG 53\n" | ||
"#define LDBL_MANT_DIG DBL_MANT_DIG\n" | ||
"\n" | ||
"#define FLT_DECIMAL_DIG 9\n" | ||
"#define DBL_DECIMAL_DIG 17\n" | ||
"#define LDBL_DECIMAL_DIG DBL_DECIMAL_DIG\n" | ||
"#define FLT_DIG FLT_DECIMAL_DIG\n" | ||
"#define DBL_DIG DBL_DECIMAL_DIG\n" | ||
"#define LDBL_DIG LDBL_DECIMAL_DIG\n" | ||
"\n" | ||
"#define DECIMAL_DIG LDBL_DECIMAL_DIG\n" | ||
"\n" | ||
"#define FLT_MIN_EXP -125\n" | ||
"#define DBL_MIN_EXP -1021\n" | ||
"#define LDBL_MIN_EXP DBL_MIN_EXP\n" | ||
"\n" | ||
"#define FLT_MIN_10_EXP -37\n" | ||
"#define DBL_MIN_10_EXP -307\n" | ||
"#define LDBL_MIN_10_EXP DBL_MIN_10_EXP\n" | ||
"\n" | ||
"#define FLT_MAX_EXP 128\n" | ||
"#define DBL_MAX_EXP 1024\n" | ||
"#define LDBL_MAX_EXP DBL_MAX_EXP\n" | ||
"\n" | ||
"#define FLT_MAX_10_EXP 38\n" | ||
"#define DBL_MAX_10_EXP 308\n" | ||
"#define LDBL_MAX_10_EXP DBL_MAX_10_EXP\n" | ||
"\n" | ||
"#define FLT_MAX 0x1.fffffep+127\n" | ||
"#define DBL_MAX 0x1.fffffffffffffp+1023\n" | ||
"#define LDBL_MAX DBL_MAX\n" | ||
"\n" | ||
"#define FLT_EPSILON 0x1p-23\n" | ||
"#define DBL_EPSILON 0x1p-52\n" | ||
"#define LDBL_EPSILON DBL_EPSILON\n" | ||
"\n" | ||
"#define FLT_MIN 0x1p-126\n" | ||
"#define DBL_MIN 0x1p-1022\n" | ||
"#define LDBL_MIN DBL_MIN\n" | ||
"\n" | ||
"#define FLT_TRUE_MIN 0x1p-149\n" | ||
"#define DBL_TRUE_MIN 0x0.0000000000001p-1022\n" | ||
"#define LDBL_TRUE_MIN DBL_TRUE_MIN\n" | ||
"\n" | ||
"#define FLT_EVAL_METHOD 0\n" | ||
"#define FLT_ROUNDS 1 /* round to the nearest */\n" | ||
"\n" | ||
"#endif /* #ifndef __FLOAT_H */\n"; |
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,38 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020 Vladimir Makarov <vmakarov.gcc@gmail.com>. | ||
*/ | ||
|
||
/* See 5.2.4.2 */ | ||
static char limits_str[] | ||
= "#ifndef __LIMITS_H\n" | ||
"#define __LIMITS_H\n" | ||
"\n" | ||
"#define CHAR_BIT 8\n" | ||
"\n" | ||
"#define SCHAR_MIN (-SCHAR_MAX - 1)\n" | ||
"#define SCHAR_MAX 127\n" | ||
"#define UCHAR_MAX (SCHAR_MAX * 2 + 1)\n" | ||
"\n" | ||
"#define MB_LEN_MAX 1\n" | ||
"\n" | ||
"#define SHRT_MIN (-SHRT_MAX - 1)\n" | ||
"#define SHRT_MAX 32767\n" | ||
"#define USHRT_MAX (SHRT_MAX * 2 + 1)\n" | ||
"\n" | ||
"#define INT_MIN (-INT_MAX - 1)\n" | ||
"#define INT_MAX 2147483647\n" | ||
"#define UINT_MAX (INT_MAX * 2u + 1u)\n" | ||
"\n" | ||
"#define LONG_MIN (-LONG_MAX - 1l)\n" | ||
"#define LONG_MAX 9223372036854775807l\n" | ||
"#define ULONG_MAX (LONG_MAX * 2ul + 1ul)\n" | ||
"\n" | ||
"#define LLONG_MIN LONG_MIN\n" | ||
"#define LLONG_MAX LONG_MAX\n" | ||
"#define ULLONG_MAX ULONG_MAX\n" | ||
"\n" | ||
"/* signed char by default */\n" | ||
"#define CHAR_MIN SCHAR_MIN\n" | ||
"#define CHAR_MAX SCHAR_MAX\n" | ||
"\n" | ||
"#endif /* #ifndef __LIMITS_H */\n"; |
File renamed without changes.
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,27 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020 Vladimir Makarov <vmakarov.gcc@gmail.com>. | ||
*/ | ||
|
||
static char stdarg_str[] | ||
= "#ifndef __STDARG_H\n" | ||
"#define __STDARG_H\n" | ||
"\n" | ||
"typedef struct {\n" | ||
" void *__stack;\n" | ||
" void *__gr_top;\n" | ||
" void *__vr_top;\n" | ||
" int __gr_offs;\n" | ||
" int __vr_offs;\n" | ||
"} va_list;\n" | ||
"\n" | ||
"#define va_start(ap, param) __builtin_va_start (ap)\n" | ||
"#define va_arg(ap, type) __builtin_va_arg(ap, (type *) 0)\n" | ||
"#define va_end(ap) 0\n" | ||
"#define va_copy(dest, src) ((dest)[0] = (src)[0])\n" | ||
"\n" | ||
"/* For standard headers of a GNU system: */\n" | ||
"#ifndef __GNUC_VA_LIST\n" | ||
"#define __GNUC_VA_LIST 1\n" | ||
"#endif\n" | ||
"typedef va_list __gnuc_va_list;\n" | ||
"#endif /* #ifndef __STDARG_H */\n"; |
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,19 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020 Vladimir Makarov <vmakarov.gcc@gmail.com>. | ||
*/ | ||
|
||
/* See C11 7.19 */ | ||
static char stddef_str[] | ||
= "#ifndef __STDDEF_H\n" | ||
"#define __STDDEF_H\n" | ||
"\n" | ||
"typedef long ptrdiff_t;\n" | ||
"typedef unsigned long size_t;\n" | ||
"typedef long double max_align_t;\n" | ||
"typedef unsigned int wchar_t;\n" | ||
"\n" | ||
"#define NULL ((void *) 0)\n" | ||
"\n" | ||
"#define offsetof(type, member_designator) ((size_t) & ((type *) 0)->member_designator)\n" | ||
"\n" | ||
"#endif /* #ifndef __STDDEF_H */\n"; |
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,130 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020 Vladimir Makarov <vmakarov.gcc@gmail.com>. | ||
*/ | ||
|
||
/* See C11 7.20 */ | ||
static char stdint_str[] | ||
= "#ifndef _STDINT_H\n" | ||
"#define _STDINT_H 1\n" | ||
"\n" | ||
"#ifndef __int8_t_defined\n" | ||
"#define __int8_t_defined\n" | ||
"typedef signed char int8_t;\n" | ||
"#endif\n" | ||
"typedef short int int16_t;\n" | ||
"typedef int int32_t;\n" | ||
"typedef long int int64_t;\n" | ||
"\n" | ||
"typedef unsigned char uint8_t;\n" | ||
"typedef unsigned short int uint16_t;\n" | ||
"typedef unsigned int uint32_t;\n" | ||
"typedef unsigned long int uint64_t;\n" | ||
"\n" | ||
"typedef signed char int_least8_t;\n" | ||
"typedef short int int_least16_t;\n" | ||
"typedef int int_least32_t;\n" | ||
"typedef long int int_least64_t;\n" | ||
"\n" | ||
"typedef unsigned char uint_least8_t;\n" | ||
"typedef unsigned short int uint_least16_t;\n" | ||
"typedef unsigned int uint_least32_t;\n" | ||
"typedef unsigned long int uint_least64_t;\n" | ||
"\n" | ||
"typedef signed char int_fast8_t;\n" | ||
"typedef long int int_fast16_t;\n" | ||
"typedef long int int_fast32_t;\n" | ||
"typedef long int int_fast64_t;\n" | ||
"\n" | ||
"typedef unsigned char uint_fast8_t;\n" | ||
"typedef unsigned long int uint_fast16_t;\n" | ||
"typedef unsigned long int uint_fast32_t;\n" | ||
"typedef unsigned long int uint_fast64_t;\n" | ||
"\n" | ||
"#define __intptr_t_defined\n" | ||
"typedef long int intptr_t;\n" | ||
"typedef unsigned long int uintptr_t;\n" | ||
"\n" | ||
"typedef long int intmax_t;\n" | ||
"typedef unsigned long int uintmax_t;\n" | ||
"\n" | ||
"#define __INT64_C(c) c##L\n" | ||
"#define __UINT64_C(c) c##UL\n" | ||
"\n" | ||
"#define INT8_MIN (-128)\n" | ||
"#define INT16_MIN (-32768)\n" | ||
"#define INT32_MIN (-2147483648)\n" | ||
"#define INT64_MIN (-9223372036854775808l)\n" | ||
"\n" | ||
"#define INT8_MAX (127)\n" | ||
"#define INT16_MAX (32767)\n" | ||
"#define INT32_MAX (2147483647)\n" | ||
"#define INT64_MAX (9223372036854775807l)\n" | ||
"\n" | ||
"#define UINT8_MAX (255)\n" | ||
"#define UINT16_MAX (65535)\n" | ||
"#define UINT32_MAX (4294967295u)\n" | ||
"#define UINT64_MAX (18446744073709551615ul)\n" | ||
"\n" | ||
"#define INT_LEAST8_MIN (-128)\n" | ||
"#define INT_LEAST16_MIN (-32768)\n" | ||
"#define INT_LEAST32_MIN (-2147483648)\n" | ||
"#define INT_LEAST64_MIN (-9223372036854775808L)\n" | ||
"\n" | ||
"#define INT_LEAST8_MAX (127)\n" | ||
"#define INT_LEAST16_MAX (32767)\n" | ||
"#define INT_LEAST32_MAX (2147483647)\n" | ||
"#define INT_LEAST64_MAX (9223372036854775807L)\n" | ||
"\n" | ||
"#define UINT_LEAST8_MAX (255)\n" | ||
"#define UINT_LEAST16_MAX (65535)\n" | ||
"#define UINT_LEAST32_MAX (4294967295U)\n" | ||
"#define UINT_LEAST64_MAX (18446744073709551615UL)\n" | ||
"\n" | ||
"#define INT_FAST8_MIN (-128)\n" | ||
"#define INT_FAST16_MIN (-9223372036854775808L)\n" | ||
"#define INT_FAST32_MIN (-9223372036854775808L)\n" | ||
"#define INT_FAST64_MIN (-9223372036854775808L)\n" | ||
"\n" | ||
"#define INT_FAST8_MAX (127)\n" | ||
"#define INT_FAST16_MAX (9223372036854775807L)\n" | ||
"#define INT_FAST32_MAX (9223372036854775807L)\n" | ||
"#define INT_FAST64_MAX (9223372036854775807L)\n" | ||
"\n" | ||
"#define UINT_FAST8_MAX (255)\n" | ||
"#define UINT_FAST16_MAX (18446744073709551615UL)\n" | ||
"#define UINT_FAST32_MAX (18446744073709551615UL)\n" | ||
"#define UINT_FAST64_MAX (18446744073709551615UL)\n" | ||
"\n" | ||
"#define INTPTR_MIN (-9223372036854775808L)\n" | ||
"#define INTPTR_MAX (9223372036854775807L)\n" | ||
"#define UINTPTR_MAX (18446744073709551615UL)\n" | ||
"\n" | ||
"#define INTMAX_MIN (-9223372036854775808L)\n" | ||
"#define INTMAX_MAX (9223372036854775807L)\n" | ||
"#define UINTMAX_MAX (18446744073709551615UL)\n" | ||
"\n" | ||
"#define PTRDIFF_MIN (-9223372036854775808L)\n" | ||
"#define PTRDIFF_MAX (9223372036854775807L)\n" | ||
"\n" | ||
"#define SIZE_MAX (18446744073709551615UL)\n" | ||
"\n" | ||
"/* For signed wchar_t and wint_t: */\n" | ||
"#define WCHAR_MIN INT32_MIN\n" | ||
"#define WCHAR_MAX INT32_MAX\n" | ||
"#define WINT_MIN WCHAR_MIN\n" | ||
"#define WINT_MAX WCHAR_MAX\n" | ||
"\n" | ||
"#define INT8_C(value) value\n" | ||
"#define INT16_C(value) value\n" | ||
"#define INT32_C(value) value\n" | ||
"#define INT64_C(value) value##L\n" | ||
"\n" | ||
"#define UINT8_C(value) value\n" | ||
"#define UINT16_C(value) value\n" | ||
"#define UINT32_C(value) value##U\n" | ||
"#define UINT64_C(value) value##UL\n" | ||
"\n" | ||
"#define INTMAX_C(value) value##L\n" | ||
"#define UINTMAX_C(value) value##UL\n" | ||
"\n" | ||
"#endif /* #ifndef _STDINT_H */\n"; |
Oops, something went wrong.