diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-29 13:26:12 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-29 13:26:12 +0000 |
| commit | b7debea921e0de41bd218c099ec8f6250b15f7f1 (patch) | |
| tree | 42864598a9979c2c0416c737df3d6c30f1dd142d /std | |
| parent | fc6ff10acb9d00ea1c8c5924869e0efbd38093c5 (diff) | |
Fix portability issue macOS
Diffstat (limited to 'std')
| -rw-r--r-- | std/fs.zc | 6 | ||||
| -rw-r--r-- | std/time.zc | 6 |
2 files changed, 6 insertions, 6 deletions
@@ -14,7 +14,7 @@ include <unistd.h> include <stdlib.h> include <stdio.h> -// TODO: restructure this tomorrow. +// TODO: restructure this tomorrow (lol). raw { typedef struct DirEntry* DirEntryPtr; @@ -105,8 +105,8 @@ extern fn _z_fs_fopen(path: char*, mode: char*) -> void*; extern fn _z_fs_fclose(stream: void*) -> int; extern fn _z_fs_fread(ptr: void*, size: usize, nmemb: usize, stream: void*) -> usize; extern fn _z_fs_fwrite(ptr: void*, size: usize, nmemb: usize, stream: void*) -> usize; -extern fn _z_fs_fseek(stream: void*, offset: long, whence: int) -> int; -extern fn _z_fs_ftell(stream: void*) -> long; +extern fn _z_fs_fseek(stream: void*, offset: I64, whence: int) -> int; +extern fn _z_fs_ftell(stream: void*) -> I64; extern fn _z_fs_opendir(name: char*) -> void*; extern fn _z_fs_closedir(dir: void*) -> int; diff --git a/std/time.zc b/std/time.zc index 8e7cc6c..865dd6d 100644 --- a/std/time.zc +++ b/std/time.zc @@ -12,8 +12,8 @@ raw { return (uint64_t)(tv.tv_sec) * 1000 + (uint64_t)(tv.tv_usec) / 1000; } - static long _z_time_time(void) { - return (long)time(NULL); + static int64_t _z_time_time(void) { + return (int64_t)time(NULL); } } @@ -21,7 +21,7 @@ extern fn srand(seed: U32); extern fn rand() -> int; extern fn usleep(micros: U32) -> int; extern fn _time_now_impl() -> U64; -extern fn _z_time_time() -> long; +extern fn _z_time_time() -> I64; struct Duration { millis: U64; |
