ObjFW  Diff

Differences From Artifact [141357802d]:

To Artifact [c66c0c6229]:


14
15
16
17
18
19
20
21

22

23
24
25
26
27
28
29
14
15
16
17
18
19
20

21
22
23
24
25
26
27
28
29
30







-
+

+







 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#import "ObjFWRT.h"
#import "private.h"
#import "amiga-library.h"
#import "macros.h"
#import "private.h"

#include <proto/exec.h>

struct ObjFWRTBase;

#import "inline.h"

53
54
55
56
57
58
59

60
61

62
63
64
65
66
67
68
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71







+


+







extern void _Unwind_SetIP(void *, uintptr_t);
extern void _Unwind_SetGR(void *, int, uintptr_t);
#ifdef HAVE_SJLJ_EXCEPTIONS
extern void _Unwind_SjLj_Resume(void *);
#else
extern void _Unwind_Resume(void *);
#endif
#ifdef OF_AMIGAOS_M68K
extern void __register_frame_info(const void *, void *);
extern void *__deregister_frame_info(const void *);
#endif

struct Library *ObjFWRTBase;
void *__objc_class_name_Protocol;

static void __attribute__((__used__))
ctor(void)
{
91
92
93
94
95
96
97

98
99

100
101
102
103
104
105
106





107

108
109
110
111
112








113
114
115
116
117
118
119
94
95
96
97
98
99
100
101
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
129
130
131
132
133
134
135







+


+







+
+
+
+
+
-
+



-
-
+
+
+
+
+
+
+
+







		._Unwind_SetIP = _Unwind_SetIP,
		._Unwind_SetGR = _Unwind_SetGR,
#ifdef HAVE_SJLJ_EXCEPTIONS
		._Unwind_SjLj_Resume = _Unwind_SjLj_Resume,
#else
		._Unwind_Resume = _Unwind_Resume,
#endif
#ifdef OF_AMIGAOS_M68K
		.__register_frame_info = __register_frame_info,
		.__deregister_frame_info = __deregister_frame_info,
#endif
	};

	if (initialized)
		return;

	if ((ObjFWRTBase = OpenLibrary(OBJFWRT_AMIGA_LIB,
	    OBJFWRT_LIB_MINOR)) == NULL) {
		/*
		 * The linklib is used by objfw(68k).library as well, so we
		 * can't have the compiler optimize this to another function,
		 * hence the use of an unnecessary format specifier.
		 */
		fputs("Failed to open " OBJFWRT_AMIGA_LIB "!\n", stderr);
		fprintf(stderr, "Failed to open %s!\n", OBJFWRT_AMIGA_LIB);
		abort();
	}

	if (!glue_objc_init(1, &libc, stdout, stderr)) {
		fputs("Failed to initialize " OBJFWRT_AMIGA_LIB "!\n", stderr);
	if (!glue_objc_init(1, &libc, __sF)) {
		/*
		 * The linklib is used by objfw(68k).library as well, so we
		 * can't have the compiler optimize this to another function,
		 * hence the use of an unnecessary format specifier.
		 */
		fprintf(stderr, "Failed to initialize %s!\n",
		    OBJFWRT_AMIGA_LIB);
		abort();
	}

	initialized = true;
}

static void __attribute__((__used__))