gzcom-dll icon indicating copy to clipboard operation
gzcom-dll copied to clipboard

Convert the cISC4* types over to the EASTL vector

Open 0xC0000054 opened this issue 4 months ago • 2 comments

The EASTL vector is binary compatible with the internal vector type used by SC4.

Our EASTL vector uses a custom allocator that wraps SC4's internal memory allocator. This allows the vector to interoperate with SC4, but prevents it from being used when the cIGZAllocatorService is not available. For example, the EASTL vector could not be used after SC4 shuts down the cIGZAllocatorService.

Because of this limitation the cRZCOMDllDirector class still uses the vector implementation from MSVC.

This commit also fixes a build break with the cRZBaseVector class. It requires a language version of at least C++ 17, so the project now targets C++ 20.

Closes #8

0xC0000054 avatar Feb 11 '24 10:02 0xC0000054

I'll accept this as-is for now, but I think it'd be better to switch to STLPORT 4.5.3 since that's what the game was (probably) built against and would allow compatibility with other types like hash maps.

I'm also adding you as a collaborator to the repo so you don't have to go through the PR review process, since you've been doing more maintainer work than I have lately 😅

nsgomez avatar Feb 19 '24 23:02 nsgomez

I agree about STLPORT, hopefully that would finally allow DLLs to use game methods that take std::list, ilist, etc.

I attempted to build STLPORT 4.6, but I was unable to resolve the conflicts it created when trying to use it alongside the MSVC 2022 CRT. I hope you have better luck with that than I have.

0xC0000054 avatar Feb 20 '24 04:02 0xC0000054