From 60c3831e53b7afa5dd372601250e7e8739329383 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Wed, 12 Aug 2020 12:52:58 -0400 Subject: move more stuff out of nonstd/ --- src/__PREDEFINED_MACROS__/__DATE__.c | 12 ++++++++++++ src/__PREDEFINED_MACROS__/__FILE__.c | 14 ++++++++++++++ src/__PREDEFINED_MACROS__/__LINE__.c | 14 ++++++++++++++ src/__PREDEFINED_MACROS__/__STDC_HOSTED__.c | 10 ++++++++++ src/__PREDEFINED_MACROS__/__STDC_IEC_559_COMPLEX__.c | 10 ++++++++++ src/__PREDEFINED_MACROS__/__STDC_IEC_559__.c | 10 ++++++++++ src/__PREDEFINED_MACROS__/__STDC_ISO_10646__.c | 13 +++++++++++++ src/__PREDEFINED_MACROS__/__STDC_VERSION__.c | 13 +++++++++++++ src/__PREDEFINED_MACROS__/__STDC__.c | 14 ++++++++++++++ src/__PREDEFINED_MACROS__/__TIME__.c | 12 ++++++++++++ 10 files changed, 122 insertions(+) create mode 100644 src/__PREDEFINED_MACROS__/__DATE__.c create mode 100644 src/__PREDEFINED_MACROS__/__FILE__.c create mode 100644 src/__PREDEFINED_MACROS__/__LINE__.c create mode 100644 src/__PREDEFINED_MACROS__/__STDC_HOSTED__.c create mode 100644 src/__PREDEFINED_MACROS__/__STDC_IEC_559_COMPLEX__.c create mode 100644 src/__PREDEFINED_MACROS__/__STDC_IEC_559__.c create mode 100644 src/__PREDEFINED_MACROS__/__STDC_ISO_10646__.c create mode 100644 src/__PREDEFINED_MACROS__/__STDC_VERSION__.c create mode 100644 src/__PREDEFINED_MACROS__/__STDC__.c create mode 100644 src/__PREDEFINED_MACROS__/__TIME__.c (limited to 'src/__PREDEFINED_MACROS__') diff --git a/src/__PREDEFINED_MACROS__/__DATE__.c b/src/__PREDEFINED_MACROS__/__DATE__.c new file mode 100644 index 00000000..14e40fcb --- /dev/null +++ b/src/__PREDEFINED_MACROS__/__DATE__.c @@ -0,0 +1,12 @@ +#define __DATE__ /** date of compilation **/ + +/*** +is automatically defined by the compiler as the date of program +compilation, in the format DEFINITION("Mmm dd yyyy"). +***/ + +/* +VALUE_TYPE(string literal) +VALUE_FIXED(VAR("date-of-compilation")) +STDC(1) +*/ diff --git a/src/__PREDEFINED_MACROS__/__FILE__.c b/src/__PREDEFINED_MACROS__/__FILE__.c new file mode 100644 index 00000000..257ae89b --- /dev/null +++ b/src/__PREDEFINED_MACROS__/__FILE__.c @@ -0,0 +1,14 @@ +#define __FILE__ /** source file name **/ + +/*** +is automatically defined by the compiler as the file name of the +current source file being compiled as a character string literal. + +THIS() can be changed using PPDIR(line). +***/ + +/* +VALUE_TYPE(string literal) +VALUE_FIXED(VAR(the current file name)) +STDC(1) +*/ diff --git a/src/__PREDEFINED_MACROS__/__LINE__.c b/src/__PREDEFINED_MACROS__/__LINE__.c new file mode 100644 index 00000000..c6acb1b1 --- /dev/null +++ b/src/__PREDEFINED_MACROS__/__LINE__.c @@ -0,0 +1,14 @@ +#define __LINE__ /** source file line number **/ + +/*** +is automatically defined by the compiler as the current logical source +line in the source file being compiled. + +THIS() can be changed during compilation using PPDIR(line). +***/ + +/* +VALUE_TYPE(TYPE(int)) +VALUE_FIXED(VAR(the current line number)) +STDC(1) +*/ diff --git a/src/__PREDEFINED_MACROS__/__STDC_HOSTED__.c b/src/__PREDEFINED_MACROS__/__STDC_HOSTED__.c new file mode 100644 index 00000000..48fe28b7 --- /dev/null +++ b/src/__PREDEFINED_MACROS__/__STDC_HOSTED__.c @@ -0,0 +1,10 @@ +#define __STDC_HOSTED__ /** hosted or free-standing implementation **/ + +/*** +is defined to the integer constant CONST(1) if the implementation +is hosted, CONST(0) otherwise. +***/ + +/* +STDC(199901) +*/ diff --git a/src/__PREDEFINED_MACROS__/__STDC_IEC_559_COMPLEX__.c b/src/__PREDEFINED_MACROS__/__STDC_IEC_559_COMPLEX__.c new file mode 100644 index 00000000..a8d1f810 --- /dev/null +++ b/src/__PREDEFINED_MACROS__/__STDC_IEC_559_COMPLEX__.c @@ -0,0 +1,10 @@ +#define __STDC_IEC_559_COMPLEX__ /** IEC 60559 complex arithmetic **/ + +/*** +is defined to CONST(1) if the implementation conforms to Annex G +of ISO/IEC 9899 (IEC 60559 complex arithmetic). +***/ + +/* +STDC(199901) +*/ diff --git a/src/__PREDEFINED_MACROS__/__STDC_IEC_559__.c b/src/__PREDEFINED_MACROS__/__STDC_IEC_559__.c new file mode 100644 index 00000000..bdc441c4 --- /dev/null +++ b/src/__PREDEFINED_MACROS__/__STDC_IEC_559__.c @@ -0,0 +1,10 @@ +#define __STDC_IEC_559__ /** IEC 60559 floating-point arithmetic **/ + +/*** +is defined to CONST(1) if the implementation conforms to Annex G +of ISO/IEC 9899 (IEC 60559 floating-point arithmetic). +***/ + +/* +STDC(199901) +*/ diff --git a/src/__PREDEFINED_MACROS__/__STDC_ISO_10646__.c b/src/__PREDEFINED_MACROS__/__STDC_ISO_10646__.c new file mode 100644 index 00000000..3379c855 --- /dev/null +++ b/src/__PREDEFINED_MACROS__/__STDC_ISO_10646__.c @@ -0,0 +1,13 @@ +#define __STDC_ISO_10646__ /** supported UCS version **/ + +/*** +is defined if TYPE(wchar_t) represents characters encoded +in conformance with ISO/IEC 10646. In this case, THIS() is +defined as an integer CONST(yyyymmL), where CONST(yyyy) +represents the year and CONST(mm) the month of the supported +version of ISO/IEC 10646. +***/ + +/* +STDC(199901) +*/ diff --git a/src/__PREDEFINED_MACROS__/__STDC_VERSION__.c b/src/__PREDEFINED_MACROS__/__STDC_VERSION__.c new file mode 100644 index 00000000..56a23d90 --- /dev/null +++ b/src/__PREDEFINED_MACROS__/__STDC_VERSION__.c @@ -0,0 +1,13 @@ +#define __STDC_VERSION__ /** supported C standard **/ + +/*** +declares the supported version of ISO/IEC 9899. If THIS() is not defined, +the implementation only supports ISO/IEC 9899:1990, without AMD1. +***/ + +/* +VALUE_SELECT(`199409L', `ISO/IEC 9899:1990 AMD1') +VALUE_SELECT(`199901L', `ISO/IEC 9899:1999') +VALUE_SELECT(`201112L', `ISO/IEC 9899:2011') +STDC(199409) +*/ diff --git a/src/__PREDEFINED_MACROS__/__STDC__.c b/src/__PREDEFINED_MACROS__/__STDC__.c new file mode 100644 index 00000000..5bcfe7aa --- /dev/null +++ b/src/__PREDEFINED_MACROS__/__STDC__.c @@ -0,0 +1,14 @@ +#define __STDC__ (1) + +/** standard C support **/ + +/*** +is automatically defined by the compiler to indicate that it supports +some version of ISO/IEC 9899. +***/ + +/* +VALUE_TYPE(TYPE(int)) +VALUE_FIXED(1) +STDC(1) +*/ diff --git a/src/__PREDEFINED_MACROS__/__TIME__.c b/src/__PREDEFINED_MACROS__/__TIME__.c new file mode 100644 index 00000000..472e42c0 --- /dev/null +++ b/src/__PREDEFINED_MACROS__/__TIME__.c @@ -0,0 +1,12 @@ +#define __TIME__ /** time of compilation **/ + +/*** +is automatically defined by the compiler as the time of compilation +in the format DEFINITION("hh:mm:ss"). +***/ + +/* +VALUE_TYPE(string literal) +VALUE_FIXED(VAR("time of compilation")) +STDC(1) +*/ -- cgit v1.2.1