Skip to content

Commit 5e62034

Browse files
committed
put libc calls to boot_sprintf under .ifdef __TICE__ to improve portability
1 parent 2ecd1a7 commit 5e62034

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/libc/asctime.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include <time.h>
22
#include <stdio.h>
3+
#ifdef __TICE__
34
#include <ti/sprintf.h>
5+
#endif
46

57
char *asctime(const struct tm *timeptr)
68
{
@@ -26,8 +28,12 @@ char *asctime(const struct tm *timeptr)
2628
) {
2729
return NULL;
2830
}
29-
30-
boot_sprintf(result, "%.3s %.3s %2d %.2d:%.2d:%.2d %d\n",
31+
#ifdef __TICE__
32+
boot_sprintf(
33+
#else
34+
sprintf(
35+
#endif
36+
result, "%.3s %.3s %2d %.2d:%.2d:%.2d %d\n",
3137
wday_name[timeptr->tm_wday],
3238
mon_name[timeptr->tm_mon],
3339
timeptr->tm_mday,

src/libc/strerror.src

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,13 @@ _strerror.hijack_de:
152152
.L.format_d.end:
153153
ld hl, __strerror_buffer
154154
push hl
155-
.extern _boot_sprintf
155+
.ifdef __TICE__
156156
call _boot_sprintf
157+
.extern _boot_sprintf
158+
.else
159+
call _sprintf
160+
.extern _sprintf
161+
.endif
157162
pop hl
158163
pop hl
159164
pop hl

0 commit comments

Comments
 (0)