diff --git a/include/unwind.h b/include/unwind.h index d9a767d..ed01435 100644 --- a/include/unwind.h +++ b/include/unwind.h @@ -26,6 +26,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _UNWIND_H #define _UNWIND_H +/* uint64_t */ +#include +uint64_t x; + #ifdef __cplusplus extern "C" { #endif @@ -62,7 +66,7 @@ typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, struct _Unwind_Exception *); typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action, - unsigned long, + uint64_t, struct _Unwind_Exception *, struct _Unwind_Context *, void *); @@ -71,14 +75,18 @@ typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action, be of type uint64 and the entire structure to be double-word-aligned, but that seems a bit overly IA-64-specific. Using "unsigned long" instead should give us the desired effect on - IA-64, while being more general. */ + IA-64, while being more general. + + To be compatible with gcc, exception_class stays 64-bit even on 32-bit machines. + See gcc/unwind-generic.h. + */ struct _Unwind_Exception { - unsigned long exception_class; + uint64_t exception_class; _Unwind_Exception_Cleanup_Fn exception_cleanup; unsigned long private_1; unsigned long private_2; - }; + } __attribute__((__aligned__)); extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, diff --git a/src/unwind/RaiseException.c b/src/unwind/RaiseException.c index 5533876..66a681d 100644 --- a/src/unwind/RaiseException.c +++ b/src/unwind/RaiseException.c @@ -28,7 +28,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ PROTECTED _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *exception_object) { - unsigned long exception_class = exception_object->exception_class; + uint64_t exception_class = exception_object->exception_class; _Unwind_Personality_Fn personality; struct _Unwind_Context context; _Unwind_Reason_Code reason; diff --git a/src/unwind/unwind-internal.h b/src/unwind/unwind-internal.h index 169bad5..130cb81 100644 --- a/src/unwind/unwind-internal.h +++ b/src/unwind/unwind-internal.h @@ -38,7 +38,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define _U_VERSION 1 typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn) - (int, _Unwind_Action, unsigned long, struct _Unwind_Exception *, + (int, _Unwind_Action, uint64_t, struct _Unwind_Exception *, struct _Unwind_Context *); struct _Unwind_Context { @@ -59,7 +59,7 @@ _Unwind_Phase2 (struct _Unwind_Exception *exception_object, struct _Unwind_Context *context) { _Unwind_Stop_Fn stop = (_Unwind_Stop_Fn) exception_object->private_1; - unsigned long exception_class = exception_object->exception_class; + uint64_t exception_class = exception_object->exception_class; void *stop_parameter = (void *) exception_object->private_2; _Unwind_Personality_Fn personality; _Unwind_Reason_Code reason;