Remove/change bad prototypes
authorGodzil <godzil@godzil.net>
Fri, 17 May 2013 00:08:39 +0000 (02:08 +0200)
committerManoël Trapier <godzil@MacBook-Pro.home>
Wed, 24 Jun 2015 22:41:49 +0000 (23:41 +0100)
In modules/system/time, a bad prototype for "time" was left. There is too some problem with filno under OpenBSD. Currently, the only known OS that don't want to export fileno with c89/c99 standard, is linux, so #ifdef/#endif the prototypes only for linux. (OpenBSD seems to define them as MACROs, that led to errors)

modules/src/system/time.c
util/cgg/bootlex.l
util/ncgg/scan.l
util/opt/mktab.y

index e06a9fa..7c31527 100644 (file)
@@ -4,12 +4,10 @@
  */
 /* $Id$ */
 
+#include <time.h>
 #include "system.h"
 
-long time();
-
-long
-sys_time()
+long sys_time()
 {
        return time((long *) 0);
 }
index 2614676..a9fc80d 100644 (file)
@@ -19,7 +19,9 @@
 #include "y.tab.h"
 
 /* fileno is not C89 and can be missing sometimes. */
+#ifdef __LINUX__
 int fileno(FILE *stream);
+#endif
 
 int lineno = 1;
 extern char *iname;
index 7e56c15..9ea1dbc 100644 (file)
@@ -12,7 +12,9 @@
 
 
 /* fileno is not C89 and can be missing sometimes. */
+#ifdef __LINUX__
 int fileno(FILE *stream);
+#endif
 
 int lineno=1;
 extern char *filename;
index 027cbac..8c33fe4 100644 (file)
@@ -34,7 +34,9 @@ int   nerrors=0;
 char   patid[128];
 
 /* fileno is not C89 and can be missing sometimes. */
+#ifdef __LINUX__
 int fileno(FILE *stream);
+#endif
 
 int CBO_instrs[] = {
        op_adi,