[srm-cvs] CVS Update: - Fix macro (not tested)

From: <d.rethans[@]jdimedia.nl>
Date: Sat Feb 23 2002 - 18:46:48 CET

Date: Sat Feb 23 18:46:47 CET 2002
User: Derick Rethans
Directory: srm/main/src

Log Message:
 [0.25]
 - Fix macro (not tested)
 
Modified files:
           srm/main/src/srm_modules.c (version: 1.60)
           srm/main/src/srm_modules.h (version: 1.25)

[FILE: /srm/main/src/srm_modules.c]

--- srm/main/src/srm_modules.c:1.59 Mon Feb 11 21:48:22 2002 GMT
+++ srm/main/src/srm_modules.c Sat Feb 23 16:46:47 2002 GMT
@@ -1,4 +1,4 @@
-/* $Id: cvstemp,v 1.59 2002/02/11 22:48:22 sterling Exp $ */
+/* $Id: cvstemp,v 1.60 2002/02/23 17:46:47 derick Exp $ */
 
 /* The contents of this file are subject to the Vulcan Logic Public
  * License Version 1.1 (the "License"); you may not use this file
@@ -17,6 +17,8 @@
  * 2000, 2001, 2002 Vulcan Logic Group. All Rights Reserved.
  *
  * Contributor(s):
+ * Daniel R. Kalowsky <dank@deadmime.org>
+ * Derick Rethans <d.rethans@jdimedia.nl>
  */
 
 #include <stdio.h>
@@ -34,6 +36,22 @@
 srm_hash *module_hash;
 
 static srm_bool dummy (void * dummy) { return TRUE; };
+
+
+#if defined(SRM_MACOSX)
+NSModule srm_ns_load (char* libname)
+{
+ NSObjectFileImage image;
+ NSModule handle;
+
+ if (NSCreateObjectFileImageFromFile(libname, &image) != NSObjectFileImageSuccess) {
+ return NULL;
+ }
+ handle = NSLinkModule(image, libname, TRUE);
+ NSDestroyObjectFileImage(image);
+ return handle;
+}
+#endif
 
 /*
  * Initialize the module hash

[FILE: /srm/main/src/srm_modules.h]

--- srm/main/src/srm_modules.h:1.24 Sat Feb 23 16:00:20 2002 GMT
+++ srm/main/src/srm_modules.h Sat Feb 23 16:46:47 2002 GMT
@@ -1,4 +1,4 @@
-/* $Id: cvstemp,v 1.24 2002/02/23 17:00:20 kalowsky Exp $ */
+/* $Id: cvstemp,v 1.25 2002/02/23 17:46:47 derick Exp $ */
 
 /* The contents of this file are subject to the Vulcan Logic Public
  * License Version 1.1 (the "License"); you may not use this file
@@ -17,6 +17,8 @@
  * 2000, 2001, 2002 Vulcan Logic Group. All Rights Reserved.
  *
  * Contributor(s):
+ * Daniel R. Kalowsky <dank@deadmime.org>
+ * Derick Rethans <d.rethans@jdimedia.nl>
  */
 
 #ifndef __MODULES_H__
@@ -131,17 +133,12 @@
 #endif /* HAVE_LIBDL */
 
 #if defined(SRM_MACOSX) /* start SRM_MACOSX should really be HAVE_DYLD*/
-/* DL_LOAD */
-# define DL_LOAD(libname) NSObjectFileImage image; \
- NSModule handle; \
- if (NSCreateObjectFileImageFromFile(libname, &image) != NSObjectFileImageSuccess) \
- return NULL; \
- handle = NSLinkModule(image, libname, TRUE); \
- NSDestroyObjectFileImage(image); \
- return handle;
-/* DL_UNLOAD */
+
+# define DL_LOAD(libname) srm_ns_load (libname)
+NSModule srm_ns_load (char* libname);
+
 # define DL_UNLOAD(handle) NSUnLinkModule(handle,FALSE);
-/* DL_FETCH_SYM */
+
 # define DL_FETCH_SYM(handle,symname) NSSymbol symbol; \
                 char *symname2=(char*)malloc(sizeof(char)*strlen(symname)+2); \
                 sprintf(symname2, "_%s", symname); \
@@ -152,6 +149,7 @@
                 } \
                 free(symname2); \
                 return NSAddressOfSymbol(symbol);
+
 # define SRM_DLMODULES_SUPPORT 1
 # else /* end SRM_MACOSX, start rest not supported*/
 # define SRM_DLMODULES_SUPPORT 0
Received on Sat Feb 23 18:47:02 2002

This archive was generated by hypermail 2.1.8 : Tue Jan 06 2009 - 05:00:03 CET