Differences From Artifact [ca1be9d395]:
- File
src/exceptions/OFException.m
— part of check-in
[dddeff64f8]
at
2015-05-14 09:34:57
on branch trunk
— OFException.m: Fix missing includes
Some systems declare strerror() and strerror_r() in string.h, others in
stdio.h. (user: js, size: 6552) [annotate] [blame] [check-ins using]
To Artifact [ef5117f29b]:
- File src/exceptions/OFException.m — part of check-in [1ba08eebc5] at 2015-10-19 22:15:13 on branch trunk — Add platform.h & make platform defines consistent (user: js, size: 6506) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
34 35 36 37 38 39 40 | #import "OFLockFailedException.h" #import "OFUnlockFailedException.h" #if !defined(HAVE_STRERROR_R) && defined(OF_HAVE_THREADS) # import "threading.h" #endif | | | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #import "OFLockFailedException.h" #import "OFUnlockFailedException.h" #if !defined(HAVE_STRERROR_R) && defined(OF_HAVE_THREADS) # import "threading.h" #endif #if defined(OF_WINDOWS) && defined(OF_HAVE_SOCKETS) # include <winerror.h> #endif /* * Define HAVE_DWARF_EXCEPTIONS if OBJC_ZEROCOST_EXCEPTIONS is defined, but * don't do so on iOS, as it is defined there even if SjLj exceptions are used. */ |
︙ | ︙ | |||
70 71 72 73 74 75 76 | struct backtrace_ctx { void **backtrace; uint_fast8_t i; }; extern _Unwind_Reason_Code _Unwind_Backtrace( _Unwind_Reason_Code(*)(struct _Unwind_Context*, void*), void*); | | | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | struct backtrace_ctx { void **backtrace; uint_fast8_t i; }; extern _Unwind_Reason_Code _Unwind_Backtrace( _Unwind_Reason_Code(*)(struct _Unwind_Context*, void*), void*); # ifdef OF_ARM extern int _Unwind_VRS_Get(struct _Unwind_Context*, int, uint32_t, int, void*); # else extern uintptr_t _Unwind_GetIP(struct _Unwind_Context*); # endif #endif #if !defined(HAVE_STRERROR_R) && defined(OF_HAVE_THREADS) |
︙ | ︙ | |||
96 97 98 99 100 101 102 | of_strerror(int errNo) { OFString *ret; #ifdef HAVE_STRERROR_R char buffer[256]; #endif | | | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | of_strerror(int errNo) { OFString *ret; #ifdef HAVE_STRERROR_R char buffer[256]; #endif #ifdef OF_WINDOWS /* * These were translated from WSAE* errors to errno and thus Win32's * strerror_r() does not know about them. * * FIXME: These could have better descriptions! */ switch (errNo) { |
︙ | ︙ | |||
211 212 213 214 215 216 217 | #ifdef HAVE_DWARF_EXCEPTIONS static _Unwind_Reason_Code backtrace_callback(struct _Unwind_Context *ctx, void *data) { struct backtrace_ctx *bt = data; if (bt->i < OF_BACKTRACE_SIZE) { | | | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | #ifdef HAVE_DWARF_EXCEPTIONS static _Unwind_Reason_Code backtrace_callback(struct _Unwind_Context *ctx, void *data) { struct backtrace_ctx *bt = data; if (bt->i < OF_BACKTRACE_SIZE) { # ifdef OF_ARM uintptr_t ip; _Unwind_VRS_Get(ctx, 0, 15, 0, &ip); bt->backtrace[bt->i++] = (void*)(ip & ~1); # else bt->backtrace[bt->i++] = (void*)_Unwind_GetIP(ctx); # endif |
︙ | ︙ |