main.cpp: remove outdated code for MSVC 19.27

This commit is contained in:
oltolm 2024-03-02 14:32:59 +01:00 committed by Megamouse
parent c567c92d4b
commit 6f665da016

View file

@ -1388,56 +1388,3 @@ int main(int argc, char** argv)
// run event loop (maybe only needed for the gui application)
return app->exec();
}
// Temporarily, this is code from std for prebuilt LLVM. I don't understand why this is necessary.
// From the same MSVC 19.27.29112.0, LLVM libs depend on these, but RPCS3 gets linker errors.
#ifdef _WIN32
extern "C"
{
int __stdcall __std_init_once_begin_initialize(void** ppinit, ulong f, int* fp, void** lpc) noexcept
{
return InitOnceBeginInitialize(reinterpret_cast<LPINIT_ONCE>(ppinit), f, fp, lpc);
}
int __stdcall __std_init_once_complete(void** ppinit, ulong f, void* lpc) noexcept
{
return InitOnceComplete(reinterpret_cast<LPINIT_ONCE>(ppinit), f, lpc);
}
usz __stdcall __std_get_string_size_without_trailing_whitespace(const char* str, usz size) noexcept
{
while (size)
{
switch (str[size - 1])
{
case 0:
case ' ':
case '\n':
case '\r':
case '\t':
{
size--;
continue;
}
default: break;
}
break;
}
return size;
}
usz __stdcall __std_system_error_allocate_message(const unsigned long msg_id, char** ptr_str) noexcept
{
return __std_get_string_size_without_trailing_whitespace(*ptr_str, FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
nullptr, msg_id, 0, reinterpret_cast<char*>(ptr_str), 0, nullptr));
}
void __stdcall __std_system_error_deallocate_message(char* s) noexcept
{
LocalFree(s);
}
}
#endif