ObjFW  Check-in [34e0add5b4]

Overview
Comment:Pass asprintf from linklib on MorphOS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | amiga-library
Files: files | file ages | folders
SHA3-256: 34e0add5b4df352396524d3e5b3e00b1ffbaf9c568e376f65b3d2e4f5442c959
User & Date: js on 2022-11-13 12:25:47
Other Links: branch diff | manifest | tags
Context
2022-11-15
22:26
Fix linklib/init.m check-in: 0784b353da user: js tags: amiga-library
2022-11-13
12:25
Pass asprintf from linklib on MorphOS check-in: 34e0add5b4 user: js tags: amiga-library
11:31
Remove fprintf and fflush from Amiga library check-in: 4686d22cd1 user: js tags: amiga-library
Changes

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

67
68
69
70
71
72
73




74
75

76
77
78
79
80
81
82
#ifdef OF_MORPHOS
	void (*_Nonnull __register_frame)(void *_Nonnull);
	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);







>
>
>
>


>







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#ifdef OF_MORPHOS
	void (*_Nonnull __register_frame)(void *_Nonnull);
	void (*_Nonnull __deregister_frame)(void *_Nonnull);
#endif
	int *_Nonnull (*_Nonnull errNo)(void);

	/* Needed only by ObjFW. */
#ifdef OF_MORPHOS
	int (*_Nonnull vasprintf)(char *_Nonnull *_Nullable restrict,
	    const char *_Nonnull restrict, va_list);
#else
	int (*_Nonnull vsnprintf)(char *_Nonnull restrict, size_t,
	    const char *_Nonnull restrict, va_list);
#endif
	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);

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

524
525
526
527
528
529
530




















531
532
533
534
535
536

537
538
539
540
541
542
543

int *
OFErrNo(void)
{
	return libC.errNo();
}





















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);
}








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






>







524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564

int *
OFErrNo(void)
{
	return libC.errNo();
}

#ifdef OF_MORPHOS
int
vasprintf(char **restrict strp, const char *restrict fmt, va_list args)
{
	return libC.vasprintf(strp, fmt, args);
}

int
asprintf(char **restrict strp, const char *restrict fmt, ...)
{
	va_list args;
	int ret;

	va_start(args, fmt);
	ret = vasprintf(strp, fmt, args);
	va_end(args);

	return ret;
}
#else
int
vsnprintf(char *restrict str, size_t size, const char *restrict fmt,
    va_list args)
{
	return libC.vsnprintf(str, size, fmt, args);
}
#endif

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

Modified src/linklib/init.m from [6620df29f3] to [16bd880c11].

338
339
340
341
342
343
344



345

346
347
348
349
350
351
352
		.__deregister_frame_info = __deregister_frame_info,
#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,







>
>
>

>







338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
		.__deregister_frame_info = __deregister_frame_info,
#endif
#ifdef OF_MORPHOS
		.__register_frame = __register_frame,
		.__deregister_frame = __deregister_frame,
#endif
		.errNo = errNo,
#ifdef OF_MORPHOS
		.vasprintf = vasprintf,
#else
		.vsnprintf = vsnprintf,
#endif
		.strtof = strtof,
		.strtod = strtod,
#ifdef OF_MORPHOS
		.gmtime_r = gmtime_r,
		.localtime_r = localtime_r,
#endif
		.mktime = mktime,