@@ -20,24 +20,24 @@ #import "ObjFW.h" #import "TestsAppDelegate.h" -#if defined(STDOUT) && (defined(_WIN32) || defined(__DJGPP__)) +#if defined(STDOUT) && (defined(OF_WINDOWS) || defined(OF_MSDOS)) # undef STDOUT # define STDOUT_SIMPLE #endif -#ifdef _PSP +#ifdef OF_PSP # include # include # include # include PSP_MODULE_INFO("ObjFW Tests", 0, 0, 0); #endif -#ifdef __wii__ +#ifdef OF_WII # define BOOL OGC_BOOL # define asm __asm__ # include # include # undef BOOL @@ -55,11 +55,11 @@ RED, GREEN, YELLOW }; -#ifdef _PSP +#ifdef OF_PSP static int exit_cb(int arg1, int arg2, void *arg) { sceKernelExitGame(); @@ -78,23 +78,23 @@ #endif int main(int argc, char *argv[]) { -#ifdef _PSP +#ifdef OF_PSP int tid; #endif -#if defined(OF_OBJFW_RUNTIME) && !defined(_WIN32) +#if defined(OF_OBJFW_RUNTIME) && !defined(OF_WINDOWS) /* This does not work on Win32 if ObjFW is built as a DLL */ atexit(objc_exit); #endif /* We need deterministic hashes for tests */ of_hash_seed = 0; -#ifdef __wii__ +#ifdef OF_WII GXRModeObj *rmode; void *xfb; VIDEO_Init(); WPAD_Init(); @@ -112,11 +112,11 @@ CON_InitEx(rmode, 10, 20, rmode->fbWidth - 10, rmode->xfbHeight - 20); VIDEO_ClearFrameBuffer(rmode, xfb, COLOR_BLACK); #endif -#ifdef _PSP +#ifdef OF_PSP pspDebugScreenInit(); sceCtrlSetSamplingCycle(0); sceCtrlSetSamplingMode(PSP_CTRL_MODE_DIGITAL); @@ -127,11 +127,11 @@ #ifdef OF_NINTENDO_DS consoleDemoInit(); #endif -#if defined(__wii__) || defined(_PSP) || defined(OF_NINTENDO_DS) +#if defined(OF_WII) || defined(OF_PSP) || defined(OF_NINTENDO_DS) @try { return of_application_main(&argc, &argv, [TestsAppDelegate class]); } @catch (id e) { TestsAppDelegate *delegate = @@ -144,11 +144,11 @@ [delegate outputString: string inColor: RED]; [delegate outputString: backtrace inColor: RED]; -# if defined(__wii__) +# if defined(OF_WII) [delegate outputString: @"Press home button to exit!\n" inColor: NO_COLOR]; for (;;) { WPAD_ScanPads(); @@ -155,11 +155,11 @@ if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) [OFApplication terminateWithStatus: 1]; VIDEO_WaitVSync(); } -# elif defined(_PSP) +# elif defined(OF_PSP) sceKernelSleepThreadCB(); # elif defined(OF_NINTENDO_DS) [delegate outputString: @"Press start button to exit!" inColor: NO_COLOR]; for (;;) { @@ -179,11 +179,11 @@ @implementation TestsAppDelegate - (void)outputString: (OFString*)str inColor: (int)color { -#if defined(_PSP) +#if defined(OF_PSP) char i, space = ' '; int y = pspDebugScreenGetY(); pspDebugScreenSetXY(0, y); for (i = 0; i < 68; i++) @@ -208,11 +208,11 @@ pspDebugScreenPrintData([str UTF8String], [str UTF8StringLength]); #elif defined(STDOUT) switch (color) { case NO_COLOR: [of_stdout writeString: @"\r\033[K"]; -# if defined(__wii__) || defined(OF_NINTENDO_DS) +# if defined(OF_WII) || defined(OF_NINTENDO_DS) [of_stdout writeString: @"\033[37m"]; # endif break; case RED: [of_stdout writeString: @"\r\033[K\033[31;1m"]; @@ -273,11 +273,11 @@ [self outputString: [OFString stringWithFormat: @"[%@] %@: failed\n", module, test] inColor: RED]; [pool release]; -# ifdef __wii__ +# ifdef OF_WII [self outputString: @"Press A to continue!\n" inColor: NO_COLOR]; for (;;) { WPAD_ScanPads(); @@ -285,11 +285,11 @@ return; VIDEO_WaitVSync(); } # endif -# ifdef _PSP +# ifdef OF_PSP [self outputString: @"Press X to continue!\n" inColor: NO_COLOR]; for (;;) { SceCtrlData pad; @@ -319,11 +319,11 @@ #endif } - (void)applicationDidFinishLaunching { -#if defined(__wii__) && defined(OF_HAVE_FILES) +#if defined(OF_WII) && defined(OF_HAVE_FILES) [[OFFileManager defaultManager] changeCurrentDirectoryPath: @"/apps/objfw-tests"]; #endif [self objectTests]; @@ -374,11 +374,11 @@ [self forwardingTests]; #ifdef OF_HAVE_PROPERTIES [self propertiesTests]; #endif -#if defined(__wii__) +#if defined(OF_WII) [self outputString: @"Press home button to exit!\n" inColor: NO_COLOR]; for (;;) { WPAD_ScanPads(); @@ -385,11 +385,11 @@ if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) [OFApplication terminateWithStatus: _fails]; VIDEO_WaitVSync(); } -#elif defined(_PSP) +#elif defined(OF_PSP) [self outputString: [OFString stringWithFormat: @"%d tests failed!", _fails] inColor: NO_COLOR]; sceKernelSleepThreadCB(); #elif defined(OF_NINTENDO_DS)