IRIX compatibility (yuck!)

master
leitner 20 years ago
parent 89761dc11e
commit c169ae9b4a

@ -11,6 +11,7 @@
but TCP? never heard of it") but TCP? never heard of it")
remove even more warnings remove even more warnings
64-bit cleanliness issue with auto-NULL-appending macros 64-bit cleanliness issue with auto-NULL-appending macros
IRIX compatibility (yuck!)
0.22: 0.22:
uh, the scope_id detection #defined the wrong constant. libowfat uh, the scope_id detection #defined the wrong constant. libowfat

@ -7,6 +7,7 @@ int io_passfd(int64 sock,int64 fd) {
} }
#else #else
#define _XOPEN_SOURCE
#include <stddef.h> #include <stddef.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>

@ -7,6 +7,7 @@ int64 io_receivefd(int64 sock) {
} }
#else #else
#define _XOPEN_SOURCE
#include <stddef.h> #include <stddef.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>

@ -6,6 +6,10 @@
#include <time.h> #include <time.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef sgi
extern char** environ;
#endif
static int parsetime(const char*c,struct tm* x) { static int parsetime(const char*c,struct tm* x) {
unsigned long tmp; unsigned long tmp;
c+=scan_ulong(c,&tmp); x->tm_hour=tmp; c+=scan_ulong(c,&tmp); x->tm_hour=tmp;
@ -61,10 +65,18 @@ done:
*t=timegm(&x); *t=timegm(&x);
#else #else
{ {
#ifdef sgi
char** old=environ;
char** newenv={0};
environ=newenv;
*t=mktime(&x);
environ=old;
#else
char* old=getenv("TZ"); char* old=getenv("TZ");
unsetenv("TZ"); unsetenv("TZ");
*t=mktime(&x); *t=mktime(&x);
if (old) setenv("TZ",old,1); if (old) setenv("TZ",old,1);
#endif
} }
#endif #endif
return c-in; return c-in;

@ -81,4 +81,8 @@ int main() {
#else #else
#error unsupported architecture #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 #endif

Loading…
Cancel
Save