From c169ae9b4a282ef7bd63025d57768c661a4b9b28 Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 20 May 2005 14:14:15 +0000 Subject: [PATCH] IRIX compatibility (yuck!) --- CHANGES | 1 + io/io_passfd.c | 1 + io/io_receivefd.c | 1 + scan/scan_httpdate.c | 12 ++++++++++++ trysendfile.c | 4 ++++ 5 files changed, 19 insertions(+) diff --git a/CHANGES b/CHANGES index 56e8381..f747590 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,7 @@ but TCP? never heard of it") remove even more warnings 64-bit cleanliness issue with auto-NULL-appending macros + IRIX compatibility (yuck!) 0.22: uh, the scope_id detection #defined the wrong constant. libowfat diff --git a/io/io_passfd.c b/io/io_passfd.c index fcfa99c..a336dd3 100644 --- a/io/io_passfd.c +++ b/io/io_passfd.c @@ -7,6 +7,7 @@ int io_passfd(int64 sock,int64 fd) { } #else +#define _XOPEN_SOURCE #include #include #include diff --git a/io/io_receivefd.c b/io/io_receivefd.c index dcc1605..5e7c165 100644 --- a/io/io_receivefd.c +++ b/io/io_receivefd.c @@ -7,6 +7,7 @@ int64 io_receivefd(int64 sock) { } #else +#define _XOPEN_SOURCE #include #include #include diff --git a/scan/scan_httpdate.c b/scan/scan_httpdate.c index 1857740..d4e915c 100644 --- a/scan/scan_httpdate.c +++ b/scan/scan_httpdate.c @@ -6,6 +6,10 @@ #include #include +#ifdef sgi +extern char** environ; +#endif + static int parsetime(const char*c,struct tm* x) { unsigned long tmp; c+=scan_ulong(c,&tmp); x->tm_hour=tmp; @@ -61,10 +65,18 @@ done: *t=timegm(&x); #else { +#ifdef sgi + char** old=environ; + char** newenv={0}; + environ=newenv; + *t=mktime(&x); + environ=old; +#else char* old=getenv("TZ"); unsetenv("TZ"); *t=mktime(&x); if (old) setenv("TZ",old,1); +#endif } #endif return c-in; diff --git a/trysendfile.c b/trysendfile.c index 7e26726..e8555d5 100644 --- a/trysendfile.c +++ b/trysendfile.c @@ -81,4 +81,8 @@ int main() { #else #error unsupported architecture +/* stupid fucking IRIX c99 does not signal #error via a non-zero exit + * code! ARGH! So insert a parse error */ +#include rumpelstilzchen +) #endif