ObjFW  Check-in [65d8a7c8ed]

Overview
Comment:Ignore OBJC_ZEROCOST_EXCEPTIONS on ARM.

It seems to be defined when targeting 32-bit iOS, even though it does
not use zero-cost exceptions.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 65d8a7c8ed231b2b5dde11a2423d67d4518c8ce2aa46c519fb6385f143c8c71e
User & Date: js on 2013-12-10 01:47:27
Other Links: manifest | tags
Context
2013-12-10
16:21
OFZIP: Add dependency on libobjfw.a if necessary. check-in: 082d1f50c5 user: js tags: trunk
01:47
Ignore OBJC_ZEROCOST_EXCEPTIONS on ARM. check-in: 65d8a7c8ed user: js tags: trunk
2013-12-09
23:35
+[OFFile removeItemAtPath:]: Remove recursively. check-in: 3c2d173940 user: js tags: trunk
Changes

Modified src/exceptions/OFException.m from [76191c1054] to [6a81d34ff8].

31
32
33
34
35
36
37





38




39
40
41
42
43
44
45
#import "autorelease.h"

#if defined(_WIN32) && defined(OF_HAVE_SOCKETS)
# include <errno.h>
# include <winerror.h>
#endif






#if defined(HAVE_DWARF_EXCEPTIONS) || defined(OBJC_ZEROCOST_EXCEPTIONS)




struct _Unwind_Context;
typedef enum {
	_URC_OK		  = 0,
	_URC_END_OF_STACK = 5
}_Unwind_Reason_Code;

struct backtrace_ctx {







>
>
>
>
>
|
>
>
>
>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#import "autorelease.h"

#if defined(_WIN32) && defined(OF_HAVE_SOCKETS)
# include <errno.h>
# include <winerror.h>
#endif

/*
 * Define HAVE_DWARF_EXCEPTIONS if OBJC_ZEROCOST_EXCEPTIONS is defined, but
 * don't do so on 32-bit ARM, as it is defined there even if SjLj exceptions
 * are used.
 */
#if defined(OBJC_ZEROCOST_EXCEPTIONS) && !defined(__ARMEL__)
# define HAVE_DWARF_EXCEPTIONS
#endif

#ifdef HAVE_DWARF_EXCEPTIONS
struct _Unwind_Context;
typedef enum {
	_URC_OK		  = 0,
	_URC_END_OF_STACK = 5
}_Unwind_Reason_Code;

struct backtrace_ctx {
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

@implementation OFException
+ (instancetype)exception
{
	return [[[self alloc] init] autorelease];
}

#if defined(HAVE_DWARF_EXCEPTIONS) || defined(OBJC_ZEROCOST_EXCEPTIONS)
- init
{
	struct backtrace_ctx ctx;

	self = [super init];

	ctx.backtrace = _backtrace;







|







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

@implementation OFException
+ (instancetype)exception
{
	return [[[self alloc] init] autorelease];
}

#ifdef HAVE_DWARF_EXCEPTIONS
- init
{
	struct backtrace_ctx ctx;

	self = [super init];

	ctx.backtrace = _backtrace;
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
{
	return [OFString stringWithFormat:
	    @"An exception of type %@ occurred!", [self class]];
}

- (OFArray*)backtrace
{
#if defined(HAVE_DWARF_EXCEPTIONS) || defined(OBJC_ZEROCOST_EXCEPTIONS)
	OFMutableArray *backtrace = [OFMutableArray array];
	void *pool = objc_autoreleasePoolPush();
	uint_fast8_t i;

	for (i = 0; i < OF_BACKTRACE_SIZE && _backtrace[i] != NULL; i++) {
# ifdef HAVE_DLADDR
		Dl_info info;







|







139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{
	return [OFString stringWithFormat:
	    @"An exception of type %@ occurred!", [self class]];
}

- (OFArray*)backtrace
{
#ifdef HAVE_DWARF_EXCEPTIONS
	OFMutableArray *backtrace = [OFMutableArray array];
	void *pool = objc_autoreleasePoolPush();
	uint_fast8_t i;

	for (i = 0; i < OF_BACKTRACE_SIZE && _backtrace[i] != NULL; i++) {
# ifdef HAVE_DLADDR
		Dl_info info;