ObjFW  Check-in [71f240abd9]

Overview
Comment:Move DOSBase for Amiga .library to libbases.m
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | amiga-library
Files: files | file ages | folders
SHA3-256: 71f240abd9e2361f2b4fbb84c5c95be7f70d446fb93a7bd7544d0b55a1b0a5a9
User & Date: js on 2020-12-20 11:21:40
Other Links: branch diff | manifest | tags
Context
2020-12-20
11:30
Merge trunk into branch "amiga-library" check-in: 1ff8c1e62d user: js tags: amiga-library
11:21
Move DOSBase for Amiga .library to libbases.m check-in: 71f240abd9 user: js tags: amiga-library
2020-12-19
22:39
Pass atexit from the linklib check-in: c3ec28e2ea user: js tags: amiga-library
Changes

Modified src/amiga-library.m from [22b5af809e] to [b72f92b6a5].

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
43
44
45
46
47
48
49


50
51
52
53
54
55
56







-
-








#ifdef OF_AMIGAOS_M68K
# define OF_M68K_REG(reg) __asm__(#reg)
#else
# define OF_M68K_REG(reg)
#endif

struct Library *DOSBase;

/* This always needs to be the first thing in the file. */
int
_start()
{
	return -1;
}

395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
393
394
395
396
397
398
399



400
401
402
403
404
405
406







-
-
-








	if (version > 1)
		return false;

	if (base->initialized)
		return true;

	if ((DOSBase = OpenLibrary("dos.library", 0)) == NULL)
		return false;

	memcpy(&libc, libc_, sizeof(libc));
	__sF = sF;

#ifdef OF_AMIGAOS_M68K
	if ((size_t)_EH_FRAME_BEGINS__ != (size_t)_EH_FRAME_OBJECTS__)
		return false;

Modified src/libbases.m from [6db9ec2780] to [f99681cc09].

19
20
21
22
23
24
25



26
27
28
29
30
31
32
33
34
35
36
37

38
39

40

41
42
43
44
45
46
47
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47
48
49
50
51
52







+
+
+











-
+


+

+








#include <proto/exec.h>

#import "OFInitializationFailedException.h"

#import "macros.h"

#ifdef OF_COMPILING_AMIGA_LIBRARY
struct Library *DOSBase;
#endif
#ifdef OF_AMIGAOS4
extern struct Library *DOSBase;
extern struct DOSIFace *IDOS;
#endif
struct Library *LocaleBase;
#ifdef OF_AMIGAOS4
struct LocaleIFace *ILocale;
#endif

OF_CONSTRUCTOR()
{
#ifdef OF_AMIGAOS4
#if defined(OF_COMPILING_AMIGA_LIBRARY) || defined(OF_AMIGAOS4)
	if ((DOSBase = OpenLibrary("dos.library", 36)) == NULL)
		@throw [OFInitializationFailedException exception];
#endif

#ifdef OF_AMIGAOS4
	if ((IDOS = (struct DOSIFace *)
	    GetInterface(DOSBase, "main", 1, NULL)) == NULL)
		@throw [OFInitializationFailedException exception];
#endif

	if ((LocaleBase = OpenLibrary("locale.library", 38)) == NULL)
		@throw [OFInitializationFailedException exception];
60
61
62
63
64
65
66
67
68
69
70
71
72
73






65
66
67
68
69
70
71



72
73
74

75
76
77
78
79
80







-
-
-



-
+
+
+
+
+
+
		DropInterface((struct Interface *)ILocale);
#endif

	if (LocaleBase != NULL)
		CloseLibrary(LocaleBase);

#ifdef OF_AMIGAOS4
	if (DOSBase != NULL)
		CloseLibrary(DOSBase);

	if (IDOS != NULL)
		DropInterface((struct Interface *)IDOS);
#endif
}

#if defined(OF_COMPILING_AMIGA_LIBRARY) || defined(OF_AMIGAOS4)
	if (DOSBase != NULL)
		CloseLibrary(DOSBase);
#endif
}