From 5d0aa931eb2fe22d99277b0fbf998b4fa18f4231 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Fri, 18 Jan 2008 00:18:35 +0100 Subject: [PATCH] Do not attempt to outguess system headers by (re)defining errno. Recent glibc define error as a cpp macro expanding to a function call. Thus, "extern int errno" should cause a link-time undefined symbol when errno.h is not included. Here it is, and gcc complains with the following cryptic warning: ../../gnushogi/sysdeps.c: In function 'ElapsedTime_FIONREAD': ../../gnushogi/sysdeps.c:97: warning: function declaration isn't a prototype --- gnushogi/sysdeps.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/gnushogi/sysdeps.c b/gnushogi/sysdeps.c index c1e43cf..a8f8bd4 100644 --- a/gnushogi/sysdeps.c +++ b/gnushogi/sysdeps.c @@ -91,7 +91,6 @@ ElapsedTime_FIONREAD(ElapsedTime_mode iop) int nchar; struct timeval tv; - extern int errno; if ((i = ioctl((int) 0, FIONREAD, &nchar))) { @@ -227,9 +226,6 @@ ElapsedTime_FIONREAD(ElapsedTime_mode iop) int nchar; int i; - extern int errno; - - if ((i = ioctl((int) 0, FIONREAD, &nchar))) { perror("FIONREAD"); -- 1.7.0.4