From 93e5dd87a1fc9782b877d41efa6222f55a0e4167 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 16 Apr 2020 20:56:49 +0300 Subject: [PATCH] Fix noreturn for old compilers. --- FIXES | 4 ++++ awk.h | 4 ++++ main.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/FIXES b/FIXES index e96cf33..509f4ac 100644 --- a/FIXES +++ b/FIXES @@ -25,6 +25,10 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +April 16, 2020: + Handle old compilers that don't support C11 (for noreturn). + Thanks to Arnold Robbins. + April 5, 2020: Use and noreturn instead of GCC attributes. Thanks to GitHub user awkfan77. Closes PR #77. diff --git a/awk.h b/awk.h index 4e01325..36a4286 100644 --- a/awk.h +++ b/awk.h @@ -25,7 +25,11 @@ THIS SOFTWARE. #include #include #include +#if __STDC__ <= 199901L +#define noreturn +#else #include +#endif typedef double Awkfloat; diff --git a/main.c b/main.c index ce0a412..6b1ed56 100644 --- a/main.c +++ b/main.c @@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20200405"; +const char *version = "version 20200416"; #define DEBUG #include