Author: wmb
Date: 2007-07-05 19:14:00 +0200 (Thu, 05 Jul 2007)
New Revision: 458
Modified:
forth/wrapper/wrapper.c
Log:
wrapper.c - Changes the ifdefs to use standard GCC predefined macros like
__linux__, instead of ad-hoc names like Linux, thus simplifying makefiles.
Modified: forth/wrapper/wrapper.c
===================================================================
--- forth/wrapper/wrapper.c 2007-07-05 17:12:04 UTC (rev 457)
+++ forth/wrapper/wrapper.c 2007-07-05 17:14:00 UTC (rev 458)
@@ -153,15 +153,16 @@
#define HOST_LITTLE_ENDIAN
#endif
-#ifdef Linux
+#ifdef __linux__
char *host_os = "Linux";
#define SYS5 1
#ifdef HOSTPOWERPC
#define LinuxPOWERPC
char *host_cpu = "powerpc";
#else
-# ifndef CKERNEL
-# ifndef MIPS
+# ifdef __i386__
+# ifndef CKERNEL
+ char *host_cpu = "x86";
# define LinuxX86
# define HOST_LITTLE_ENDIAN
# endif
@@ -398,7 +399,6 @@
INTERNAL long f_rmdir();
#ifdef SIM
INTERNAL long printnum();
-extern int close(), open();
#endif
#ifdef DLOPEN
extern long dlopen(), dlsym(), dlerror(), dlclose();
@@ -1037,7 +1037,7 @@
signal(SIGFPE,exit_handler);
signal(SIGBUS,exit_handler);
signal(SIGSEGV,exit_handler);
-#ifndef Linux
+#ifndef __linux__
signal(SIGEMT,exit_handler);
signal(SIGSYS,exit_handler);
#endif
@@ -1197,7 +1197,7 @@
}
#endif
-#ifdef Linux
+#ifdef __linux__
static void /* set file associated with fd to */
waitchar (int fd) /* "wait for character" */
{
@@ -1259,7 +1259,7 @@
#else
# ifdef UNIX
# ifdef SYS5
-# ifdef Linux
+# ifdef __linux__
no_waitchar (0);
nchars = read(0, &c[0], 1) > 0;
waitchar (0);
@@ -2356,7 +2356,7 @@
char *adr;
long len;
{
-#if defined(Linux) && defined(MIPS)
+#if defined(__linux__) && defined(MIPS)
extern int cacheflush(char *addr, int nbytes, int cache);
(void) cacheflush(adr, len, BCACHE);
#endif