ObjFW  Diff

Differences From Artifact [5a87af71c9]:

To Artifact [59e1e80ea6]:


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
30
31
32
33
34
35
36


37
38
39
40
41
42
43
44
45
46
47
48
49
50







-
-






+







#import "macros.h"
#import "amiga-library.h"

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

struct ObjFWBase;

#if defined(OF_AMIGAOS_M68K)
# include <stabs.h>
#elif defined(OF_MORPHOS)
# include <constructor.h>
#endif

extern struct Library *ObjFWRTBase;
#ifdef HAVE_SJLJ_EXCEPTIONS
extern int _Unwind_SjLj_RaiseException(void *);
#else
extern int _Unwind_RaiseException(void *);
#endif
extern void _Unwind_DeleteException(void *);
extern void *_Unwind_GetLanguageSpecificData(void *);
271
272
273
274
275
276
277



278
279
280
281
282
283
284
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286







+
+
+







void *__objc_class_name_OFMapTableSet;
void *__objc_class_name_OFMutableMapTableSet;
void *__objc_class_name_OFMutableUTF8String;
void *__objc_class_name_OFRangeCharacterSet;
void *__objc_class_name_OFSelectKernelEventObserver;
void *__objc_class_name_OFUTF8String;

#ifndef OF_AMIGA_LIB
struct Library *ObjFWBase;

static void
error(const char *string, ULONG arg)
{
	struct Library *IntuitionBase = OpenLibrary("intuition.library", 0);

	if (IntuitionBase != NULL) {
		struct EasyStruct easy = {
366
367
368
369
370
371
372
373

374
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
368
369
370
371
372
373
374

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
408
409







-
+











-
+


-
+











+







	if (initialized)
		return;

	if ((ObjFWBase = OpenLibrary(OBJFW_AMIGA_LIB, OBJFW_LIB_MINOR)) == NULL)
		error("Failed to open " OBJFW_AMIGA_LIB " version %lu!",
		    OBJFW_LIB_MINOR);

	if (!OFInit(1, &libC))
	if (!OFInit(1, &libC, ObjFWRTBase))
		error("Failed to initialize " OBJFW_AMIGA_LIB "!", 0);

	initialized = true;
}

static void __attribute__((__used__))
dtor(void)
{
	CloseLibrary(ObjFWBase);
}

#if defined(OF_AMIGAOS_M68K)
# if defined(OF_AMIGAOS_M68K)
ADD2INIT(ctor, -2);
ADD2EXIT(dtor, -2);
#elif defined(OF_MORPHOS)
# elif defined(OF_MORPHOS)
CONSTRUCTOR_P(ObjFW, 5000)
{
	ctor();

	return 0;
}

DESTRUCTOR_P(ObjFW, 5000)
{
	dtor();
}
# endif
#endif

extern void OFPBKDF2Wrapper(const OFPBKDF2Parameters *parameters);
extern void OFScryptWrapper(const OFScryptParameters *parameters);

void
OFLog(OFConstantString *format, ...)