ObjFW  Check-in [b50dc283cf]

Overview
Comment:Add _Unwind_Backtrace to amiga-library.m
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | amiga-library
Files: files | file ages | folders
SHA3-256: b50dc283cf3ac73234862c1c18263b02c0ced9f06000f83aacfada732199ffcd
User & Date: js on 2020-06-07 18:27:49
Other Links: branch diff | manifest | tags
Context
2020-06-07
20:25
Switch to -fbaserel32 and -resident32 check-in: 35cec55099 user: js tags: amiga-library
18:27
Add _Unwind_Backtrace to amiga-library.m check-in: b50dc283cf user: js tags: amiga-library
16:53
Add __(de)register_frame_info to amiga-library.m check-in: 45a8b2333d user: js tags: amiga-library
Changes

Modified src/amiga-library.h from [2c7d9984f0] to [3e0d609d4b].

68
69
70
71
72
73
74


75
76
77
78
# endif

	/* Needed only by ObjFW. */
	int (*_Nonnull vsnprintf)(const char *_Nonnull restrict, size_t,
	    const char *_Nonnull restrict, va_list);
	void (*_Nonnull exit)(int);
	char *_Nullable (*_Nonnull setlocale)(int, const char *_Nullable);


};

extern bool of_init(unsigned int version, struct of_libc *libc, FILE **sF);
#endif







>
>




68
69
70
71
72
73
74
75
76
77
78
79
80
# endif

	/* Needed only by ObjFW. */
	int (*_Nonnull vsnprintf)(const char *_Nonnull restrict, size_t,
	    const char *_Nonnull restrict, va_list);
	void (*_Nonnull exit)(int);
	char *_Nullable (*_Nonnull setlocale)(int, const char *_Nullable);
	int (*_Nonnull _Unwind_Backtrace)(int (*_Nonnull)(void *_Nonnull,
	    void *_Null_unspecified), void *_Null_unspecified);
};

extern bool of_init(unsigned int version, struct of_libc *libc, FILE **sF);
#endif

Modified src/amiga-library.m from [5d844627f0] to [35e8c01732].

535
536
537
538
539
540
541






542
543
544
545
546
547
548
}

char *
setlocale(int category, const char *locale)
{
	return libc.setlocale(category, locale);
}







#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
static CONST_APTR functionTable[] = {
#ifdef OF_MORPHOS
	(CONST_APTR)FUNCARRAY_BEGIN,
	(CONST_APTR)FUNCARRAY_32BIT_NATIVE,







>
>
>
>
>
>







535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
}

char *
setlocale(int category, const char *locale)
{
	return libc.setlocale(category, locale);
}

int
_Unwind_Backtrace(int (*callback)(void *, void *), void *data)
{
	return libc._Unwind_Backtrace(callback, data);
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
static CONST_APTR functionTable[] = {
#ifdef OF_MORPHOS
	(CONST_APTR)FUNCARRAY_BEGIN,
	(CONST_APTR)FUNCARRAY_32BIT_NATIVE,

Modified src/runtime/linklib/linklib.m from [4b66b4aaff] to [05fa7a50e6].

104
105
106
107
108
109
110





111
112
113
114
115





116
117
118
119
120
121
122
	};

	if (initialized)
		return;

	if ((ObjFWRTBase = OpenLibrary(OBJFWRT_AMIGA_LIB,
	    OBJFWRT_LIB_MINOR)) == NULL) {





		fprintf(stderr, "Failed to open %s!\n", OBJFWRT_AMIGA_LIB);
		abort();
	}

	if (!glue_objc_init(1, &libc, __sF)) {





		fprintf(stderr, "Failed to initialize %s!\n",
		    OBJFWRT_AMIGA_LIB);
		abort();
	}

	initialized = true;
}







>
>
>
>
>





>
>
>
>
>







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
	};

	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.
		 */
		fprintf(stderr, "Failed to open %s!\n", OBJFWRT_AMIGA_LIB);
		abort();
	}

	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;
}