From ebbb8b46e21dc98d4d8dc9e208689fbebfcd275b Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 17 Feb 2024 00:49:15 +0100 Subject: Opcode and ICE now compile under 32 bit Linux --- contrib/Opcode/Ice/IcePreprocessor.h | 14 +++++++++----- contrib/Opcode/Ice/IceTypes.h | 27 +++++++++++++++++---------- contrib/Opcode/Opcode.h | 10 +++++++--- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/contrib/Opcode/Ice/IcePreprocessor.h b/contrib/Opcode/Ice/IcePreprocessor.h index 0aaf8f1..d4ca850 100644 --- a/contrib/Opcode/Ice/IcePreprocessor.h +++ b/contrib/Opcode/Ice/IcePreprocessor.h @@ -64,14 +64,18 @@ #define THIS_FILE __FILE__ #endif - #ifndef ICE_NO_DLL - #ifdef ICECORE_EXPORTS - #define ICECORE_API __declspec(dllexport) + #ifdef WIN32 + #ifndef ICE_NO_DLL + #ifdef ICECORE_EXPORTS + #define ICECORE_API __declspec(dllexport) + #else + #define ICECORE_API __declspec(dllimport) + #endif #else - #define ICECORE_API __declspec(dllimport) + #define ICECORE_API #endif #else - #define ICECORE_API + #define ICECORE_API #endif // Don't override new/delete diff --git a/contrib/Opcode/Ice/IceTypes.h b/contrib/Opcode/Ice/IceTypes.h index 543be11..75104fa 100644 --- a/contrib/Opcode/Ice/IceTypes.h +++ b/contrib/Opcode/Ice/IceTypes.h @@ -12,6 +12,8 @@ #ifndef __ICETYPES_H__ #define __ICETYPES_H__ +#include + #define USE_HANDLE_MANAGER // Constants @@ -43,16 +45,16 @@ #define null 0 //!< our own NULL pointer // Custom types used in ICE - typedef signed char sbyte; //!< sizeof(sbyte) must be 1 - typedef unsigned char ubyte; //!< sizeof(ubyte) must be 1 - typedef signed short sword; //!< sizeof(sword) must be 2 - typedef unsigned short uword; //!< sizeof(uword) must be 2 - typedef signed int sdword; //!< sizeof(sdword) must be 4 - typedef unsigned int udword; //!< sizeof(udword) must be 4 - typedef signed __int64 sqword; //!< sizeof(sqword) must be 8 - typedef unsigned __int64 uqword; //!< sizeof(uqword) must be 8 - typedef float float32; //!< sizeof(float32) must be 4 - typedef double float64; //!< sizeof(float64) must be 4 + typedef std::int8_t sbyte; + typedef std::uint8_t ubyte; + typedef std::int16_t sword; + typedef std::uint16_t uword; + typedef std::int32_t sdword; + typedef std::uint32_t udword; + typedef std::int64_t sqword; + typedef std::uint64_t uqword; + typedef float float32; + typedef double float64; ICE_COMPILE_TIME_ASSERT(sizeof(bool)==1); // ...otherwise things might fail with VC++ 4.2 ! ICE_COMPILE_TIME_ASSERT(sizeof(ubyte)==1); @@ -63,6 +65,8 @@ ICE_COMPILE_TIME_ASSERT(sizeof(sdword)==4); ICE_COMPILE_TIME_ASSERT(sizeof(uqword)==8); ICE_COMPILE_TIME_ASSERT(sizeof(sqword)==8); + ICE_COMPILE_TIME_ASSERT(sizeof(float32)==4); + ICE_COMPILE_TIME_ASSERT(sizeof(float64)==8); //! TO BE DOCUMENTED #define DECLARE_ICE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name @@ -122,6 +126,9 @@ #define IEEE_UNDERFLOW_LIMIT 0x1a000000 #define ONE_OVER_RAND_MAX (1.0f / float(RAND_MAX)) //!< Inverse of the max possible value returned by rand() + #ifndef WIN32 + #define __stdcall + #endif typedef int (__stdcall* PROC)(); //!< A standard procedure call. typedef bool (*ENUMERATION)(udword value, udword param, udword context); //!< ICE standard enumeration call diff --git a/contrib/Opcode/Opcode.h b/contrib/Opcode/Opcode.h index 5dc8c91..a6f4adc 100644 --- a/contrib/Opcode/Opcode.h +++ b/contrib/Opcode/Opcode.h @@ -22,10 +22,14 @@ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Preprocessor -#ifdef OPCODE_EXPORTS - #define OPCODE_API __declspec(dllexport) +#ifdef WIN32 + #ifdef OPCODE_EXPORTS + #define OPCODE_API __declspec(dllexport) + #else + #define OPCODE_API __declspec(dllimport) + #endif #else - #define OPCODE_API __declspec(dllimport) + #define OPCODE_API #endif #include "OPC_IceHook.h" -- cgit v1.1