From 4ff56d6c1516181915141c2a10571fd57740db7d Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 20 Feb 2013 21:57:02 -0800 Subject: [PATCH] Changed all internal #ifdef's which were conditional on __linux to be conditional on either __linux or __linux__. Some platforms (PPC) don't define __linux when gcc is invoked with -std=c99. --- AltairZ80/altairz80_defs.h | 2 +- makefile | 2 +- sim_disk.c | 4 ++-- sim_ether.c | 6 +++--- sim_fio.c | 4 ++-- sim_serial.c | 4 ++-- sim_sock.c | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/AltairZ80/altairz80_defs.h b/AltairZ80/altairz80_defs.h index 162fd7c9..ba206717 100644 --- a/AltairZ80/altairz80_defs.h +++ b/AltairZ80/altairz80_defs.h @@ -75,7 +75,7 @@ #define UNIT_CPU_V_SWITCHER (UNIT_V_UF+6) /* switcher 8086 <--> 8080/Z80 enabled */ #define UNIT_CPU_SWITCHER (1 << UNIT_CPU_V_SWITCHER) -#if defined (__linux) || defined(__NetBSD__) || defined (__OpenBSD__) || defined (__FreeBSD__) || defined (__APPLE__) +#if defined (__linux) defined (__linux__) || defined(__NetBSD__) || defined (__OpenBSD__) || defined (__FreeBSD__) || defined (__APPLE__) #define UNIX_PLATFORM 1 #else #define UNIX_PLATFORM 0 diff --git a/makefile b/makefile index 8d440205..b01704e9 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,6 @@ # # This GNU make makefile has been tested on: -# Linux (x86 & Sparc) +# Linux (x86 & Sparc & PPC) # OS X # Solaris (x86 & Sparc) # OpenBSD diff --git a/sim_disk.c b/sim_disk.c index 3ba4a532..c8833c9d 100644 --- a/sim_disk.c +++ b/sim_disk.c @@ -1864,7 +1864,7 @@ _set_errno_from_status (GetLastError ()); return SCPE_IOERR; } -#elif defined (__linux) || defined (__sun__) +#elif defined (__linux) || defined (__linux__) || defined (__sun__) #include #include @@ -3229,7 +3229,7 @@ errno = Status; return hVHD; } -#if defined(__CYGWIN__) || defined(VMS) || defined(__APPLE__) || defined(__linux) +#if defined(__CYGWIN__) || defined(VMS) || defined(__APPLE__) || defined(__linux) || defined(__linux__) #include #endif static void diff --git a/sim_ether.c b/sim_ether.c index 7de8e155..2767ed86 100644 --- a/sim_ether.c +++ b/sim_ether.c @@ -901,7 +901,7 @@ void eth_show_dev (FILE* st, ETH_DEV* dev) #include #ifdef USE_TAP_NETWORK -#if defined(__linux) +#if defined(__linux) || defined(__linux__) #include #include #include @@ -1220,7 +1220,7 @@ int pcap_setfilter(pcap_t* a, struct bpf_program* b) { Return value: 0=Success, -1=Failure */ int pcap_sendpacket(pcap_t* handle, const u_char* msg, int len) { -#if defined (__linux) +#if defined (__linux) || defined (__linux__) return (send(pcap_fileno(handle), msg, len, 0) == len)? 0 : -1; #else return (write(pcap_fileno(handle), msg, len) == len)? 0 : -1; @@ -1728,7 +1728,7 @@ if (0 == strncmp("tap:", savname, 4)) { return SCPE_OPENERR; } #endif -#if defined(__linux) && defined(USE_TAP_NETWORK) +#if (defined(__linux) || defined(__linux__)) && defined(USE_TAP_NETWORK) if ((tun = open("/dev/net/tun", O_RDWR)) >= 0) { struct ifreq ifr; /* Interface Requests */ diff --git a/sim_fio.c b/sim_fio.c index 6448c311..612972b4 100644 --- a/sim_fio.c +++ b/sim_fio.c @@ -219,7 +219,7 @@ FILE *sim_fopen (const char *file, const char *mode) #if defined (VMS) return fopen (file, mode, "ALQ=32", "DEQ=4096", "MBF=6", "MBC=127", "FOP=cbt,tef", "ROP=rah,wbh", "CTX=stm"); -#elif defined (USE_INT64) && defined (USE_ADDR64) && defined (__linux) +#elif defined (USE_INT64) && defined (USE_ADDR64) && (defined (__linux) || defined (__linux__)) return fopen64 (file, mode); #else return fopen (file, mode); @@ -312,7 +312,7 @@ return (t_addr)fileaddr; /* Linux */ -#if defined (__linux) +#if defined (__linux) || defined (__linux__) #define _SIM_IO_FSEEK_EXT_ 1 int sim_fseek (FILE *st, t_addr xpos, int origin) diff --git a/sim_serial.c b/sim_serial.c index 7b13411d..cc861569 100644 --- a/sim_serial.c +++ b/sim_serial.c @@ -861,7 +861,7 @@ return; #elif defined (__unix__) || defined(__APPLE__) -#if defined(__linux__) +#if defined(__linux) || defined(__linux__) #include #include #include @@ -887,7 +887,7 @@ int port; int ports = 0; memset(list, 0, max*sizeof(*list)); -#if defined(__linux__) +#if defined(__linux) || defined(__linux__) if (1) { struct dirent **namelist; struct stat st; diff --git a/sim_sock.c b/sim_sock.c index 7490ef2b..ee9eb32f 100644 --- a/sim_sock.c +++ b/sim_sock.c @@ -777,7 +777,7 @@ return newsock; /* got it! */ SOCKET sim_accept_conn (SOCKET master, char **connectaddr) { int32 sta, err; -#if defined (macintosh) || defined (__linux) || \ +#if defined (macintosh) || defined (__linux) || defined (__linux__) || \ defined (__APPLE__) || defined (__OpenBSD__) || \ defined(__NetBSD__) || defined(__FreeBSD__) socklen_t size;