comparison src/SDL_loadso.c @ 651:35ff0890ac4e

pmandin: Added Atari LDG shared object loader
author Patrice Mandin <patmandin@gmail.com>
date Wed, 16 Jul 2003 11:54:13 +0000
parents 745873ea091f
children c67d4fb10a45
comparison
equal deleted inserted replaced
650:fe445b59d307 651:35ff0890ac4e
38 #elif defined(macintosh) 38 #elif defined(macintosh)
39 # include <string.h> 39 # include <string.h>
40 # include <Strings.h> 40 # include <Strings.h>
41 # include <CodeFragments.h> 41 # include <CodeFragments.h>
42 # include <Errors.h> 42 # include <Errors.h>
43 #elif defined(__MINT__) && defined(ENABLE_LDG)
44 # include <gem.h>
45 # include <ldg.h>
43 #else 46 #else
44 /*#error Unsupported dynamic link environment*/ 47 /*#error Unsupported dynamic link environment*/
45 #endif /* system type */ 48 #endif /* system type */
46 49
47 #include "SDL_types.h" 50 #include "SDL_types.h"
111 break; 114 break;
112 } 115 }
113 if ( loaderror == NULL ) { 116 if ( loaderror == NULL ) {
114 handle = (void *)(library_id); 117 handle = (void *)(library_id);
115 } 118 }
119 #elif defined(__MINT__) && defined(ENABLE_LDG)
120 /* * */
121 handle = (void *)ldg_open((char *)sofile, ldg_global);
116 #endif /* system type */ 122 #endif /* system type */
117 123
118 if ( handle == NULL ) { 124 if ( handle == NULL ) {
119 SDL_SetError("Failed loading %s: %s", sofile, loaderror); 125 SDL_SetError("Failed loading %s: %s", sofile, loaderror);
120 } 126 }
161 pname[SDL_TABLESIZE(pname)-1] = '\0'; 167 pname[SDL_TABLESIZE(pname)-1] = '\0';
162 if ( FindSymbol(library_id, C2PStr(pname), 168 if ( FindSymbol(library_id, C2PStr(pname),
163 (char **)&symbol, &class) != noErr ) { 169 (char **)&symbol, &class) != noErr ) {
164 loaderror = "Symbol not found"; 170 loaderror = "Symbol not found";
165 } 171 }
172 #elif defined(__MINT__) && defined(ENABLE_LDG)
173 /* * */
174 symbol = (void *)ldg_find((char *)name, (LDG *)handle);
166 #endif /* system type */ 175 #endif /* system type */
167 176
168 if ( symbol == NULL ) { 177 if ( symbol == NULL ) {
169 SDL_SetError("Failed loading %s: %s", name, loaderror); 178 SDL_SetError("Failed loading %s: %s", name, loaderror);
170 } 179 }
191 unload_add_on(library_id); 200 unload_add_on(library_id);
192 #elif defined(macintosh) 201 #elif defined(macintosh)
193 /* * */ 202 /* * */
194 CFragConnectionID library_id = (CFragConnectionID)handle; 203 CFragConnectionID library_id = (CFragConnectionID)handle;
195 CloseConnection(library_id); 204 CloseConnection(library_id);
205 #elif defined(__MINT__) && defined(ENABLE_LDG)
206 /* * */
207 ldg_close((LDG *)handle, ldg_global);
196 #endif /* system type */ 208 #endif /* system type */
197 } 209 }