diff --git a/resources/lib/std/io.c3 b/resources/lib/std/io.c3 index f69f66899..5651fad90 100644 --- a/resources/lib/std/io.c3 +++ b/resources/lib/std/io.c3 @@ -81,7 +81,7 @@ fn void! File.seek(File *file, long offset, Seek seekMode = Seek.SET) { if (libc::fseek(file.file, (SeekIndex)(offset), (int)(seekMode))) { - switch (libc::errno) + switch (libc::errno()) { case EBADF: return IoError.FILE_NOT_SEEKABLE!; case EINVAL: return IoError.FILE_INVALID_POSITION!; @@ -107,7 +107,7 @@ fn void! File.close(File *file) @inline { if (file.file && libc::fclose(file.file)) { - switch (libc::errno) + switch (libc::errno()) { case ECONNRESET: case EBADF: return IoError.FILE_NOT_VALID!; diff --git a/resources/lib/std/libc.c3 b/resources/lib/std/libc.c3 index f3cc12ecd..ae521f226 100644 --- a/resources/lib/std/libc.c3 +++ b/resources/lib/std/libc.c3 @@ -160,7 +160,7 @@ enum Errno : ErrnoType ENOTRECOVERABLE = 131, /* State not recoverable */ } -extern Errno errno; +extern fn Errno errno(void); define TerminateFunction = fn void(); define CompareFunction = fn int(void*, void*);