ObjFW  Check-in [abbed5c008]

Overview
Comment:Work around newer amiga-gcc defining Class
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: abbed5c00896ca3c4d43853b01ae48a7181333948d9eed88d7f550e6cdab9661
User & Date: js on 2023-04-10 15:08:39
Other Links: manifest | tags
Context
2023-04-10
18:20
Set OS name on Nintendo Switch and Wii U check-in: be422e156d user: js tags: trunk
15:08
Work around newer amiga-gcc defining Class check-in: abbed5c008 user: js tags: trunk
14:33
Fall back to uselocale() if it's available check-in: 6e786896e0 user: js tags: trunk
Changes

Modified src/OFApplication.m from [7a0cf72c90] to [594a3c0f6e].

51
52
53
54
55
56
57

58
59

60
61
62
63
64
65
66
#if defined(OF_MACOS)
# include <crt_externs.h>
#elif defined(OF_WINDOWS)
# include <windows.h>
extern int _CRT_glob;
extern void __wgetmainargs(int *, wchar_t ***, wchar_t ***, int, int *);
#elif defined(OF_AMIGAOS)

# include <proto/exec.h>
# include <proto/dos.h>

#elif !defined(OF_IOS)
extern char **environ;
#endif

#ifdef OF_PSP
# include <pspkerneltypes.h>
# include <psploadexec.h>







>


>







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#if defined(OF_MACOS)
# include <crt_externs.h>
#elif defined(OF_WINDOWS)
# include <windows.h>
extern int _CRT_glob;
extern void __wgetmainargs(int *, wchar_t ***, wchar_t ***, int, int *);
#elif defined(OF_AMIGAOS)
# define Class IntuitionClass
# include <proto/exec.h>
# include <proto/dos.h>
# undef Class
#elif !defined(OF_IOS)
extern char **environ;
#endif

#ifdef OF_PSP
# include <pspkerneltypes.h>
# include <psploadexec.h>

Modified src/OFFile.m from [cc56c9bcdd] to [a8a92fb395].

44
45
46
47
48
49
50

51
52

53
54
55
56
57
58
59
#import "OFWriteFailedException.h"

#ifdef OF_WINDOWS
# include <windows.h>
#endif

#ifdef OF_AMIGAOS

# include <proto/exec.h>
# include <proto/dos.h>

#endif

#ifdef OF_WII
# include <fat.h>
#endif

#ifdef OF_NINTENDO_DS







>


>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#import "OFWriteFailedException.h"

#ifdef OF_WINDOWS
# include <windows.h>
#endif

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# include <proto/dos.h>
# undef Class
#endif

#ifdef OF_WII
# include <fat.h>
#endif

#ifdef OF_NINTENDO_DS

Modified src/OFFileIRIHandler.m from [bd2c9036f6] to [67787a62da].

80
81
82
83
84
85
86

87
88
89

90
91
92
93
94
95
96
# include <windows.h>
# include <direct.h>
# include <ntdef.h>
# include <wchar.h>
#endif

#ifdef OF_AMIGAOS

# include <proto/exec.h>
# include <proto/dos.h>
# include <proto/locale.h>

# ifdef OF_AMIGAOS4
#  define DeleteFile(path) Delete(path)
# endif
#endif

#if defined(OF_WINDOWS) || defined(OF_AMIGAOS)
typedef struct {







>



>







80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# include <windows.h>
# include <direct.h>
# include <ntdef.h>
# include <wchar.h>
#endif

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# include <proto/dos.h>
# include <proto/locale.h>
# undef Class
# ifdef OF_AMIGAOS4
#  define DeleteFile(path) Delete(path)
# endif
#endif

#if defined(OF_WINDOWS) || defined(OF_AMIGAOS)
typedef struct {

Modified src/OFFileManager.m from [b8c51c0d24] to [b37b88e7db].

64
65
66
67
68
69
70

71
72

73
74
75
76
77
78
79
#ifdef OF_WINDOWS
# include <windows.h>
# include <direct.h>
# include <ntdef.h>
#endif

#ifdef OF_AMIGAOS

# include <proto/exec.h>
# include <proto/dos.h>

#endif

#ifdef OF_MINT
# include <bits/local_lim.h>
#endif

@interface OFDefaultFileManager: OFFileManager







>


>







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifdef OF_WINDOWS
# include <windows.h>
# include <direct.h>
# include <ntdef.h>
#endif

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# include <proto/dos.h>
# undef Class
#endif

#ifdef OF_MINT
# include <bits/local_lim.h>
#endif

@interface OFDefaultFileManager: OFFileManager

Modified src/OFKernelEventObserver.m from [f0b8cf939e] to [65045f52e2].

44
45
46
47
48
49
50

51

52
53
54
55
56
57
58
#endif

#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFOutOfRangeException.h"

#ifdef OF_AMIGAOS

# include <proto/exec.h>

#endif

@implementation OFKernelEventObserver
@synthesize delegate = _delegate;
#ifdef OF_AMIGAOS
@synthesize execSignalMask = _execSignalMask;
#endif







>

>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#endif

#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFOutOfRangeException.h"

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# undef Class
#endif

@implementation OFKernelEventObserver
@synthesize delegate = _delegate;
#ifdef OF_AMIGAOS
@synthesize execSignalMask = _execSignalMask;
#endif

Modified src/OFLocale.m from [792ddc35fc] to [7cfd367431].

26
27
28
29
30
31
32

33
34
35

36
37
38
39
40
41
42

#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFOpenItemFailedException.h"

#ifdef OF_AMIGAOS

# include <proto/dos.h>
# include <proto/exec.h>
# include <proto/locale.h>

#endif

static OFLocale *currentLocale = nil;
static OFDictionary *operatorPrecedences = nil;

#ifndef OF_AMIGAOS
static void







>



>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFOpenItemFailedException.h"

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/dos.h>
# include <proto/exec.h>
# include <proto/locale.h>
# undef Class
#endif

static OFLocale *currentLocale = nil;
static OFDictionary *operatorPrecedences = nil;

#ifndef OF_AMIGAOS
static void

Modified src/OFObject.m from [9eea9ca3cb] to [d0e1cba71d].

60
61
62
63
64
65
66

67

68
69
70
71
72
73
74
#endif

#ifdef OF_WINDOWS
# include <windows.h>
#endif

#ifdef OF_AMIGAOS

# include <proto/exec.h>

#endif

#ifdef OF_APPLE_RUNTIME
extern id _Nullable _objc_rootAutorelease(id _Nullable object);
#endif
#if defined(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR)
extern id OFForward(id, SEL, ...);







>

>







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#endif

#ifdef OF_WINDOWS
# include <windows.h>
#endif

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# undef Class
#endif

#ifdef OF_APPLE_RUNTIME
extern id _Nullable _objc_rootAutorelease(id _Nullable object);
#endif
#if defined(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR)
extern id OFForward(id, SEL, ...);

Modified src/OFOnce.m from [5fdc37c7e4] to [a97e7312a6].

20
21
22
23
24
25
26

27

28
29
30
31
32
33
34
#import "OFOnce.h"
#if defined(OF_HAVE_THREADS) && defined(OF_HAVE_ATOMIC_OPS)
# import "OFAtomic.h"
# import "OFPlainMutex.h"
#endif

#ifdef OF_AMIGAOS

# include <proto/exec.h>

#endif

void
OFOnce(OFOnceControl *control, void (*function)(void))
{
#if !defined(OF_HAVE_THREADS)
	if (*control == 0) {







>

>







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#import "OFOnce.h"
#if defined(OF_HAVE_THREADS) && defined(OF_HAVE_ATOMIC_OPS)
# import "OFAtomic.h"
# import "OFPlainMutex.h"
#endif

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# undef Class
#endif

void
OFOnce(OFOnceControl *control, void (*function)(void))
{
#if !defined(OF_HAVE_THREADS)
	if (*control == 0) {

Modified src/OFSelectKernelEventObserver.m from [50b1098809] to [29596447ca].

34
35
36
37
38
39
40

41

42
43
44
45
46
47
48
#import "OFSocket+Private.h"

#import "OFInitializationFailedException.h"
#import "OFObserveKernelEventsFailedException.h"
#import "OFOutOfRangeException.h"

#ifdef OF_AMIGAOS

# include <proto/exec.h>

#endif

#ifdef OF_HPUX
/* FD_SET causes warnings on HP-UX/IA64. */
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif








>

>







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#import "OFSocket+Private.h"

#import "OFInitializationFailedException.h"
#import "OFObserveKernelEventsFailedException.h"
#import "OFOutOfRangeException.h"

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# undef Class
#endif

#ifdef OF_HPUX
/* FD_SET causes warnings on HP-UX/IA64. */
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif

Modified src/OFSocket.m from [ade572cc8e] to [70652127c8].

49
50
51
52
53
54
55

56

57
58
59
60
61
62
63
#import "OFUnlockFailedException.h"

#ifdef HAVE_NET_IF_H
# include <net/if.h>
#endif

#ifdef OF_AMIGAOS

# include <proto/exec.h>

#endif

#ifdef OF_NINTENDO_3DS
# include <3ds/types.h>
# include <3ds/services/soc.h>
#endif








>

>







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#import "OFUnlockFailedException.h"

#ifdef HAVE_NET_IF_H
# include <net/if.h>
#endif

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# undef Class
#endif

#ifdef OF_NINTENDO_3DS
# include <3ds/types.h>
# include <3ds/services/soc.h>
#endif

Modified src/OFStdIOStream.m from [4a2c070d4b] to [35cce49f46].

43
44
45
46
47
48
49

50
51

52
53
54
55
56
57
58
#import "OFWriteFailedException.h"

#ifdef OF_IOS
# undef HAVE_ISATTY
#endif

#ifdef OF_AMIGAOS

# include <proto/exec.h>
# include <proto/dos.h>

# undef HAVE_ISATTY
#endif

#ifdef OF_WII_U
# define BOOL WUT_BOOL
# include <coreinit/debug.h>
# undef BOOL







>


>







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#import "OFWriteFailedException.h"

#ifdef OF_IOS
# undef HAVE_ISATTY
#endif

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# include <proto/dos.h>
# undef Class
# undef HAVE_ISATTY
#endif

#ifdef OF_WII_U
# define BOOL WUT_BOOL
# include <coreinit/debug.h>
# undef BOOL

Modified src/OFSystemInfo.m from [5298f7ca34] to [29cb852ec7].

27
28
29
30
31
32
33

34
35

36
37
38
39
40
41
42
# include <sys/utsname.h>
#endif
#if defined(OF_MACOS) || defined(OF_IOS) || defined(OF_NETBSD)
# include <sys/sysctl.h>
#endif

#ifdef OF_AMIGAOS

# include <exec/execbase.h>
# include <proto/exec.h>

#endif

#if defined(OF_AMIGAOS4)
# include <exec/exectags.h>
#elif defined(OF_MORPHOS)
# include <exec/system.h>
#endif







>


>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# include <sys/utsname.h>
#endif
#if defined(OF_MACOS) || defined(OF_IOS) || defined(OF_NETBSD)
# include <sys/sysctl.h>
#endif

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <exec/execbase.h>
# include <proto/exec.h>
# undef Class
#endif

#if defined(OF_AMIGAOS4)
# include <exec/exectags.h>
#elif defined(OF_MORPHOS)
# include <exec/system.h>
#endif

Modified src/OFThread.m from [7471d46290] to [4fb74cf061].

28
29
30
31
32
33
34

35
36

37
38
39
40
41
42
43
# include <sched.h>
#endif
#include "unistd_wrapper.h"

#include "platform.h"

#ifdef OF_AMIGAOS

# include <proto/exec.h>
# include <proto/dos.h>

#endif

#ifdef OF_WII
# define nanosleep ogc_nanosleep
# include <ogcsys.h>
# undef nanosleep
#endif







>


>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# include <sched.h>
#endif
#include "unistd_wrapper.h"

#include "platform.h"

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# include <proto/exec.h>
# include <proto/dos.h>
# undef Class
#endif

#ifdef OF_WII
# define nanosleep ogc_nanosleep
# include <ogcsys.h>
# undef nanosleep
#endif

Modified src/libbases.m from [2504d434ae] to [75c1492180].

11
12
13
14
15
16
17

18

19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"


#include <proto/exec.h>


#import "OFInitializationFailedException.h"

#import "macros.h"

#ifdef OF_AMIGAOS4
extern struct Library *DOSBase;







>

>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#define Class IntuitionClass
#include <proto/exec.h>
#undef Class

#import "OFInitializationFailedException.h"

#import "macros.h"

#ifdef OF_AMIGAOS4
extern struct Library *DOSBase;

Modified src/platform/AmigaOS/OFPlainCondition.m from [158e7519b7] to [adff92d333].

15
16
17
18
19
20
21

22
23
24
25
26

27
28
29
30
31
32
33

#include "config.h"

#include <errno.h>

#import "OFPlainCondition.h"


#include <proto/exec.h>
#include <devices/timer.h>
#ifndef OF_AMIGAOS4
# include <clib/alib_protos.h>
#endif


int
OFPlainConditionNew(OFPlainCondition *condition)
{
	condition->waitingTasks = NULL;

	return 0;







>





>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#include "config.h"

#include <errno.h>

#import "OFPlainCondition.h"

#define Class IntuitionClass
#include <proto/exec.h>
#include <devices/timer.h>
#ifndef OF_AMIGAOS4
# include <clib/alib_protos.h>
#endif
#undef Class

int
OFPlainConditionNew(OFPlainCondition *condition)
{
	condition->waitingTasks = NULL;

	return 0;

Modified src/platform/AmigaOS/OFPlainMutex.m from [b98e0ff947] to [c178d9a4d1].

15
16
17
18
19
20
21

22

23
24
25
26
27
28
29

#include "config.h"

#include <errno.h>

#import "OFPlainMutex.h"


#include <proto/exec.h>


int
OFPlainMutexNew(OFPlainMutex *mutex)
{
	InitSemaphore(mutex);

	return 0;







>

>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#include "config.h"

#include <errno.h>

#import "OFPlainMutex.h"

#define Class IntuitionClass
#include <proto/exec.h>
#undef Class

int
OFPlainMutexNew(OFPlainMutex *mutex)
{
	InitSemaphore(mutex);

	return 0;

Modified src/platform/AmigaOS/OFPlainThread.m from [f267cccfbe] to [764b8104d2].

18
19
20
21
22
23
24

25
26
27

28
29
30
31
32
33
34
#include <errno.h>

#import "OFPlainThread.h"
#import "OFData.h"
#import "OFString.h"
#import "OFTLSKey.h"


#include <dos/dostags.h>
#include <proto/dos.h>
#include <proto/exec.h>


#ifndef OF_MORPHOS
extern void OFTLSKeyThreadExited(void);
#endif
static OFTLSKey threadKey;

OF_CONSTRUCTOR()







>



>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <errno.h>

#import "OFPlainThread.h"
#import "OFData.h"
#import "OFString.h"
#import "OFTLSKey.h"

#define Class IntuitionClass
#include <dos/dostags.h>
#include <proto/dos.h>
#include <proto/exec.h>
#undef Class

#ifndef OF_MORPHOS
extern void OFTLSKeyThreadExited(void);
#endif
static OFTLSKey threadKey;

OF_CONSTRUCTOR()

Modified src/platform/AmigaOS/OFTLSKey.m from [cfd9467865] to [a12f7662fd].

13
14
15
16
17
18
19

20
21

22
23
24
25
26
27
28
 * file.
 */

#include "config.h"

#import "OFTLSKey.h"


#include <exec/semaphores.h>
#include <proto/exec.h>


/*
 * As we use this file in both the runtime and ObjFW, and since AmigaOS always
 * has the runtime, use the hashtable from the runtime.
 */
#import "runtime/private.h"








>


>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 * file.
 */

#include "config.h"

#import "OFTLSKey.h"

#define Class IntuitionClass
#include <exec/semaphores.h>
#include <proto/exec.h>
#undef Class

/*
 * As we use this file in both the runtime and ObjFW, and since AmigaOS always
 * has the runtime, use the hashtable from the runtime.
 */
#import "runtime/private.h"

Modified src/runtime/amiga-library.m from [aa4300ce74] to [018a3f3715].

16
17
18
19
20
21
22

23
24
25
26

27
28
29
30
31
32
33
#include "config.h"

#import "ObjFWRT.h"
#import "private.h"

#import "amiga-glue.h"


#include <exec/libraries.h>
#include <exec/nodes.h>
#include <exec/resident.h>
#include <proto/exec.h>


#define CONCAT_VERSION2(major, minor) #major "." #minor
#define CONCAT_VERSION(major, minor) CONCAT_VERSION2(major, minor)
#define VERSION_STRING CONCAT_VERSION(OBJFWRT_LIB_MAJOR, OBJFWRT_LIB_MINOR)

#if defined(OF_AMIGAOS_M68K)
# define DATA_OFFSET 0x7FFE







>




>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "config.h"

#import "ObjFWRT.h"
#import "private.h"

#import "amiga-glue.h"

#define Class IntuitionClass
#include <exec/libraries.h>
#include <exec/nodes.h>
#include <exec/resident.h>
#include <proto/exec.h>
#undef Class

#define CONCAT_VERSION2(major, minor) #major "." #minor
#define CONCAT_VERSION(major, minor) CONCAT_VERSION2(major, minor)
#define VERSION_STRING CONCAT_VERSION(OBJFWRT_LIB_MAJOR, OBJFWRT_LIB_MINOR)

#if defined(OF_AMIGAOS_M68K)
# define DATA_OFFSET 0x7FFE

Modified src/runtime/linklib/init.m from [6ba923fc89] to [52398c8d3c].

15
16
17
18
19
20
21

22
23

24
25
26
27
28
29
30

#include "config.h"

#import "ObjFWRT.h"
#import "private.h"
#import "macros.h"


#include <proto/exec.h>
#include <proto/intuition.h>


struct ObjFWRTBase;

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

#if defined(OF_AMIGAOS_M68K)







>


>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

#include "config.h"

#import "ObjFWRT.h"
#import "private.h"
#import "macros.h"

#define Class IntuitionClass
#include <proto/exec.h>
#include <proto/intuition.h>
#undef Class

struct ObjFWRTBase;

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

#if defined(OF_AMIGAOS_M68K)

Modified src/runtime/misc.m from [c5be401afd] to [ca99efcb2f].

23
24
25
26
27
28
29

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "private.h"

#ifdef OF_WINDOWS
# include <windows.h>
#endif

#ifdef OF_AMIGAOS

# define USE_INLINE_STDARG
# include <proto/exec.h>
# include <clib/debug_protos.h>
# define __NOLIBBASE__
# define Class IntuitionClass
# include <proto/intuition.h>
# undef Class
# undef __NOLIBBASE__
#endif

static objc_enumeration_mutation_handler enumerationMutationHandler = NULL;

void
objc_enumerationMutation(id object)
{







>




<

|
|







23
24
25
26
27
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42
43
44
#include "private.h"

#ifdef OF_WINDOWS
# include <windows.h>
#endif

#ifdef OF_AMIGAOS
# define Class IntuitionClass
# define USE_INLINE_STDARG
# include <proto/exec.h>
# include <clib/debug_protos.h>
# define __NOLIBBASE__

# include <proto/intuition.h>
# undef __NOLIBBASE__
# undef Class
#endif

static objc_enumeration_mutation_handler enumerationMutationHandler = NULL;

void
objc_enumerationMutation(id object)
{