shithub: trueawk

Download patch

ref: 93e5dd87a1fc9782b877d41efa6222f55a0e4167
parent: c3d8f9c50011b7e8e19449b0712e700c0aeb8543
author: Arnold D. Robbins <arnold@skeeve.com>
date: Thu Apr 16 16:56:49 EDT 2020

Fix noreturn for old compilers.

--- a/FIXES
+++ b/FIXES
@@ -25,6 +25,10 @@
 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 <stdnoreturn.h> and noreturn instead of GCC attributes.
 	Thanks to GitHub user awkfan77. Closes PR #77.
--- a/awk.h
+++ b/awk.h
@@ -25,7 +25,11 @@
 #include <assert.h>
 #include <stdint.h>
 #include <stdbool.h>
+#if __STDC__ <= 199901L
+#define noreturn
+#else
 #include <stdnoreturn.h>
+#endif
 
 typedef double	Awkfloat;
 
--- a/main.c
+++ b/main.c
@@ -22,7 +22,7 @@
 THIS SOFTWARE.
 ****************************************************************/
 
-const char	*version = "version 20200405";
+const char	*version = "version 20200416";
 
 #define DEBUG
 #include <stdio.h>
--