Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merged r2903:2904 from SDL-1.2 branch to trunk: BeOS loadso updates.
  • Loading branch information
icculus committed Nov 7, 2006
1 parent 2a2c8f3 commit 9bbe63b
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions src/loadso/beos/SDL_sysloadso.c
Expand Up @@ -35,35 +35,25 @@ void *
SDL_LoadObject(const char *sofile)
{
void *handle = NULL;
const char *loaderror = "Unknown error";
image_id library_id = load_add_on(sofile);
if (library_id == B_ERROR) {
loaderror = "BeOS error";
if (library_id < 0) {
SDL_SetError(strerror((int) library_id));
} else {
handle = (void *) (library_id);
}

if (handle == NULL) {
SDL_SetError("Failed loading %s: %s", sofile, loaderror);
}
return (handle);
}

void *
SDL_LoadFunction(void *handle, const char *name)
{
void *symbol = NULL;
const char *loaderror = "Unknown error";
void *sym = NULL;
image_id library_id = (image_id) handle;
if (get_image_symbol(library_id,
name, B_SYMBOL_TYPE_TEXT, &symbol) != B_NO_ERROR) {
loaderror = "Symbol not found";
}

if (symbol == NULL) {
SDL_SetError("Failed loading %s: %s", name, loaderror);
status_t rc = get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym);
if (rc != B_NO_ERROR) {
SDL_SetError(strerror(rc));
}
return (symbol);
return (sym);
}

void
Expand All @@ -77,4 +67,6 @@ SDL_UnloadObject(void *handle)
}

#endif /* SDL_LOADSO_BEOS */

/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit 9bbe63b

Please sign in to comment.