[Pythonmac-SIG] dynload_next

Marcel Prastawa prastawa@cs.unc.edu
Sat, 26 Jan 2002 14:11:39 -0500


--Apple-Mail-1--594638709
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

I've got dynload_next working with PyOpenGL!

I used libdl's dlopen.c as a reference. The problem appears to be caused 
by the use of NSLookupAndBindSymbol(). I have switched to using 
NSLookupSymbolInModule() instead. I also commented out the quick return.

I have attached the diff file. It is also available at:
http://www.cs.unc.edu/~prastawa/macosx/dynload_next.diff

Can any of you try it out and make sure it doesn't break anything?
I haven't encountered any problems so far.

Marcel

--Apple-Mail-1--594638709
Content-Disposition: attachment;
	filename=dynload_next.diff
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="dynload_next.diff"

33a34
> 
123d123
< 		/*
129d128
< 		*/
154,164c153,154
< 			NSDestroyObjectFileImage(image);
< 
< 			if (newModule == NULL) {
< 			    int errNo;
< 			    char *fileName, *moreErrorStr;
< 			    NSLinkEditErrors c;
< 			    errString = "Failure linking new module";
< 			    NSLinkEditError( &c, &errNo, &fileName, &moreErrorStr );
< 			    errString = strcat( fileName, errString );
< 			    errString = strcat( moreErrorStr, errString );
< 			}
---
> 			if (!newModule)
> 				errString = "Failure linking new module";
170,172c160
< 
< 		theSym = NSLookupSymbolInModule(newModule, funcname);
< 		if (theSym == NULL) {
---
> 		if (!NSIsSymbolNameDefined(funcname)) {
179a168
> 		theSym = NSLookupAndBindSymbol(funcname);

--Apple-Mail-1--594638709--