Differences From Artifact [b26e7541e7]:
- File
src/OFThread.m
— part of check-in
[2a27cf3000]
at
2016-01-03 00:41:26
on branch trunk
— Update copyright
While at it, also update the mail address. (user: js, size: 8711) [annotate] [blame] [check-ins using]
To Artifact [d451c32cdd]:
- File
src/OFThread.m
— part of check-in
[032bfb52ed]
at
2016-02-21 20:41:42
on branch trunk
— OFThread: Sleep using svcSleepThread() on 3DS
This makes ObjFW compile for the Nintendo 3DS. (user: js, size: 8939) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #ifdef OF_WII # define BOOL OGC_BOOL # define nanosleep ogc_nanosleep # include <ogcsys.h> # undef BOOL # undef nanosleep #endif #import "OFThread.h" #import "OFThread+Private.h" #import "OFRunLoop.h" #import "OFList.h" #import "OFDate.h" #import "OFDictionary.h" | > > > > | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #ifdef OF_WII # define BOOL OGC_BOOL # define nanosleep ogc_nanosleep # include <ogcsys.h> # 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" #import "OFDate.h" #import "OFDictionary.h" |
︙ | ︙ | |||
198 199 200 201 202 203 204 205 206 207 208 209 210 211 | if (timeInterval > UINT64_MAX / 60) @throw [OFOutOfRangeException exception]; counter = timeInterval * 60; while (counter--) swiWaitForVBlank(); #else if (timeInterval > UINT_MAX) @throw [OFOutOfRangeException exception]; sleep((unsigned int)timeInterval); usleep((useconds_t)lrint( (timeInterval - floor(timeInterval)) * 1000000)); | > > > > > | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | if (timeInterval > UINT64_MAX / 60) @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); usleep((useconds_t)lrint( (timeInterval - floor(timeInterval)) * 1000000)); |
︙ | ︙ |