[srm-cvs] CVS Update: - updates for MacOSX... doesn't work for some SRM_MACOSX silly reason

From: <kalowsky[@]php.net>
Date: Sat Feb 23 2002 - 18:00:21 CET

Date: Sat Feb 23 18:00:20 CET 2002
User: Dan Kalowsky
Directory: srm/main/src

Log Message:
 [2.73]
 - updates for MacOSX... doesn't work for some SRM_MACOSX silly reason
 
 
Modified files:
           srm/main/src/srm_modules.h (version: 1.24)

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

--- srm/main/src/srm_modules.h:1.23 Thu Feb 07 02:10:15 2002 GMT
+++ srm/main/src/srm_modules.h Sat Feb 23 16:00:20 2002 GMT
@@ -1,4 +1,4 @@
-/* $Id: cvstemp,v 1.23 2002/02/07 03:10:15 sniper Exp $ */
+/* $Id: cvstemp,v 1.24 2002/02/23 17:00:20 kalowsky 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
@@ -30,7 +30,7 @@
 # include <dlfcn.h>
 #endif
 
-#if defined(SRM_MACOSX)
+#if defined(SRM_MACOSX) /* NeXT/Apple dynamic linker */
 #include <mach-o/dyld.h>
 #endif
 
@@ -128,25 +128,33 @@
 # endif
 
 # define SRM_DLMODULES_SUPPORT 1
-#else /* HAVE_LIBDL */
+#endif /* HAVE_LIBDL */
 
-# if defined(SRM_MACOSX)
+#if defined(SRM_MACOSX) /* start SRM_MACOSX should really be HAVE_DYLD*/
+/* DL_LOAD */
 # define DL_LOAD(libname) NSObjectFileImage image; \
- DYLD_BOOL dsoB = NSAddLibrary(libname);
-
-# define DL_FETCH_SYM(h,s) NSSymbol symbol; \
- char *symname2 = (char*)malloc(sizeof(char)*strlen(name)+2)); \
- sprintf(symname2, "_%s", s); \
+ NSModule handle; \
+ if (NSCreateObjectFileImageFromFile(libname, &image) != NSObjectFileImageSuccess) \
+ return NULL; \
+ handle = NSLinkModule(image, libname, TRUE); \
+ NSDestroyObjectFileImage(image); \
+ return handle;
+/* DL_UNLOAD */
+# 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); \
                 int defined = NSIsSymbolNameDefined(symname2); \
                 if (defined) { \
                         symbol = NSLookupAndBindSymbold(symname2); \
                         handle = NSAddressOfSymbol(symbol); \
                 } \
- free(symname2);
+ free(symname2); \
+ return NSAddressOfSymbol(symbol);
 # define SRM_DLMODULES_SUPPORT 1
-# else
+# else /* end SRM_MACOSX, start rest not supported*/
 # define SRM_DLMODULES_SUPPORT 0
-# endif /* defined(SRM_MACOSX) */
 #endif /* HAVE_LIBDL */
 
 
Received on Sat Feb 23 18:00:34 2002

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