mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
Errno updates with errno for linux/win/macos. Updated $$ syntax to also match compiler constants.
19 lines
251 B
C
19 lines
251 B
C
module std::os::linux;
|
|
import std::env;
|
|
|
|
$if (env::OS_TYPE == OsType.LINUX):
|
|
|
|
extern fn int* __errno_location();
|
|
|
|
fn int errno() @inline
|
|
{
|
|
return *__errno_location();
|
|
}
|
|
|
|
fn void errno_set(int errno)
|
|
{
|
|
*(__errno_location()) = errno;
|
|
}
|
|
|
|
$endif;
|