mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-27 17:11:00 +01:00
windows: add brave new mingw compat hook for gcc 12.2.0+
This commit is contained in:
parent
8da4d14e15
commit
68040e2922
@ -58,7 +58,7 @@ export CXXWRAPS := -Wl,--wrap,__cxa_pure_virtual \
|
||||
-Wl,--wrap,exit
|
||||
else ifeq ($(ATMOSPHERE_BOARD),generic_windows)
|
||||
export CXXREQUIRED :=
|
||||
export CXXWRAPS := -Wl,--wrap,__p__acmdln
|
||||
export CXXWRAPS := -Wl,--wrap,__p__acmdln -Wl,--wrap,_set_invalid_parameter_handler
|
||||
else
|
||||
export CXXREQUIRED :=
|
||||
export CXXWRAPS :=
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
extern "C" char **__real___p__acmdln(void);
|
||||
extern "C" _invalid_parameter_handler __real__set_invalid_parameter_handler(_invalid_parameter_handler);
|
||||
|
||||
namespace ams {
|
||||
|
||||
@ -65,4 +66,11 @@ extern "C" {
|
||||
return __real___p__acmdln();
|
||||
}
|
||||
|
||||
/* On some mingw gcc versions, acmdln isn't used, so we need to hook a different part of crt init. */
|
||||
_invalid_parameter_handler __wrap__set_invalid_parameter_handler(_invalid_parameter_handler handler) {
|
||||
::ams::os::Initialize();
|
||||
return __real__set_invalid_parameter_handler(handler);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user