(WiiU) no need to specify library name for IMPORT_END() anymore.

This commit is contained in:
aliaspider 2016-11-23 08:47:02 +01:00
parent 0a6e6d1abe
commit 2b4e4d56cd
4 changed files with 22 additions and 22 deletions

View File

@ -3,7 +3,7 @@
#define IMPORT(name) void* addr_##name #define IMPORT(name) void* addr_##name
#define IMPORT_BEGIN(lib) #define IMPORT_BEGIN(lib)
#define IMPORT_END(lib) #define IMPORT_END()
#include "imports.h" #include "imports.h"
#undef IMPORT #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(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_BEGIN(lib) OSDynLoad_Acquire(#lib ".rpl", &handle)
//#define IMPORT_END(lib) OSDynLoad_Release(handle) //#define IMPORT_END() OSDynLoad_Release(handle)
#define IMPORT_END(lib) #define IMPORT_END()
void InitFunctionPointers(void) void InitFunctionPointers(void)
{ {

View File

@ -63,7 +63,7 @@ IMPORT(FSGetMountSource);
IMPORT(FSMount); IMPORT(FSMount);
IMPORT(FSUnmount); IMPORT(FSUnmount);
IMPORT_END(coreinit); IMPORT_END();
/* nsysnet */ /* nsysnet */
IMPORT_BEGIN(nsysnet); IMPORT_BEGIN(nsysnet);
@ -75,7 +75,7 @@ IMPORT(connect);
IMPORT(send); IMPORT(send);
IMPORT(inet_aton); IMPORT(inet_aton);
IMPORT_END(nsysnet); IMPORT_END();
/* gx2 */ /* gx2 */
IMPORT_BEGIN(gx2); IMPORT_BEGIN(gx2);
@ -122,7 +122,7 @@ IMPORT(GX2DrawEx);
IMPORT(GX2WaitForFlip); IMPORT(GX2WaitForFlip);
IMPORT(GX2GetSwapStatus); IMPORT(GX2GetSwapStatus);
IMPORT_END(gx2); IMPORT_END();
/* proc_ui */ /* proc_ui */
IMPORT_BEGIN(proc_ui); IMPORT_BEGIN(proc_ui);
@ -130,7 +130,7 @@ IMPORT_BEGIN(proc_ui);
IMPORT(ProcUIInit); IMPORT(ProcUIInit);
IMPORT(ProcUIShutdown); IMPORT(ProcUIShutdown);
IMPORT_END(proc_ui); IMPORT_END();
/* sndcore2 */ /* sndcore2 */
IMPORT_BEGIN(sndcore2); IMPORT_BEGIN(sndcore2);
@ -148,14 +148,14 @@ IMPORT(AXSetMultiVoiceSrcRatio);
IMPORT(AXIsMultiVoiceRunning); IMPORT(AXIsMultiVoiceRunning);
IMPORT(AXFreeMultiVoice); IMPORT(AXFreeMultiVoice);
IMPORT_END(sndcore2); IMPORT_END();
/* sysapp */ /* sysapp */
IMPORT_BEGIN(sysapp); IMPORT_BEGIN(sysapp);
IMPORT(SYSRelaunchTitle); IMPORT(SYSRelaunchTitle);
IMPORT_END(sysapp); IMPORT_END();
/* vpad */ /* vpad */
IMPORT_BEGIN(vpad); IMPORT_BEGIN(vpad);
@ -163,4 +163,4 @@ IMPORT_BEGIN(vpad);
IMPORT(VPADRead); IMPORT(VPADRead);
IMPORT(VPADInit); IMPORT(VPADInit);
IMPORT_END(vpad); IMPORT_END();

View File

@ -16,7 +16,7 @@
bctr bctr
#define IMPORT_BEGIN(lib) #define IMPORT_BEGIN(lib)
#define IMPORT_END(lib) #define IMPORT_END()
.align 2; .align 2;
.section ".text"; .section ".text";

View File

@ -20,34 +20,34 @@
bctr; bctr;
/*#define IMPORT_END() .align 2;*/ /*#define IMPORT_END() .align 2;*/
#define IMPORT_END(lib) #define IMPORT_END()
#include "imports.h" #include "imports.h"
#undef IMPORT_BEGIN #undef IMPORT_BEGIN
#undef IMPORT #undef IMPORT
#undef IMPORT_END #undef IMPORT_END
#define IMPORT_BEGIN(lib) \ #define IMPORT_BEGIN(lib) \
.section ".rodata.rplNames"; \
1: \
.string #lib; \
.section ".data.rplFuncStubs"; \ .section ".data.rplFuncStubs"; \
.align 2; \ .align 2; \
fstubBegin_##lib: 2:
#define IMPORT(name) \ #define IMPORT(name) \
.global name##_stub; \ .global name##_stub; \
name##_stub: \ name##_stub: \
.long name; .long name;
#define IMPORT_END(lib) \ #define IMPORT_END() \
fstubEnd_##lib: \ 3: \
.section ".rodata.rplNames"; \
lib##_name: \
.string #lib; \
.section ".lib.rplLibs"; \ .section ".lib.rplLibs"; \
.align 2; \ .align 2; \
.long lib##_name; \ .long 1b; \
.long fstubBegin_##lib; \ .long 2b; \
.long fstubEnd_##lib .long 3b
#include "imports.h" #include "imports.h"