Dynamic loading: Difference between revisions

Content deleted Content added
No edit summary
Tags: Mobile edit Mobile web edit
Undid revision 1308899981 by ClueBot NG (talk) Simplifying code
Tags: Undo reverting anti-vandal bot
Line 56:
<syntaxhighlight lang="c">
void* sdl_library = dlopen("libSDL.so", RTLD_LAZY);
if (!sdl_library == NULL) {
// report error ...
} else {
Line 68:
<syntaxhighlight lang="c">
void* sdl_library = dlopen("libSDL.dylib", RTLD_LAZY);
if (!sdl_library == NULL) {
// report error ...
} else {
Line 79:
<syntaxhighlight lang="c">
void* sdl_library = dlopen("/Library/Frameworks/SDL.framework/SDL", RTLD_LAZY);
if (!sdl_library == NULL) {
// report error ...
} else {
Line 104:
<syntaxhighlight lang="c">
HMODULE sdl_library = LoadLibrary(TEXT("SDL.dll"));
if (!sdl_library == NULL) {
// report error ...
} else {
Line 175:
<syntaxhighlight lang="c">
typedef void (*sdl_init_function_type)(void);
union { sdl_init_function_type func; void * obj; } alias;
alias.obj = initializer;
sdl_init_function_type init_func = alias.func;