Author: bernhard
Date: Tue Oct 18 13:09:47 2005
New Revision: 9510
Modified:
trunk/dynclasses/gdbmhash.pmc
Log:
GDBMHash now calls Parrot_load_lib() explicitly only on WIN32.
Other platforms should rely on the generated shared lib in 'dynclasses'
Modified: trunk/dynclasses/gdbmhash.pmc
==============================================================================
--- trunk/dynclasses/gdbmhash.pmc (original)
+++ trunk/dynclasses/gdbmhash.pmc Tue Oct 18 13:09:47 2005
@@ -74,7 +74,12 @@ pmclass GDBMHash does hash dynpmc lib gd
=item C<void class_init()>
-Class initialization. Allocates the memory for the hash.
+Class initialization. GDBMHash is a dynamic PMC, meaning that a dynamically
+loadable module is created. On Unix-like systems this is a shared library.
+When it is available, the shared library has linked in the library 'gdbm'.
+
+On WIN32 the relevant library seems to be called 'gdbm3'.
+So we do a bit of cheating here, and load it during class initialization.
=cut
@@ -82,15 +87,11 @@ Class initialization. Allocates the memo
void class_init() {
if (pass) {
- /* XXX: Name of the lib should be configurable */
#ifdef WIN32
+ /* XXX: What if libgdbm.so cannot be loaded */
+ /* Parrot_load_lib(INTERP, slib, NULL); */
STRING *slib = string_from_cstring(INTERP, "gdbm3", 0);
-#else
- STRING *slib = string_from_cstring(INTERP, "libgdbm", 0);
#endif
-
- /* XXX: What if libgdbm.so cannot be loaded */
- Parrot_load_lib(INTERP, slib, NULL);
}
}