Hi,
Oliver Braun wrote:
> Hi Philipp,
>
> Philipp Lohmann - Sun Germany wrote:
>> RTLD_DEFAULT is "((void *) 0)" on Linux, so this would be hard to
>> distinguish from NULL.
> Good point. I only checked Solaris, where it is defined as "(void *)-2".
>> -1 on the other hand is RTLD_NEXT, so perhaps we
>> should use another invalid pointer value to show failure. Or perhaps the
>> API should look like
>>
>> sal_Bool CALL osl_getModuleHandle(rtl_uString *strModuleName, oslModule*
>> pResult );
>>
>> where the return value details success/failure and the result is
>> returned via the second parameter.
>>
> Since osl_getModuleHandle simply can not fail on unix, another option
> would be to always return '-1' and map this to RTLD_DEFAULT in
> osl_getAsciiFunctionSymbol.
>
> What do you think ?
Well, that happens to be RTLD_NEXT on Linux. This would not be a problem
currently, but could become insurmountable if we ever want to use
RTLD_NEXT. I suggest separating returned handle and and error handling;
IMHO the sal_Bool (rtl_uString*,oslModule*) is the right thing to do.
Kind regards, pl
--
If you give someone a program, you will frustrate them for a day;
if you teach them how to program, you will frustrate them for a lifetime.
-- Author unknown
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]