ObjFW  Diff

Differences From Artifact [03684c47f6]:

To Artifact [ca3819c013]:


21
22
23
24
25
26
27














28
29
30
31
32
33
34
#import "private.h"
#import "macros.h"

#include <proto/exec.h>
#include <stdio.h>
#include <stdlib.h>















struct Library *ObjFWRTBase;

static void __attribute__((__constructor__))
init(void)
{
	static bool initialized = false;
	static struct objc_libc libc;







>
>
>
>
>
>
>
>
>
>
>
>
>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#import "private.h"
#import "macros.h"

#include <proto/exec.h>
#include <stdio.h>
#include <stdlib.h>

extern int _Unwind_RaiseException(void *);
extern void _Unwind_DeleteException(void *);
extern void *_Unwind_GetLanguageSpecificData(void *);
extern uintptr_t _Unwind_GetRegionStart(void *);
extern uintptr_t _Unwind_GetDataRelBase(void *);
extern uintptr_t _Unwind_GetTextRelBase(void *);
extern uintptr_t _Unwind_GetIP(void *);
extern uintptr_t _Unwind_GetGR(void *, int);
extern void _Unwind_SetIP(void *, uintptr_t);
extern void _Unwind_SetGR(void *, int, uintptr_t);
extern void _Unwind_Resume(void *);
extern void __register_frame_info(const void *, void *);
extern void __deregister_frame_info(const void *);

struct Library *ObjFWRTBase;

static void __attribute__((__constructor__))
init(void)
{
	static bool initialized = false;
	static struct objc_libc libc;
46
47
48
49
50
51
52














53
54
55
56
57
58
59
		.calloc = calloc,
		.realloc = realloc,
		.free = free,
		.vfprintf = vfprintf,
		.fputs = fputs,
		.exit = exit,
		.abort = abort,














		.stdout_ = stdout,
		.stderr_ = stderr
	};
	objc_init(&libc);

	initialized = true;
}







>
>
>
>
>
>
>
>
>
>
>
>
>
>







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
		.calloc = calloc,
		.realloc = realloc,
		.free = free,
		.vfprintf = vfprintf,
		.fputs = fputs,
		.exit = exit,
		.abort = abort,
		._Unwind_RaiseException = _Unwind_RaiseException,
		._Unwind_DeleteException = _Unwind_DeleteException,
		._Unwind_GetLanguageSpecificData =
		    _Unwind_GetLanguageSpecificData,
		._Unwind_GetRegionStart = _Unwind_GetRegionStart,
		._Unwind_GetDataRelBase = _Unwind_GetDataRelBase,
		._Unwind_GetTextRelBase = _Unwind_GetTextRelBase,
		._Unwind_GetIP = _Unwind_GetIP,
		._Unwind_GetGR = _Unwind_GetGR,
		._Unwind_SetIP = _Unwind_SetIP,
		._Unwind_SetGR = _Unwind_SetGR,
		._Unwind_Resume = _Unwind_Resume,
		.__register_frame_info = __register_frame_info,
		.__deregister_frame_info = __deregister_frame_info,
		.stdout_ = stdout,
		.stderr_ = stderr
	};
	objc_init(&libc);

	initialized = true;
}
128
129
130
131
132
133
134





135






136
137
138
139
140
141
142
{
	return glue_objc_get_class(name);
}

void
objc_exception_throw(id object)
{





	glue_objc_exception_throw(object);







	OF_UNREACHABLE
}

int
objc_sync_enter(id object)
{







>
>
>
>
>
|
>
>
>
>
>
>







156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
{
	return glue_objc_get_class(name);
}

void
objc_exception_throw(id object)
{
	/*
	 * This does not use the glue code to hack around a compiler bug.
	 *
	 * When using the generated inline stubs, the compiler does not emit
	 * any frame information, making the unwind fail. As unwind always
	 * starts from objc_exception_throw(), this means exceptions would
	 * never work. If, however, we're using a function pointer instead of
	 * the inline stub, the compiler does generate a frame and everything
	 * works fine.
	 */
	uintptr_t throw = (((uintptr_t)ObjFWRTBase) - 0x60);
	((void (*)(id OBJC_M68K_REG("a0")))throw)(object);

	OF_UNREACHABLE
}

int
objc_sync_enter(id object)
{
177
178
179
180
181
182
183








}

void
objc_enumerationMutation(id obj)
{
	glue_objc_enumerationMutation(obj);
}















>
>
>
>
>
>
>
>
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
}

void
objc_enumerationMutation(id obj)
{
	glue_objc_enumerationMutation(obj);
}

int
__gnu_objc_personality_v0(int version, int actions, uint64_t ex_class,
    void *ex, void *ctx)
{
	return glue___gnu_objc_personality_v0(version, actions, &ex_class,
	    ex, ctx);
}