ObjFW  Diff

Differences From Artifact [1b5f3bd0d7]:

To Artifact [911e384ae6]:


297
298
299
300
301
302
303
304

305
306
307
308
309
310
311
312
313

314
315
316
317
318
319
320
297
298
299
300
301
302
303

304
305
306
307
308
309
310
311
312

313
314
315
316
317
318
319
320







-
+








-
+







		CloseLibrary(IntuitionBase);
	}

	exit(EXIT_FAILURE);
}

static int *
get_errno(void)
errNo(void)
{
	return &errno;
}

static void __attribute__((__used__))
ctor(void)
{
	static bool initialized = false;
	struct of_libc libc = {
	struct OFLibC libC = {
		.malloc = malloc,
		.calloc = calloc,
		.realloc = realloc,
		.free = free,
		.vfprintf = vfprintf,
		.fflush = fflush,
		.abort = abort,
342
343
344
345
346
347
348
349

350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368

369
370
371
372
373
374
375
342
343
344
345
346
347
348

349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367

368
369
370
371
372
373
374
375







-
+


















-
+







		.__register_frame_info = __register_frame_info,
		.__deregister_frame_info = __deregister_frame_info,
#endif
#ifdef OF_MORPHOS
		.__register_frame = __register_frame,
		.__deregister_frame = __deregister_frame,
#endif
		.get_errno = get_errno,
		.errNo = errNo,
		.vsnprintf = vsnprintf,
#ifdef OF_AMIGAOS_M68K
		.vsscanf = vsscanf,
#endif
		.exit = exit,
		.atexit = atexit,
		.signal = signal,
		.setlocale = setlocale,
		._Unwind_Backtrace = _Unwind_Backtrace
	};

	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 (!of_init(1, &libc, __sF))
	if (!OFInit(1, &libC, __sF))
		error("Failed to initialize " OBJFW_AMIGA_LIB "!", 0);

	initialized = true;
}

static void __attribute__((__used__))
dtor(void)