ObjFW  Check-in [2d0b2c1120]

Overview
Comment:amiga-library.m: Open dos.library
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | amiga-library
Files: files | file ages | folders
SHA3-256: 2d0b2c11209f8a1f0f01b735537259e027a0db303b9276ae6e6e5e944638e8a9
User & Date: js on 2020-12-18 17:30:00
Other Links: branch diff | manifest | tags
Context
2020-12-19
10:25
Amiga library: Add __(de)register_frame symbol check-in: 3c100bc6a7 user: js tags: amiga-library
2020-12-18
17:30
amiga-library.m: Open dos.library check-in: 2d0b2c1120 user: js tags: amiga-library
11:04
Merge trunk into branch "amiga-library" check-in: 3fdb99cfd0 user: js tags: amiga-library
Changes

Modified src/amiga-library.m from [eefdfde168] to [7777d822b1].

42
43
44
45
46
47
48


49
50
51
52
53
54
55
#endif

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



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







>
>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#endif

#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;
}
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400



401
402
403
404
405
406
407

static void *
lib_null(void)
{
	return NULL;
}

bool
of_init(unsigned int version, struct of_libc *libc_, FILE **sF)
{
#ifdef OF_AMIGAOS_M68K
	OF_M68K_ARG(struct ObjFWBase *, base, a6)
#else
	register struct ObjFWBase *r12 __asm__("r12");
	struct ObjFWBase *base = r12;
#endif
#ifdef OF_MORPHOS
	void *frame;
#endif
	uintptr_t *iter, *iter0;

	if (version > 1)
		return false;

	if (base->initialized)
		return true;




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

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







|


















>
>
>







377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412

static void *
lib_null(void)
{
	return NULL;
}

bool __saveds
of_init(unsigned int version, struct of_libc *libc_, FILE **sF)
{
#ifdef OF_AMIGAOS_M68K
	OF_M68K_ARG(struct ObjFWBase *, base, a6)
#else
	register struct ObjFWBase *r12 __asm__("r12");
	struct ObjFWBase *base = r12;
#endif
#ifdef OF_MORPHOS
	void *frame;
#endif
	uintptr_t *iter, *iter0;

	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;