[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a better way.



You wrote (in your message from Friday 7)
 > 
 > There's a better way to do this, I know.  Hints?
 > 
 > #ifdef __OpenBSD__
 >   rv = DYN_GetAddress( vHandle, &vFunction, "_IFD_Set_Protocol_Parameters" );
 > #else
 >   rv = DYN_GetAddress( vHandle, &vFunction, "IFD_Set_Protocol_Parameters" );
 > #endif 
 > 
 > DYN_GetAddress is a wrapper around dlopen().
 > 
 > I tried the former on linux, and it dies, and the latter on BSD dies.
 > 
 > If I have to use a #include, is there a preferrable way to using
 > the full OS name, too?

It depends on the executable format, more than on the OS. Usually ELF
doesn't prepend an underscore while a.out does. So '#if
!defined(__ELF__)' is better IMHO. 

Also, it should be the role of DYN_GetAddress() to prepend the
underscore if not ELF. 
-- 
					Matthieu