ams: support building unit test programs on windows/linux/macos

This commit is contained in:
Michael Scire
2022-03-06 12:08:20 -08:00
committed by SciresM
parent 9a38be201a
commit 64a97576d0
756 changed files with 33359 additions and 9372 deletions

View File

@@ -15,11 +15,13 @@
*/
#include <stratosphere.hpp>
#if defined(ATMOSPHERE_OS_HORIZON)
extern "C" {
extern TimeServiceType __nx_time_service_type;
}
#endif
namespace ams::time {
@@ -48,6 +50,7 @@ namespace ams::time {
return ResultSuccess();
}
#if defined(ATMOSPHERE_OS_HORIZON)
switch (mode) {
case InitializeMode_Normal: __nx_time_service_type = ::TimeServiceType_User; break;
case InitializeMode_Menu: __nx_time_service_type = ::TimeServiceType_Menu; break;
@@ -58,6 +61,9 @@ namespace ams::time {
}
R_TRY(::timeInitialize());
#else
AMS_ABORT("TODO");
#endif
g_initialize_count++;
g_initialize_mode = mode;
@@ -87,7 +93,11 @@ namespace ams::time {
if (g_initialize_count > 0) {
if ((--g_initialize_count) == 0) {
#if defined(ATMOSPHERE_OS_HORIZON)
::timeExit();
#else
AMS_ABORT("TODO");
#endif
g_initialize_mode = InitializeMode_None;
}
}