ObjFW  Check-in [e4f9514ea7]

Overview
Comment:Pass more required functions via the linklib
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | amiga-library
Files: files | file ages | folders
SHA3-256: e4f9514ea719e95bbbba7bb4689d3552b4bda87c9cfc2a8e72ee7b134a606938
User & Date: js on 2021-09-15 17:59:10
Other Links: branch diff | manifest | tags
Context
2021-09-15
18:54
Define USE_INLINE_STDARG in linklib check-in: 4634fc3d92 user: js tags: amiga-library
17:59
Pass more required functions via the linklib check-in: e4f9514ea7 user: js tags: amiga-library
2021-09-14
18:19
Merge trunk into branch "amiga-library" check-in: 7c18c1efd6 user: js tags: amiga-library
Changes

Modified src/amiga-library.h from [5c085b12df] to [515dc680a7].

70
71
72
73
74
75
76




77

78
79
80
81





82
83
84
85
86
87
88
89
90
91
	void (*_Nonnull __deregister_frame)(void *_Nonnull);
#endif
	int *_Nonnull (*_Nonnull errNo)(void);

	/* Needed only by ObjFW. */
	int (*_Nonnull vsnprintf)(char *_Nonnull restrict, size_t,
	    const char *_Nonnull restrict, va_list);




#ifdef OF_AMIGAOS_M68K

	/* strtod() uses sscanf() internally */
	int (*_Nonnull vsscanf)(const char *_Nonnull restrict,
	    const char *_Nonnull restrict, va_list);
#endif





	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 *libC, FILE **sF);
extern unsigned long *OFHashSeedRef(void);







>
>
>
>
|
>
|
|
|

>
>
>
>
>










70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
	void (*_Nonnull __deregister_frame)(void *_Nonnull);
#endif
	int *_Nonnull (*_Nonnull errNo)(void);

	/* Needed only by ObjFW. */
	int (*_Nonnull vsnprintf)(char *_Nonnull restrict, size_t,
	    const char *_Nonnull restrict, va_list);
	float (*_Nonnull strtof)(const char *_Nonnull,
	    char *_Nullable *_Nullable);
	double (*_Nonnull strtod)(const char *_Nonnull,
	    char *_Nullable *_Nullable);
#ifdef OF_MORPHOS
	struct tm *(*_Nonnull gmtime_r)(const time_t *_Nonnull,
	    struct tm *_Nonnull);
	struct tm *(*_Nonnull localtime_r)(const time_t *_Nonnull,
	    struct tm *_Nonnull);
#endif
	time_t (*_Nonnull mktime)(struct tm *_Nonnull);
	int (*_Nonnull gettimeofday)(struct timeval *_Nonnull,
	    struct timezone *_Nullable);
	size_t (*_Nonnull strftime)(char *_Nonnull, size_t,
	    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 *libC, FILE **sF);
extern unsigned long *OFHashSeedRef(void);

Modified src/amiga-library.m from [fdc1473cd0] to [7e963b1641].

559
560
561
562
563
564
565












566













567
568

569
570
571
572
573

574
575
576
577
578
579





580
581
582
583
584
585
586
int
vsnprintf(char *restrict str, size_t size, const char *restrict fmt,
    va_list args)
{
	return libC.vsnprintf(str, size, fmt, args);
}













#ifdef OF_AMIGAOS_M68K













int
sscanf(const char *restrict str, const char *restrict fmt, ...)

{
	int ret;
	va_list args;

	va_start(args, fmt);

	ret = libC.vsscanf(str, fmt, args);
	va_end(args);

	return ret;
}
#endif






void
exit(int status)
{
	libC.exit(status);

	OF_UNREACHABLE







>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>

<
>

|
<
|
|
>
|
<
|
|

|
>
>
>
>
>







559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592

593
594
595

596
597
598
599

600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
int
vsnprintf(char *restrict str, size_t size, const char *restrict fmt,
    va_list args)
{
	return libC.vsnprintf(str, size, fmt, args);
}

float
strtof(const char *str, char **endptr)
{
	return libC.strtof(str, endptr);
}

double
strtod(const char *str, char **endptr)
{
	return libC.strtod(str, endptr);
}

#ifdef OF_MORPHOS
struct tm *
gmtime_r(const time_t *time, struct tm *tm)
{
	return libC.gmtime_r(time, tm);
}

struct tm *
localtime_r(const time_t *time, struct tm *tm)
{
	return libC.localtime_r(time, tm);
}
#endif

int

gettimeofday(struct timeval *tv, struct timezone *tz)
{
	return libC.gettimeofday(tv, tz);

}

time_t
mktime(struct tm *tm)

{
	return libC.mktime(tm);
}

size_t
strftime(char *str, size_t len, const char *fmt, const struct tm *tm)
{
	return libC.strftime(str, len, fmt, tm);
}

void
exit(int status)
{
	libC.exit(status);

	OF_UNREACHABLE

Modified src/linklib/init.m from [911e384ae6] to [c01918ca3a].

344
345
346
347
348
349
350


351
352

353



354
355
356
357
358
359
360
#endif
#ifdef OF_MORPHOS
		.__register_frame = __register_frame,
		.__deregister_frame = __deregister_frame,
#endif
		.errNo = errNo,
		.vsnprintf = vsnprintf,


#ifdef OF_AMIGAOS_M68K
		.vsscanf = vsscanf,

#endif



		.exit = exit,
		.atexit = atexit,
		.signal = signal,
		.setlocale = setlocale,
		._Unwind_Backtrace = _Unwind_Backtrace
	};








>
>
|
|
>

>
>
>







344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
#endif
#ifdef OF_MORPHOS
		.__register_frame = __register_frame,
		.__deregister_frame = __deregister_frame,
#endif
		.errNo = errNo,
		.vsnprintf = vsnprintf,
		.strtof = strtof,
		.strtod = strtod,
#ifdef OF_MORPHOS
		.gmtime_r = gmtime_r,
		.localtime_r = localtime_r,
#endif
		.mktime = mktime,
		.gettimeofday = gettimeofday,
		.strftime = strftime,
		.exit = exit,
		.atexit = atexit,
		.signal = signal,
		.setlocale = setlocale,
		._Unwind_Backtrace = _Unwind_Backtrace
	};