aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/info/chap/introduction.texinfo10
-rw-r--r--include/slibc/c-version.h17
2 files changed, 26 insertions, 1 deletions
diff --git a/doc/info/chap/introduction.texinfo b/doc/info/chap/introduction.texinfo
index 21982f6..2f3c2f5 100644
--- a/doc/info/chap/introduction.texinfo
+++ b/doc/info/chap/introduction.texinfo
@@ -257,14 +257,22 @@ defines for header files and functions are disabled.
macros defined by other projects.
@table @code
-@item _ISOC90_SOURCE
+@item _ISOC89_SOURCE
+@itemx _ISOC90_SOURCE
@cpindex @sc{ISO}@tie{}C
@cpindex C90
+@cpindex C89
+@cpindex @sc{ANSI}@tie{}C
@lvindex _ISOC90_SOURCE
+@lvindex _ISOC89_SOURCE
Enables functionality from the @sc{ISO}@tie{}C90
standard, even if the program is not compiled
with C90.
+Note, @sc{ISO}@tie{}C89, @sc{ISO}@tie{}C90,
+@sc{ANSI}@tie{}C and Standard C, all refer to
+the same standard.
+
@item _ISOC99_SOURCE
@cpindex @sc{ISO}@tie{}C
@cpindex C99
diff --git a/include/slibc/c-version.h b/include/slibc/c-version.h
index 635ddb4..0cd5c3e 100644
--- a/include/slibc/c-version.h
+++ b/include/slibc/c-version.h
@@ -79,3 +79,20 @@
# endif
#endif
+/**
+ * C89, C90, ANSI C and Standard C are all the
+ * same standard.
+ */
+#if defined(__C89__) && !defined(__C90__)
+# define __C90__
+#endif
+#if defined(__C90__) && !defined(__C89__)
+# define __C89__
+#endif
+#if defined(__ISOC89_SOURCE) && !defined(__ISOC90_SOURCE)
+# define __ISOC90_SOURCE
+#endif
+#if defined(__ISOC90_SOURCE) && !defined(__ISOC89_SOURCE)
+# define __ISOC89_SOURCE
+#endif
+