On Fri, Feb 21, 2003 at 07:18:37PM -0800, Keith Packard wrote:
>
>Around 17 o'clock on Feb 21, David Dawes wrote:
>
>> The attached patch attempts to implement the second approach, and from
>> some limited testing it works OK for the two cases handled so far (where
>> setjmp is available directly as a function, and the glibc 2.[01] case
>> where it's a macro defined as above).
>
>I think you're on the right track -- create a macro which invokes 
>different functions depending on the underlying libc.  I think we can do 
>it with smaller changes, and no magic GCC pragmas.  See attached.

The '#pragma weak' was only used as a short cut.  To be more portable,
dummy functions that FatalError() would be provided in the case where
the incorrect one for the OS gets called.  As for the other changes, I
opted to keep the "xf86setjmp" entry point rather than use it as the
macro name.  Although it probably doesn't matter much, this would allow
older modules that use setjmp to work in thoses cases where the old
xf86jmp_buf size was large enough.

>Alternatively, we could admit that this is all very OS dependent and
>#include <stdjmp.h> in the application, then all we need do is add
>SYMFUNC's for the actual underlying function names in xf86sym.c (and not
>for the ones not present on the system) and things should work as expected.
>
>Modules built for another OS would fail to resolve the expected symbol and 
>crash as soon as setjmp was invoked.

If we run into cases that can't reasonably be handled, then that's our
fallback.  So far it looks managable.

David
--
David Dawes
Release Engineer/Architect                      The XFree86 Project
www.XFree86.org/~dawes
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to