ObjFW  Diff

Differences From Artifact [127b4c9eeb]:

To Artifact [715e972f4a]:


23
24
25
26
27
28
29




30
31
32
33
34
35
36

#include <proto/exec.h>

#import "inline.h"

#include <stdio.h>
#include <stdlib.h>





#ifdef HAVE_SJLJ_EXCEPTIONS
extern int _Unwind_SjLj_RaiseException(void *);
#else
extern int _Unwind_RaiseException(void *);
#endif
extern void _Unwind_DeleteException(void *);







>
>
>
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

#include <proto/exec.h>

#import "inline.h"

#include <stdio.h>
#include <stdlib.h>

#ifdef OF_AMIGAOS_M68K
# include <stabs.h>
#endif

#ifdef HAVE_SJLJ_EXCEPTIONS
extern int _Unwind_SjLj_RaiseException(void *);
#else
extern int _Unwind_RaiseException(void *);
#endif
extern void _Unwind_DeleteException(void *);
49
50
51
52
53
54
55


56

57
58
59
60
61
62
63
64
#endif
extern void __register_frame_info(const void *, void *);
extern void __deregister_frame_info(const void *);

struct Library *ObjFWRTBase;
void *__objc_class_name_Protocol;



static void __attribute__((__constructor__))

init(void)
{
	static bool initialized = false;
	struct objc_libc libc = {
		.malloc = malloc,
		.calloc = calloc,
		.realloc = realloc,
		.free = free,







>
>
|
>
|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#endif
extern void __register_frame_info(const void *, void *);
extern void __deregister_frame_info(const void *);

struct Library *ObjFWRTBase;
void *__objc_class_name_Protocol;

static void
#ifndef OF_AMIGAOS_M68K
    __attribute__((__constructor__))
#endif
ctor(void)
{
	static bool initialized = false;
	struct objc_libc libc = {
		.malloc = malloc,
		.calloc = calloc,
		.realloc = realloc,
		.free = free,
102
103
104
105
106
107
108

109





110
111
112





113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
		fputs("Failed to initialize objfw_rt.library!\n", stderr);
		abort();
	}

	initialized = true;
}


OF_DESTRUCTOR()





{
	CloseLibrary(ObjFWRTBase);
}






void
__objc_exec_class(void *module)
{
	/*
	 * The compiler generates constructors that call into this, so it is
	 * possible that we are not set up yet when we get called.
	 */
	init();

	__objc_exec_class_m68k(module);
}

IMP
objc_msg_lookup(id obj, SEL sel)
{







>
|
>
>
>
>
>



>
>
>
>
>








|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
		fputs("Failed to initialize objfw_rt.library!\n", stderr);
		abort();
	}

	initialized = true;
}

static void
#ifndef OF_AMIGAOS_M68K
    __attribute__((__destructor__))
#else
    __attribute__((__unused__))
#endif
dtor(void)
{
	CloseLibrary(ObjFWRTBase);
}

#ifdef OF_AMIGAOS_M68K
ADD2INIT(ctor, -2);
ADD2EXIT(dtor, -2);
#endif

void
__objc_exec_class(void *module)
{
	/*
	 * The compiler generates constructors that call into this, so it is
	 * possible that we are not set up yet when we get called.
	 */
	ctor();

	__objc_exec_class_m68k(module);
}

IMP
objc_msg_lookup(id obj, SEL sel)
{