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.

This commit is contained in:
Mark Pizzolato 2013-02-20 21:57:02 -08:00
parent 952f29e205
commit 4ff56d6c15
7 changed files with 12 additions and 12 deletions

View file

@ -75,7 +75,7 @@
#define UNIT_CPU_V_SWITCHER (UNIT_V_UF+6) /* switcher 8086 <--> 8080/Z80 enabled */ #define UNIT_CPU_V_SWITCHER (UNIT_V_UF+6) /* switcher 8086 <--> 8080/Z80 enabled */
#define UNIT_CPU_SWITCHER (1 << UNIT_CPU_V_SWITCHER) #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 #define UNIX_PLATFORM 1
#else #else
#define UNIX_PLATFORM 0 #define UNIX_PLATFORM 0

View file

@ -1,6 +1,6 @@
# #
# This GNU make makefile has been tested on: # This GNU make makefile has been tested on:
# Linux (x86 & Sparc) # Linux (x86 & Sparc & PPC)
# OS X # OS X
# Solaris (x86 & Sparc) # Solaris (x86 & Sparc)
# OpenBSD # OpenBSD

View file

@ -1864,7 +1864,7 @@ _set_errno_from_status (GetLastError ());
return SCPE_IOERR; return SCPE_IOERR;
} }
#elif defined (__linux) || defined (__sun__) #elif defined (__linux) || defined (__linux__) || defined (__sun__)
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -3229,7 +3229,7 @@ errno = Status;
return hVHD; return hVHD;
} }
#if defined(__CYGWIN__) || defined(VMS) || defined(__APPLE__) || defined(__linux) #if defined(__CYGWIN__) || defined(VMS) || defined(__APPLE__) || defined(__linux) || defined(__linux__)
#include <unistd.h> #include <unistd.h>
#endif #endif
static void static void

View file

@ -901,7 +901,7 @@ void eth_show_dev (FILE* st, ETH_DEV* dev)
#include <string.h> #include <string.h>
#ifdef USE_TAP_NETWORK #ifdef USE_TAP_NETWORK
#if defined(__linux) #if defined(__linux) || defined(__linux__)
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <net/if.h> #include <net/if.h>
#include <linux/if_tun.h> #include <linux/if_tun.h>
@ -1220,7 +1220,7 @@ int pcap_setfilter(pcap_t* a, struct bpf_program* b) {
Return value: 0=Success, -1=Failure */ Return value: 0=Success, -1=Failure */
int pcap_sendpacket(pcap_t* handle, const u_char* msg, int len) 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; return (send(pcap_fileno(handle), msg, len, 0) == len)? 0 : -1;
#else #else
return (write(pcap_fileno(handle), msg, len) == len)? 0 : -1; return (write(pcap_fileno(handle), msg, len) == len)? 0 : -1;
@ -1728,7 +1728,7 @@ if (0 == strncmp("tap:", savname, 4)) {
return SCPE_OPENERR; return SCPE_OPENERR;
} }
#endif #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) { if ((tun = open("/dev/net/tun", O_RDWR)) >= 0) {
struct ifreq ifr; /* Interface Requests */ struct ifreq ifr; /* Interface Requests */

View file

@ -219,7 +219,7 @@ FILE *sim_fopen (const char *file, const char *mode)
#if defined (VMS) #if defined (VMS)
return fopen (file, mode, "ALQ=32", "DEQ=4096", return fopen (file, mode, "ALQ=32", "DEQ=4096",
"MBF=6", "MBC=127", "FOP=cbt,tef", "ROP=rah,wbh", "CTX=stm"); "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); return fopen64 (file, mode);
#else #else
return fopen (file, mode); return fopen (file, mode);
@ -312,7 +312,7 @@ return (t_addr)fileaddr;
/* Linux */ /* Linux */
#if defined (__linux) #if defined (__linux) || defined (__linux__)
#define _SIM_IO_FSEEK_EXT_ 1 #define _SIM_IO_FSEEK_EXT_ 1
int sim_fseek (FILE *st, t_addr xpos, int origin) int sim_fseek (FILE *st, t_addr xpos, int origin)

View file

@ -861,7 +861,7 @@ return;
#elif defined (__unix__) || defined(__APPLE__) #elif defined (__unix__) || defined(__APPLE__)
#if defined(__linux__) #if defined(__linux) || defined(__linux__)
#include <dirent.h> #include <dirent.h>
#include <libgen.h> #include <libgen.h>
#include <unistd.h> #include <unistd.h>
@ -887,7 +887,7 @@ int port;
int ports = 0; int ports = 0;
memset(list, 0, max*sizeof(*list)); memset(list, 0, max*sizeof(*list));
#if defined(__linux__) #if defined(__linux) || defined(__linux__)
if (1) { if (1) {
struct dirent **namelist; struct dirent **namelist;
struct stat st; struct stat st;

View file

@ -777,7 +777,7 @@ return newsock; /* got it! */
SOCKET sim_accept_conn (SOCKET master, char **connectaddr) SOCKET sim_accept_conn (SOCKET master, char **connectaddr)
{ {
int32 sta, err; int32 sta, err;
#if defined (macintosh) || defined (__linux) || \ #if defined (macintosh) || defined (__linux) || defined (__linux__) || \
defined (__APPLE__) || defined (__OpenBSD__) || \ defined (__APPLE__) || defined (__OpenBSD__) || \
defined(__NetBSD__) || defined(__FreeBSD__) defined(__NetBSD__) || defined(__FreeBSD__)
socklen_t size; socklen_t size;