mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-29 07:21:54 -04:00
Fix MSVC compiler and linker errors
- Fix struct/class forward declaration mismatches (JAIAudience, JASTrack) causing different MSVC mangled names and unresolved symbols - Add jsystem_stubs.cpp with stubs for JASHeap, JASVoiceBank, J3DShapeTable, JAUSection, JHICommBuf, HIO/HIO2, JOR
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
// C++ Mangled version of extras.c
|
||||
#include <cstring>
|
||||
#include <cstdint>
|
||||
#ifdef _MSC_VER
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
void *__memcpy(void* dest, void const* src, int n) {
|
||||
return memcpy(dest, src, n);
|
||||
@@ -14,5 +17,11 @@ void __dcbz(void* addr, int offset) {
|
||||
|
||||
int __cntlzw(unsigned int val) {
|
||||
if (val == 0) return 32; // PowerPC returns 32 if the input is 0
|
||||
#ifdef _MSC_VER
|
||||
unsigned long idx;
|
||||
_BitScanReverse(&idx, val);
|
||||
return 31 - (int)idx;
|
||||
#else
|
||||
return __builtin_clz(val);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user