ObjFW  Check-in [c05772e186]

Overview
Comment:Pass setjmp/longjmp from the linklib on MorphOS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | amiga-library
Files: files | file ages | folders
SHA3-256: c05772e186a1403ddb51b8a36b50eb12d05c455d0b690d104bc793f0f2855935
User & Date: js on 2022-11-15 23:18:30
Other Links: branch diff | manifest | tags
Context
2022-11-16
01:31
Merge trunk into branch "amiga-library" check-in: 3c13b15751 user: js tags: amiga-library
2022-11-15
23:18
Pass setjmp/longjmp from the linklib on MorphOS check-in: c05772e186 user: js tags: amiga-library
23:09
Merge trunk into branch "amiga-library" check-in: a151c9797b user: js tags: amiga-library
Changes

Modified src/amiga-library.h from [486f50c32d] to [790ebf9372].

21
22
23
24
25
26
27




28
29
30
31
32
33
34
# include <ppcinline/macros.h>
# define OF_M68K_ARG(type, name, reg) type name = (type)REG_##reg;
#else
# define OF_M68K_ARG(type, name, reg)		\
	register type reg_##name __asm__(#reg);	\
	type name = reg_##name;
#endif





typedef void (*OFSignalHandler)(int);

struct OFLibC {
	/*
	 * Needed by the runtime. Some of them are also used by ObjFW, but we
	 * need all of them to pass them along to the runtime.







>
>
>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# include <ppcinline/macros.h>
# define OF_M68K_ARG(type, name, reg) type name = (type)REG_##reg;
#else
# define OF_M68K_ARG(type, name, reg)		\
	register type reg_##name __asm__(#reg);	\
	type name = reg_##name;
#endif

#ifdef OF_MORPHOS
# include <setjmp.h>
#endif

typedef void (*OFSignalHandler)(int);

struct OFLibC {
	/*
	 * Needed by the runtime. Some of them are also used by ObjFW, but we
	 * need all of them to pass them along to the runtime.
95
96
97
98
99
100
101




102
103
104
105
106
107
108
	    const char *_Nonnull, const struct tm *_Nonnull);
	void (*_Nonnull exit)(int);
	int (*_Nonnull atexit)(void (*_Nonnull)(void));
	OFSignalHandler _Nullable (*_Nonnull signal)(int, OFSignalHandler _Nullable);
	char *_Nullable (*_Nonnull setlocale)(int, const char *_Nullable);
	int (*_Nonnull _Unwind_Backtrace)(int (*_Nonnull)(void *_Nonnull,
	    void *_Null_unspecified), void *_Null_unspecified);




};

extern bool OFInit(unsigned int version, struct OFLibC *_Nonnull libC,
    FILE *_Nonnull *_Nonnull sF);
extern unsigned long *OFHashSeedRef(void);
extern void OFPBKDF2Wrapper(const OFPBKDF2Parameters *_Nonnull parameters);
extern void OFScryptWrapper(const OFScryptParameters *_Nonnull parameters);







>
>
>
>







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
	    const char *_Nonnull, const struct tm *_Nonnull);
	void (*_Nonnull exit)(int);
	int (*_Nonnull atexit)(void (*_Nonnull)(void));
	OFSignalHandler _Nullable (*_Nonnull signal)(int, OFSignalHandler _Nullable);
	char *_Nullable (*_Nonnull setlocale)(int, const char *_Nullable);
	int (*_Nonnull _Unwind_Backtrace)(int (*_Nonnull)(void *_Nonnull,
	    void *_Null_unspecified), void *_Null_unspecified);
#ifdef OF_MORPHOS
	int (*_Nonnull setjmp)(jmp_buf);
	void __dead2 (*_Nonnull longjmp)(jmp_buf, int);
#endif
};

extern bool OFInit(unsigned int version, struct OFLibC *_Nonnull libC,
    FILE *_Nonnull *_Nonnull sF);
extern unsigned long *OFHashSeedRef(void);
extern void OFPBKDF2Wrapper(const OFPBKDF2Parameters *_Nonnull parameters);
extern void OFScryptWrapper(const OFScryptParameters *_Nonnull parameters);

Modified src/amiga-library.m from [c697c72899] to [e2d6bec2e5].

627
628
629
630
631
632
633














634
635
636
637
638
639
640
}

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















void
OFPBKDF2Wrapper(const OFPBKDF2Parameters *parameters)
{
	OFPBKDF2(*parameters);
}








>
>
>
>
>
>
>
>
>
>
>
>
>
>







627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
}

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

#ifdef OF_MORPHOS
int
setjmp(jmp_buf env)
{
	return libC.setjmp(env);
}

void
longjmp(jmp_buf env, int val)
{
	libC.longjmp(env, val);
}
#endif

void
OFPBKDF2Wrapper(const OFPBKDF2Parameters *parameters)
{
	OFPBKDF2(*parameters);
}