Hi Oliver,

Oliver Braun wrote:
Philipp Lohmann - Sun Germany wrote

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.

I probably wasn't clear enough.

I think, your initial proposal was clear. But I also think that Philipp's approach is indeed the way to go:

Across the various platforms there appears to exist no special value that could reliably indicate an invalid oslModuleHandle. Thus, another means for signaling success or failure is needed, and the API proposed by Philipp does exactly that.

sal_Bool
SAL_CALL osl_getModuleHandle(
  [in]  rtl_uString * pName,
  [out] oslModuleHandle * pHandle
);

where [out] pHandle would only be valid (regardless of its value), if the function returns TRUE.

I meant something like (pseudo code):
[...]

Just my 2 cents,
Matthias

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to