Re: Making GModule use GError.



Sebastian Wilhelmi <wilhelmi ira uka de> writes:

> Hi,
> 
> to achieve a greater consistency (at the cost of backward compatibility) I
> make the proposal to let GModule use GError functions instead of the rather
> bad (IMHO) g_module_error () func. Attached is a patch, that implements it for
> now only for gmodule-dl.c (i.e. Linux, Solaris, etc.), but if approved I would
> of course change it for the other platforms too and the documentation as well.
> 
> For now I only introduced 3 errors:
> 
> G_MODULE_ERROR_UNKNOWN_SYMBOL,
> G_MODULE_ERROR_INIT_CHECK,
> G_MODULE_ERROR_FAILED
> 
> because in fact dl_error doesn't give us error codes (extremely stupid in the
> first place, I think!), so we can not be any more precise (only in string
> format again, which we simply copy from dl_error).

While GModule would use GError if written from scratch, I tend to
think that the consistency benefits of changing at this point
are not worth breaking substantial amounts of existing code; 
I don't think there is any real gain in functionality from 
this.

(I guess the one gain in functionality is proper threaded operation,
but dlerror() probably uses per-thread data on thread-safe
C libraries anyways.)

That's my opinion anyways,
                                        Owen




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