From 2b4e4d56cd09df3223e373302a32fa16739c21c5 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Wed, 23 Nov 2016 08:47:02 +0100 Subject: [PATCH] (WiiU) no need to specify library name for IMPORT_END() anymore. --- wiiu/system/dynamic.c | 6 +++--- wiiu/system/imports.h | 14 +++++++------- wiiu/system/stubs_elf.S | 2 +- wiiu/system/stubs_rpl.S | 22 +++++++++++----------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/wiiu/system/dynamic.c b/wiiu/system/dynamic.c index d70e16a53d..8b929071d4 100644 --- a/wiiu/system/dynamic.c +++ b/wiiu/system/dynamic.c @@ -3,7 +3,7 @@ #define IMPORT(name) void* addr_##name #define IMPORT_BEGIN(lib) -#define IMPORT_END(lib) +#define IMPORT_END() #include "imports.h" #undef IMPORT @@ -12,8 +12,8 @@ #define IMPORT(name) do{if(OSDynLoad_FindExport(handle, 0, #name, &addr_##name) < 0)OSFatal("Function " # name " is NULL");} while(0) #define IMPORT_BEGIN(lib) OSDynLoad_Acquire(#lib ".rpl", &handle) -//#define IMPORT_END(lib) OSDynLoad_Release(handle) -#define IMPORT_END(lib) +//#define IMPORT_END() OSDynLoad_Release(handle) +#define IMPORT_END() void InitFunctionPointers(void) { diff --git a/wiiu/system/imports.h b/wiiu/system/imports.h index a8c92081cc..e660fe2f86 100644 --- a/wiiu/system/imports.h +++ b/wiiu/system/imports.h @@ -63,7 +63,7 @@ IMPORT(FSGetMountSource); IMPORT(FSMount); IMPORT(FSUnmount); -IMPORT_END(coreinit); +IMPORT_END(); /* nsysnet */ IMPORT_BEGIN(nsysnet); @@ -75,7 +75,7 @@ IMPORT(connect); IMPORT(send); IMPORT(inet_aton); -IMPORT_END(nsysnet); +IMPORT_END(); /* gx2 */ IMPORT_BEGIN(gx2); @@ -122,7 +122,7 @@ IMPORT(GX2DrawEx); IMPORT(GX2WaitForFlip); IMPORT(GX2GetSwapStatus); -IMPORT_END(gx2); +IMPORT_END(); /* proc_ui */ IMPORT_BEGIN(proc_ui); @@ -130,7 +130,7 @@ IMPORT_BEGIN(proc_ui); IMPORT(ProcUIInit); IMPORT(ProcUIShutdown); -IMPORT_END(proc_ui); +IMPORT_END(); /* sndcore2 */ IMPORT_BEGIN(sndcore2); @@ -148,14 +148,14 @@ IMPORT(AXSetMultiVoiceSrcRatio); IMPORT(AXIsMultiVoiceRunning); IMPORT(AXFreeMultiVoice); -IMPORT_END(sndcore2); +IMPORT_END(); /* sysapp */ IMPORT_BEGIN(sysapp); IMPORT(SYSRelaunchTitle); -IMPORT_END(sysapp); +IMPORT_END(); /* vpad */ IMPORT_BEGIN(vpad); @@ -163,4 +163,4 @@ IMPORT_BEGIN(vpad); IMPORT(VPADRead); IMPORT(VPADInit); -IMPORT_END(vpad); +IMPORT_END(); diff --git a/wiiu/system/stubs_elf.S b/wiiu/system/stubs_elf.S index 8762650678..2fb57eb6b1 100644 --- a/wiiu/system/stubs_elf.S +++ b/wiiu/system/stubs_elf.S @@ -16,7 +16,7 @@ bctr #define IMPORT_BEGIN(lib) -#define IMPORT_END(lib) +#define IMPORT_END() .align 2; .section ".text"; diff --git a/wiiu/system/stubs_rpl.S b/wiiu/system/stubs_rpl.S index a2c25a8b49..9dffaec458 100644 --- a/wiiu/system/stubs_rpl.S +++ b/wiiu/system/stubs_rpl.S @@ -20,34 +20,34 @@ bctr; /*#define IMPORT_END() .align 2;*/ -#define IMPORT_END(lib) +#define IMPORT_END() #include "imports.h" -#undef IMPORT_BEGIN +#undef IMPORT_BEGIN #undef IMPORT #undef IMPORT_END #define IMPORT_BEGIN(lib) \ +.section ".rodata.rplNames"; \ + 1: \ + .string #lib; \ .section ".data.rplFuncStubs"; \ .align 2; \ - fstubBegin_##lib: + 2: #define IMPORT(name) \ .global name##_stub; \ name##_stub: \ .long name; -#define IMPORT_END(lib) \ - fstubEnd_##lib: \ -.section ".rodata.rplNames"; \ - lib##_name: \ - .string #lib; \ +#define IMPORT_END() \ + 3: \ .section ".lib.rplLibs"; \ .align 2; \ - .long lib##_name; \ - .long fstubBegin_##lib; \ - .long fstubEnd_##lib + .long 1b; \ + .long 2b; \ + .long 3b #include "imports.h"