Changed many cpp conditionals that used ifdef LINUX or FREEBSD,

but which guarded gcc-specific code, not OS-specific code.  These
were changed to be ifdef __GNUC__.
This commit is contained in:
fur%netscape.com 1999-02-28 01:10:00 +00:00
Родитель 27f480ab07
Коммит b45cb424a2
7 изменённых файлов: 29 добавлений и 37 удалений

Просмотреть файл

@ -1083,10 +1083,7 @@ void Method::getDoubleWordArg(const Type &, JavaObject &arg, Uint32 &hi, Uint32
JavaObject *Method::invoke(JavaObject * PC_ONLY(obj), JavaObject * PC_ONLY(args)[], Int32 PC_ONLY(nArgs))
{
#if defined (XP_PC) || defined(LINUX) || defined(FREEBSD)
#if 0
void *code = addressFunction(getCode());
#endif
#ifdef GENERATE_FOR_X86
Int32 i;
Int32 start = 0;

Просмотреть файл

@ -124,7 +124,7 @@ getMethod()
// Return the address of the function that called the getCallerPC
extern Uint8* getCallerPC()
{
#if defined(WIN32) || defined(LINUX) || defined(FREEBSD)
#ifdef GENERATE_FOR_X86
Uint8** myEBP;
INLINE_GET_EBP(myEBP);
@ -132,7 +132,7 @@ extern Uint8* getCallerPC()
Uint8** calleeEBP = (Uint8**) *myEBP; // get the callee's EBP
Uint8* retAddress = (Uint8*) *(calleeEBP + 1);
return retAddress;
#else // WIN32 || LINUX || FREEBSD
#else // !GENERATE_FOR_X86
return 0;
#endif
}

Просмотреть файл

@ -65,7 +65,7 @@ SYSCALL_FUNC(void*) sysNewIntArray(Int32 length)
//
// Throw an Exception
//
#if !defined(_WIN32) && !defined(LINUX) && !defined(FREEBSD)
#ifndef GENERATE_FOR_X86
SYSCALL_FUNC(void) sysThrow(const JavaObject& /* inObject */)
{
@ -283,7 +283,7 @@ NS_EXTERN SYSCALL_FUNC(void) sysThrowNamedException(const char *exceptionName)
* you're on a platform that does *not* need stubs
* to call native code
*/
#if !defined(_WIN32) && !defined(LINUX) && !defined(FREEBSD)
#ifndef GENERATE_FOR_X86
SYSCALL_FUNC(void) sysThrowNullPointerException()
{
sysThrow(const_cast<Class *>(&Standard::get(cNullPointerException))->newInstance());

Просмотреть файл

@ -407,7 +407,7 @@ void Thread::_stop(JavaObject* exc)
ce = ca.lookupByRange(ip);
}
if (ce != NULL) { // REPLACE
#if defined(XP_PC) || defined(LINUX) || defined(FREEBSD)
#ifdef GENERATE_FOR_X86
ip = new(*pool) Uint8[10];
ip[0] = 0xf; // 0x0f0b is an illegal instruction
ip[1] = 0xb;

Просмотреть файл

@ -18,30 +18,32 @@
#ifndef _FIELD_OR_METHOD_MD_H_
#define _FIELD_OR_METHOD_MD_H_
#if defined(XP_PC) || defined(LINUX) || defined(FREEBSD)
#ifdef GENERATE_FOR_X86
#define PC_ONLY(x) x
#else
#define PC_ONLY(x)
#endif
#if defined(XP_PC)
# define prepareArg(i, arg) _asm { push arg } // Prepare the ith argument
# define callFunc(func) _asm { call func } // Call function func
# define getReturnValue(ret) _asm {mov ret, eax} // Put return value into ret
#elif defined(LINUX) || defined(FREEBSD)
# define prepareArg(i, arg) __asm__ ("pushl %0" : /* no outputs */ : "g" (arg)) // Prepare the ith argument
# define callFunc(func) __asm__ ("call *%0" : /* no outputs */ : "r" (func)) // Call function func
# define getReturnValue(ret) __asm__ ("movl %%eax,%0" : "=g" (ret) : /* no inputs */) // Put return value into ret
#ifdef GENERATE_FOR_X86
#ifdef __GNUC__
#define prepareArg(i, arg) __asm__ ("pushl %0" : /* no outputs */ : "g" (arg)) // Prepare the ith argument
#define callFunc(func) __asm__ ("call *%0" : /* no outputs */ : "r" (func)) // Call function func
#define getReturnValue(ret) __asm__ ("movl %%eax,%0" : "=g" (ret) : /* no inputs */) // Put return value into ret
#else // !__GNUC__
#define prepareArg(i, arg) _asm { push arg } // Prepare the ith argument
#define callFunc(func) _asm { call func } // Call function func
#define getReturnValue(ret) _asm {mov ret, eax} // Put return value into ret
#endif
#elif defined(GENERATE_FOR_PPC)
# ifdef XP_MAC
# define prepareArg(i, arg)
# define callFunc(func)
# define getReturnValue(ret) ret = 0
# else
# define prepareArg(i, arg)
# define callFunc(func)
# define getReturnValue(ret) ret = 0
# endif
#ifdef XP_MAC
#define prepareArg(i, arg)
#define callFunc(func)
#define getReturnValue(ret) ret = 0
#else
#define prepareArg(i, arg)
#define callFunc(func)
#define getReturnValue(ret) ret = 0
#endif
#endif

Просмотреть файл

@ -15,13 +15,11 @@
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// x86Win32_Exception.cpp
//
// simon
// bjorn
#if defined(_WIN32) || defined(LINUX) || defined (FREEBSD)
#include "SysCalls.h"
#include "prprf.h"
#include "x86Win32ExceptionHandler.h"
@ -90,8 +88,8 @@ extern "C" SYSCALL_FUNC(JavaObject&) x86NewExceptionInstance(StandardClass class
//--------------------------------------------------------------------------------
// LINUX/FREEBSD specific -- FIX make another file for this
#if defined( LINUX ) || defined( FREEBSD )
// Non MSVC code -- FIX make another file for this
#ifdef __GNUC__
extern "C"
{
@ -438,5 +436,3 @@ Uint8* findExceptionHandler(Context* context)
return pHandler;
}
//--------------------------------------------------------------------------------
#endif // _WIN32 || LINUX

Просмотреть файл

@ -19,8 +19,6 @@
//
// simon
#if defined(_WIN32) || defined(LINUX) || defined(FREEBSD)
#ifndef _X86WIN32_EXCEPTION_H_
#define _X86WIN32_EXCEPTION_H_
@ -79,4 +77,3 @@ void printContext(LogModuleObject &f, Context* context);
//--------------------------------------------------------------------------------
#endif // _X86WIN32_EXCEPTION_H_
#endif // _WIN32