From: Godzil Date: Fri, 17 May 2013 00:08:39 +0000 (+0200) Subject: Remove/change bad prototypes X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=9da790283e79f2fe03eb37742756eee2040a178e;p=ack.git Remove/change bad prototypes 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) --- diff --git a/modules/src/system/time.c b/modules/src/system/time.c index e06a9fa00..7c315270e 100644 --- a/modules/src/system/time.c +++ b/modules/src/system/time.c @@ -4,12 +4,10 @@ */ /* $Id$ */ +#include #include "system.h" -long time(); - -long -sys_time() +long sys_time() { return time((long *) 0); } diff --git a/util/cgg/bootlex.l b/util/cgg/bootlex.l index 261467664..a9fc80dbb 100644 --- a/util/cgg/bootlex.l +++ b/util/cgg/bootlex.l @@ -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; diff --git a/util/ncgg/scan.l b/util/ncgg/scan.l index 7e56c15e6..9ea1dbcdd 100644 --- a/util/ncgg/scan.l +++ b/util/ncgg/scan.l @@ -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; diff --git a/util/opt/mktab.y b/util/opt/mktab.y index 027cbac6c..8c33fe49a 100644 --- a/util/opt/mktab.y +++ b/util/opt/mktab.y @@ -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,