From 28a8b5cb2e0c4e18ac4d3c7d6283c1c676c55f0f Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 30 Mar 2016 01:51:52 -0400 Subject: [PATCH] Various patches to get this closer to compiling again. --- Sources/Engine/Base/ReplaceFile.cpp | 1 + Sources/Engine/Base/Shell.cpp | 4 ++-- Sources/Engine/Base/Stream.h | 7 +++++++ Sources/Engine/Engine.cpp | 13 +++++++++---- Sources/Engine/Network/CommunicationInterface.h | 16 +++++++++++++++- Sources/Engine/Templates/StaticStackArray.cpp | 2 +- 6 files changed, 35 insertions(+), 8 deletions(-) diff --git a/Sources/Engine/Base/ReplaceFile.cpp b/Sources/Engine/Base/ReplaceFile.cpp index 6fe3815..58f555c 100644 --- a/Sources/Engine/Base/ReplaceFile.cpp +++ b/Sources/Engine/Base/ReplaceFile.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/Sources/Engine/Base/Shell.cpp b/Sources/Engine/Base/Shell.cpp index 68c65cd..8b7c40f 100644 --- a/Sources/Engine/Base/Shell.cpp +++ b/Sources/Engine/Base/Shell.cpp @@ -381,7 +381,7 @@ static void ListSymbols(void) void Echo(void* pArgs) { CTString str = *NEXTARGUMENT(CTString*); - CPrintF("%s", str); + CPrintF("%s", (const char *) str); } @@ -879,7 +879,7 @@ void CShell::StorePersistentSymbols(const CTFileName &fnScript) } else if (stBase.st_sttType==STT_STRING) { // dump all members for(INDEX i=0; i #include -#if (defined PLATFORM_MACOSX) -#include -#endif - // this version string can be referenced from outside the engine ENGINE_API CTString _strEngineBuild = ""; ENGINE_API ULONG _ulEngineBuildMajor = _SE_BUILD_MAJOR; @@ -108,6 +104,7 @@ BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReser } return TRUE; } +#endif static void DetectCPU(void) { @@ -411,6 +408,8 @@ ENGINE_API void SE_InitEngine(const char *argv0, CTString strGameID) } #elif (defined PLATFORM_MACOSX) + STUBBED("Use some Gestalt replacement, or whatever"); + #if 0 long osver = 0x0000; OSErr err = Gestalt(gestaltSystemVersion, &osver); if (err != noErr) @@ -419,6 +418,12 @@ ENGINE_API void SE_InitEngine(const char *argv0, CTString strGameID) sys_iOSMajor = ((osver & 0x0F00) >> 8) + (((osver & 0xF000) >> 12) * 10); sys_iOSMinor = ((osver & 0x00F0) >> 4); sys_iOSBuild = ((osver & 0x000F) >> 0); + #else + sys_iOSMajor = 10; // !!! FIXME: just flatly false. + sys_iOSMinor = 6; + sys_iOSBuild = 0; + #endif + sys_strOS = "Mac OS X"; sys_strOSMisc = "Mac OS"; CPrintF(TRANSV(" Type: %s\n"), (const char*)sys_strOS); diff --git a/Sources/Engine/Network/CommunicationInterface.h b/Sources/Engine/Network/CommunicationInterface.h index 2fd5332..f37c3d5 100644 --- a/Sources/Engine/Network/CommunicationInterface.h +++ b/Sources/Engine/Network/CommunicationInterface.h @@ -6,7 +6,21 @@ #pragma once #endif -#include +#ifdef PLATFORM_UNIX +#include +#include +#include +#include +#include +#define INVALID_SOCKET -1 +#define SOCKET_ERROR -1 +#define closesocket close +typedef int SOCKET; +typedef struct hostent HOSTENT; +typedef struct sockaddr_in SOCKADDR_IN; +typedef struct sockaddr SOCKADDR; +#define WSAGetLastError() (INDEX) errno +#endif #define SERVER_CLIENTS 16 diff --git a/Sources/Engine/Templates/StaticStackArray.cpp b/Sources/Engine/Templates/StaticStackArray.cpp index b80636d..97e5690 100644 --- a/Sources/Engine/Templates/StaticStackArray.cpp +++ b/Sources/Engine/Templates/StaticStackArray.cpp @@ -76,7 +76,7 @@ template inline Type *CStaticStackArray::Push(INDEX ct) { sa_UsedCount+=ct; while(sa_UsedCount>CStaticArray::Count()) { - Expand(CStaticArray::Count()+sa_ctAllocationStep); + this->Expand(CStaticArray::Count()+sa_ctAllocationStep); } ASSERT(sa_UsedCount <= CStaticArray::Count()); return &CStaticArray::operator[](sa_UsedCount-ct);