Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -44,10 +44,14 @@ # define nanosleep ogc_nanosleep # include # undef BOOL # undef nanosleep #endif + +#ifdef OF_NINTENDO_3DS +# include <3ds/svc.h> +#endif #import "OFThread.h" #import "OFThread+Private.h" #import "OFRunLoop.h" #import "OFList.h" @@ -200,10 +204,15 @@ @throw [OFOutOfRangeException exception]; counter = timeInterval * 60; while (counter--) swiWaitForVBlank(); +#elif defined(OF_NINTENDO_3DS) + if (timeInterval * 1000000000 > INT64_MAX) + @throw [OFOutOfRangeException exception]; + + svcSleepThread((int64_t)(timeInterval * 1000000000)); #else if (timeInterval > UINT_MAX) @throw [OFOutOfRangeException exception]; sleep((unsigned int)timeInterval);