-
Notifications
You must be signed in to change notification settings - Fork 472
Open
Labels
Description
gorilla@guest:~/cc65 (c_sp)$ cat foo.c
#include <stdlib.h>
#include <time.h>
int main() {
srand(time(NULL));
return 0;
}
gorilla@guest:~/cc65 (c_sp)$ bin/cl65 -t sim6502 foo.c
common/time.s:30: Error: Unresolved external '_clock_gettime'
ld65: Error: 1 unresolved external(s) found - cannot create output file
i guess it makes sense for it to be system dependant. that said, sim6502 has hooks for printing and file operations, seems like a hook for clock_gettime() would not be that hard.
gorilla@guest:~/cc65 (c_sp)$ grep -r clock_gettime libsrc libsrc/apple2/gettime.s:; int __fastcall__ clock_gettime (clockid_t clk_id, struct timespec *tp); libsrc/apple2/gettime.s:_clock_gettime: libsrc/c64/gettime.s:; int __fastcall__ clock_gettime (clockid_t clk_id, struct timespec *tp); libsrc/c64/gettime.s:.proc _clock_gettime libsrc/geos-common/system/gettime.c:int __fastcall__ clock_gettime(clockid_t, struct timespec *tp) libsrc/common/time.s: jsr _clock_gettime libsrc/common/time.s:; _clock_gettime returns 0 on success and -1 on error. Check that. libsrc/common/time.s: inx ; Did _clock_gettime return -1? libsrc/cbm610/gettime.s:; int __fastcall__ clock_gettime (clockid_t clk_id, struct timespec *tp); libsrc/cbm610/gettime.s:.proc _clock_gettime libsrc/atari/gettime.s:; int __fastcall__ clock_gettime (clockid_t clk_id, struct timespec *tp); libsrc/atari/gettime.s:_clock_gettime: libsrc/rp6502/gettimezone.c:int clock_gettimezone (clockid_t clock_id, struct _timezone* tz) libsrc/rp6502/gettime.c:extern int __clock_gettimespec (struct timespec* ts, unsigned char op); libsrc/rp6502/gettime.c:int clock_gettime (clockid_t clock_id, struct timespec* tp) libsrc/rp6502/gettime.c: return __clock_gettimespec (tp, RIA_OP_CLOCK_GETTIME); libsrc/rp6502/gettimespec.c:int __clock_gettimespec (struct timespec* ts, unsigned char op) libsrc/rp6502/gettimespec.c:/* Internal method shared by clock_getres and clock_gettime. */ libsrc/rp6502/getres.c:extern int __clock_gettimespec (struct timespec* ts, unsigned char op); libsrc/rp6502/getres.c: return __clock_gettimespec (res, RIA_OP_CLOCK_GETRES); libsrc/cbm510/gettime.s:; int __fastcall__ clock_gettime (clockid_t clk_id, struct timespec *tp); libsrc/cbm510/gettime.s:.proc _clock_gettime libsrc/c128/gettime.s:; int __fastcall__ clock_gettime (clockid_t clk_id, struct timespec *tp); libsrc/c128/gettime.s:.proc _clock_gettime libsrc/cx16/gettime.s:; int __fastcall__ clock_gettime (clockid_t clk_id, struct timespec *tp); libsrc/cx16/gettime.s:.proc _clock_gettime