ObjFW  Check-in [f0c9c3a9f7]

Overview
Comment:runtime: Fix missing _t suffix in types
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f0c9c3a9f75254f5ea27083479e8bba411d93e0ad23eff848bd96c47bcf655f5
User & Date: js on 2019-04-21 17:26:22
Other Links: manifest | tags
Context
2019-04-21
21:41
.travis.yml: Disable Amiga till amiga-gcc is fixed check-in: 09382029f6 user: js tags: trunk
17:26
runtime: Fix missing _t suffix in types check-in: f0c9c3a9f7 user: js tags: trunk
09:58
Fix compilation on AmigaOS 4 with 53.30 SDK check-in: 50a6ffd4b1 user: js tags: trunk
Changes

Modified src/runtime/ObjFW_RT.h from [9b77c85f63] to [ae5ec75af6].

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
typedef struct objc_class *Class;
typedef struct objc_object *id;
typedef const struct objc_selector *SEL;
#if !defined(__wii__) && !defined(__amigaos__)
typedef bool BOOL;
#endif
typedef id _Nullable (*IMP)(id _Nonnull, SEL _Nonnull, ...);
typedef void (*objc_uncaught_exception_handler)(id _Nullable);
typedef void (*objc_enumeration_mutation_handler)(id _Nonnull);

struct objc_class {
	Class _Nonnull isa;
	Class _Nullable superclass;
	const char *_Nonnull name;
	unsigned long version;
	unsigned long info;







|
|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
typedef struct objc_class *Class;
typedef struct objc_object *id;
typedef const struct objc_selector *SEL;
#if !defined(__wii__) && !defined(__amigaos__)
typedef bool BOOL;
#endif
typedef id _Nullable (*IMP)(id _Nonnull, SEL _Nonnull, ...);
typedef void (*objc_uncaught_exception_handler_t)(id _Nullable);
typedef void (*objc_enumeration_mutation_handler_t)(id _Nonnull);

struct objc_class {
	Class _Nonnull isa;
	Class _Nullable superclass;
	const char *_Nonnull name;
	unsigned long version;
	unsigned long info;
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
extern const char *_Nullable object_getClassName(id _Nullable object);
extern const char *_Nonnull protocol_getName(Protocol *_Nonnull protocol);
extern bool protocol_isEqual(Protocol *_Nonnull protocol1,
    Protocol *_Nonnull protocol2);
extern bool protocol_conformsToProtocol(Protocol *_Nonnull protocol1,
    Protocol *_Nonnull protocol2);
extern void objc_exit(void);
extern _Nullable objc_uncaught_exception_handler
    objc_setUncaughtExceptionHandler(
    objc_uncaught_exception_handler _Nullable handler);
extern void objc_setForwardHandler(IMP _Nullable forward,
    IMP _Nullable stretForward);
extern void objc_setEnumerationMutationHandler(
    objc_enumeration_mutation_handler _Nullable handler);
extern void objc_zero_weak_references(id _Nonnull value);

/*
 * Used by the compiler, but can also be called manually.
 *
 * These declarations are also required to prevent Clang's implicit
 * declarations which include __declspec(dllimport) on Windows.







|

|



|







247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
extern const char *_Nullable object_getClassName(id _Nullable object);
extern const char *_Nonnull protocol_getName(Protocol *_Nonnull protocol);
extern bool protocol_isEqual(Protocol *_Nonnull protocol1,
    Protocol *_Nonnull protocol2);
extern bool protocol_conformsToProtocol(Protocol *_Nonnull protocol1,
    Protocol *_Nonnull protocol2);
extern void objc_exit(void);
extern _Nullable objc_uncaught_exception_handler_t
    objc_setUncaughtExceptionHandler(
    objc_uncaught_exception_handler_t _Nullable handler);
extern void objc_setForwardHandler(IMP _Nullable forward,
    IMP _Nullable stretForward);
extern void objc_setEnumerationMutationHandler(
    objc_enumeration_mutation_handler_t _Nullable handler);
extern void objc_zero_weak_references(id _Nonnull value);

/*
 * Used by the compiler, but can also be called manually.
 *
 * These declarations are also required to prevent Clang's implicit
 * declarations which include __declspec(dllimport) on Windows.

Modified src/runtime/ObjFW_RT.sfd from [89f9a86100] to [ae80bac89b].

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Class _Nullable object_getClass_m68k(id _Nullable object)(a0)
Class _Nullable object_setClass_m68k(id _Nullable object, Class _Nonnull class_)(a0,a1)
const char *_Nullable object_getClassName_m68k(id _Nullable object)(a0)
const char *_Nonnull protocol_getName_m68k(Protocol *_Nonnull protocol)(a0)
bool protocol_isEqual_m68k(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2)(a0,a1)
bool protocol_conformsToProtocol_m68k(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2)(a0,a1)
void objc_exit_m68k(void)()
_Nullable objc_uncaught_exception_handler objc_setUncaughtExceptionHandler_m68k(objc_uncaught_exception_handler _Nullable handler)(a0)
void objc_setForwardHandler_m68k(IMP _Nullable forward, IMP _Nullable stretForward)(a0,a1)
void objc_setEnumerationMutationHandler_m68k(objc_enumeration_mutation_handler _Nullable handler)(a0)
void objc_zero_weak_references_m68k(id _Nonnull value)(a0)
* SysV functions for MorphOS could be added here for performance. Having them
* in addition to the m68k functions allows m68k applications to call into the
* PPC library, while native code can use the SysV functions.
==end







|

|





67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Class _Nullable object_getClass_m68k(id _Nullable object)(a0)
Class _Nullable object_setClass_m68k(id _Nullable object, Class _Nonnull class_)(a0,a1)
const char *_Nullable object_getClassName_m68k(id _Nullable object)(a0)
const char *_Nonnull protocol_getName_m68k(Protocol *_Nonnull protocol)(a0)
bool protocol_isEqual_m68k(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2)(a0,a1)
bool protocol_conformsToProtocol_m68k(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2)(a0,a1)
void objc_exit_m68k(void)()
_Nullable objc_uncaught_exception_handler_t objc_setUncaughtExceptionHandler_m68k(objc_uncaught_exception_handler_t _Nullable handler)(a0)
void objc_setForwardHandler_m68k(IMP _Nullable forward, IMP _Nullable stretForward)(a0,a1)
void objc_setEnumerationMutationHandler_m68k(objc_enumeration_mutation_handler_t _Nullable handler)(a0)
void objc_zero_weak_references_m68k(id _Nonnull value)(a0)
* SysV functions for MorphOS could be added here for performance. Having them
* in addition to the m68k functions allows m68k applications to call into the
* PPC library, while native code can use the SysV functions.
==end

Modified src/runtime/amiga-glue.m from [6e9a75e691] to [60e61a9415].

569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607

void __saveds
objc_exit_m68k(void)
{
	objc_exit();
}

objc_uncaught_exception_handler __saveds
objc_setUncaughtExceptionHandler_m68k(void)
{
	OBJC_M68K_ARG(objc_uncaught_exception_handler, handler, a0)

	return objc_setUncaughtExceptionHandler(handler);
}

void __saveds
objc_setForwardHandler_m68k(void)
{
	OBJC_M68K_ARG(IMP, forward, a0)
	OBJC_M68K_ARG(IMP, stretForward, a1)

	objc_setForwardHandler(forward, stretForward);
}

void __saveds
objc_setEnumerationMutationHandler_m68k(void)
{
	OBJC_M68K_ARG(objc_enumeration_mutation_handler, handler, a0)

	objc_setEnumerationMutationHandler(handler);
}

void __saveds
objc_zero_weak_references_m68k(void)
{
	OBJC_M68K_ARG(id, value, a0)

	objc_zero_weak_references(value);
}







|


|
















|











569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607

void __saveds
objc_exit_m68k(void)
{
	objc_exit();
}

objc_uncaught_exception_handler_t __saveds
objc_setUncaughtExceptionHandler_m68k(void)
{
	OBJC_M68K_ARG(objc_uncaught_exception_handler_t, handler, a0)

	return objc_setUncaughtExceptionHandler(handler);
}

void __saveds
objc_setForwardHandler_m68k(void)
{
	OBJC_M68K_ARG(IMP, forward, a0)
	OBJC_M68K_ARG(IMP, stretForward, a1)

	objc_setForwardHandler(forward, stretForward);
}

void __saveds
objc_setEnumerationMutationHandler_m68k(void)
{
	OBJC_M68K_ARG(objc_enumeration_mutation_handler_t, handler, a0)

	objc_setEnumerationMutationHandler(handler);
}

void __saveds
objc_zero_weak_references_m68k(void)
{
	OBJC_M68K_ARG(id, value, a0)

	objc_zero_weak_references(value);
}

Modified src/runtime/amiga-library.m from [9f8ec83747] to [c8fedb16aa].

119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
extern Class _Nullable object_getClass_m68k(void);
extern Class _Nullable object_setClass_m68k(void);
extern const char *_Nullable object_getClassName_m68k(void);
extern const char *_Nonnull protocol_getName_m68k(void);
extern bool protocol_isEqual_m68k(void);
extern bool protocol_conformsToProtocol_m68k(void);
extern void objc_exit_m68k(void);
extern _Nullable objc_uncaught_exception_handler
    objc_setUncaughtExceptionHandler_m68k(void);
extern void objc_setForwardHandler_m68k(void);
extern void objc_setEnumerationMutationHandler_m68k(void);
extern void objc_zero_weak_references_m68k(void);

#ifdef OF_MORPHOS
const ULONG __abox__ = 1;







|







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
extern Class _Nullable object_getClass_m68k(void);
extern Class _Nullable object_setClass_m68k(void);
extern const char *_Nullable object_getClassName_m68k(void);
extern const char *_Nonnull protocol_getName_m68k(void);
extern bool protocol_isEqual_m68k(void);
extern bool protocol_conformsToProtocol_m68k(void);
extern void objc_exit_m68k(void);
extern _Nullable objc_uncaught_exception_handler_t
    objc_setUncaughtExceptionHandler_m68k(void);
extern void objc_setForwardHandler_m68k(void);
extern void objc_setEnumerationMutationHandler_m68k(void);
extern void objc_zero_weak_references_m68k(void);

#ifdef OF_MORPHOS
const ULONG __abox__ = 1;

Modified src/runtime/exception.m from [9119c3ea09] to [ef7a9d3c88].

237
238
239
240
241
242
243
244
245
246
247
248
249
250
251

#ifdef HAVE_SEH_EXCEPTIONS
extern EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *,
    PCONTEXT, PDISPATCHER_CONTEXT, _Unwind_Reason_Code (*)(int, int, uint64_t,
    struct _Unwind_Exception *, struct _Unwind_Context *));
#endif

static objc_uncaught_exception_handler uncaughtExceptionHandler;
static struct objc_exception emergencyExceptions[NUM_EMERGENCY_EXCEPTIONS];
#ifdef OF_HAVE_THREADS
static of_spinlock_t emergencyExceptionsSpinlock;

OF_CONSTRUCTOR()
{
	if (!of_spinlock_new(&emergencyExceptionsSpinlock))







|







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251

#ifdef HAVE_SEH_EXCEPTIONS
extern EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *,
    PCONTEXT, PDISPATCHER_CONTEXT, _Unwind_Reason_Code (*)(int, int, uint64_t,
    struct _Unwind_Exception *, struct _Unwind_Context *));
#endif

static objc_uncaught_exception_handler_t uncaughtExceptionHandler;
static struct objc_exception emergencyExceptions[NUM_EMERGENCY_EXCEPTIONS];
#ifdef OF_HAVE_THREADS
static of_spinlock_t emergencyExceptionsSpinlock;

OF_CONSTRUCTOR()
{
	if (!of_spinlock_new(&emergencyExceptionsSpinlock))
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
	if (_Unwind_RaiseException(&e->exception) == _URC_END_OF_STACK &&
	    uncaughtExceptionHandler != NULL)
		uncaughtExceptionHandler(object);

	OBJC_ERROR("_Unwind_RaiseException() returned!")
}

objc_uncaught_exception_handler
objc_setUncaughtExceptionHandler(objc_uncaught_exception_handler handler)
{
	objc_uncaught_exception_handler old = uncaughtExceptionHandler;
	uncaughtExceptionHandler = handler;

	return old;
}

#ifdef HAVE_SEH_EXCEPTIONS
typedef EXCEPTION_DISPOSITION (*seh_personality_fn)(PEXCEPTION_RECORD, void *,







|
|

|







757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
	if (_Unwind_RaiseException(&e->exception) == _URC_END_OF_STACK &&
	    uncaughtExceptionHandler != NULL)
		uncaughtExceptionHandler(object);

	OBJC_ERROR("_Unwind_RaiseException() returned!")
}

objc_uncaught_exception_handler_t
objc_setUncaughtExceptionHandler(objc_uncaught_exception_handler_t handler)
{
	objc_uncaught_exception_handler_t old = uncaughtExceptionHandler;
	uncaughtExceptionHandler = handler;

	return old;
}

#ifdef HAVE_SEH_EXCEPTIONS
typedef EXCEPTION_DISPOSITION (*seh_personality_fn)(PEXCEPTION_RECORD, void *,

Modified src/runtime/linklib/linklib.m from [219475a078] to [d6e0a7e003].

542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571

void
objc_exit(void)
{
	objc_exit_m68k();
}

objc_uncaught_exception_handler
objc_setUncaughtExceptionHandler(objc_uncaught_exception_handler handler)
{
	return objc_setUncaughtExceptionHandler_m68k(handler);
}

void
objc_setForwardHandler(IMP forward, IMP stretForward)
{
	objc_setForwardHandler_m68k(forward, stretForward);
}

void
objc_setEnumerationMutationHandler(objc_enumeration_mutation_handler handler)
{
	objc_setEnumerationMutationHandler_m68k(handler);
}

void
objc_zero_weak_references(id value)
{
	objc_zero_weak_references_m68k(value);
}







|
|











|









542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571

void
objc_exit(void)
{
	objc_exit_m68k();
}

objc_uncaught_exception_handler_t
objc_setUncaughtExceptionHandler(objc_uncaught_exception_handler_t handler)
{
	return objc_setUncaughtExceptionHandler_m68k(handler);
}

void
objc_setForwardHandler(IMP forward, IMP stretForward)
{
	objc_setForwardHandler_m68k(forward, stretForward);
}

void
objc_setEnumerationMutationHandler(objc_enumeration_mutation_handler_t handler)
{
	objc_setEnumerationMutationHandler_m68k(handler);
}

void
objc_zero_weak_references(id value)
{
	objc_zero_weak_references_m68k(value);
}

Modified src/runtime/misc.m from [ec4648bae1] to [09fc423a7b].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

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

#include "ObjFW_RT.h"
#include "private.h"

static objc_enumeration_mutation_handler enumerationMutationHandler = NULL;

void
objc_enumerationMutation(id object)
{
	if (enumerationMutationHandler != NULL)
		enumerationMutationHandler(object);
	else
		OBJC_ERROR("Object was mutated during enumeration!");
}

void
objc_setEnumerationMutationHandler(objc_enumeration_mutation_handler handler)
{
	enumerationMutationHandler = handler;
}







|











|



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

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

#include "ObjFW_RT.h"
#include "private.h"

static objc_enumeration_mutation_handler_t enumerationMutationHandler = NULL;

void
objc_enumerationMutation(id object)
{
	if (enumerationMutationHandler != NULL)
		enumerationMutationHandler(object);
	else
		OBJC_ERROR("Object was mutated during enumeration!");
}

void
objc_setEnumerationMutationHandler(objc_enumeration_mutation_handler_t handler)
{
	enumerationMutationHandler = handler;
}