mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Rename def to alias.
This commit is contained in:
@@ -47,12 +47,12 @@ fn void errno_set(Errno e)
|
||||
}
|
||||
|
||||
distinct Errno = inline CInt;
|
||||
def TerminateFunction = fn void();
|
||||
def CompareFunction = fn int(void*, void*);
|
||||
def JmpBuf = uptr[$$JMP_BUF_SIZE];
|
||||
def Fd = CInt;
|
||||
def Fpos_t = long @if(env::WIN32);
|
||||
def SignalFunction = fn void(CInt);
|
||||
alias TerminateFunction = fn void();
|
||||
alias CompareFunction = fn int(void*, void*);
|
||||
alias JmpBuf = uptr[$$JMP_BUF_SIZE];
|
||||
alias Fd = CInt;
|
||||
alias Fpos_t = long @if(env::WIN32);
|
||||
alias SignalFunction = fn void(CInt);
|
||||
|
||||
const CInt SIGHUP = 1;
|
||||
const CInt SIGINT = 2;
|
||||
@@ -76,8 +76,8 @@ const CInt SIGCHLD = BSD_FLAVOR_SIG ? 20 : 17;
|
||||
|
||||
const bool BSD_FLAVOR_SIG @local = env::DARWIN || env::BSD_FAMILY;
|
||||
|
||||
def Time_t = $typefrom(env::WIN32 ? long.typeid : CLong.typeid);
|
||||
def Off_t = $typefrom(env::WIN32 ? int.typeid : usz.typeid);
|
||||
alias Time_t = $typefrom(env::WIN32 ? long.typeid : CLong.typeid);
|
||||
alias Off_t = $typefrom(env::WIN32 ? int.typeid : usz.typeid);
|
||||
|
||||
module libc @if(env::LIBC);
|
||||
|
||||
@@ -369,7 +369,7 @@ module libc;
|
||||
|
||||
// stdio
|
||||
|
||||
def CFile = void*;
|
||||
alias CFile = void*;
|
||||
|
||||
|
||||
const HAS_MALLOC_SIZE = env::LINUX || env::WIN32 || env::DARWIN;
|
||||
@@ -403,7 +403,7 @@ const S_IRUSR = 0o000400; // Read permission, owner
|
||||
const S_IWUSR = 0o000200; // Write permission, owner
|
||||
const S_IXUSR = 0o000100; // Execute/search permission, owner
|
||||
|
||||
def SeekIndex = CLong;
|
||||
alias SeekIndex = CLong;
|
||||
|
||||
// vsprintf vprintf not supported
|
||||
|
||||
@@ -433,11 +433,11 @@ struct TimeSpec
|
||||
}
|
||||
|
||||
|
||||
def Clock_t = int @if(env::WIN32);
|
||||
def Clock_t = CLong @if(!env::WIN32);
|
||||
alias Clock_t = int @if(env::WIN32);
|
||||
alias Clock_t = CLong @if(!env::WIN32);
|
||||
|
||||
def TimeOffset = int @if(env::WASI) ;
|
||||
def TimeOffset = CLong @if(!env::WASI) ;
|
||||
alias TimeOffset = int @if(env::WASI) ;
|
||||
alias TimeOffset = CLong @if(!env::WASI) ;
|
||||
|
||||
const int TIME_UTC = 1;
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@ module libc @if(env::ANDROID);
|
||||
|
||||
// Checked for x86_64, this is notoriously incorrect when comparing with Rust code etc
|
||||
|
||||
def Blksize_t = $typefrom(env::X86_64 ? long.typeid : CInt.typeid);
|
||||
def Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid);
|
||||
def Blkcnt_t = long;
|
||||
def Ino_t = ulong;
|
||||
def Dev_t = ulong;
|
||||
def Mode_t = uint;
|
||||
def Ino64_t = ulong;
|
||||
def Blkcnt64_t = long;
|
||||
alias Blksize_t = $typefrom(env::X86_64 ? long.typeid : CInt.typeid);
|
||||
alias Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid);
|
||||
alias Blkcnt_t = long;
|
||||
alias Ino_t = ulong;
|
||||
alias Dev_t = ulong;
|
||||
alias Mode_t = uint;
|
||||
alias Ino64_t = ulong;
|
||||
alias Blkcnt64_t = long;
|
||||
|
||||
struct Stat @if(env::X86_64)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
module libc @if(env::DARWIN);
|
||||
|
||||
def Dev_t = int;
|
||||
def Mode_t = ushort;
|
||||
def Nlink_t = ushort;
|
||||
def Blkcnt_t = long;
|
||||
def Blksize_t = int;
|
||||
def Ino_t = ulong;
|
||||
alias Dev_t = int;
|
||||
alias Mode_t = ushort;
|
||||
alias Nlink_t = ushort;
|
||||
alias Blkcnt_t = long;
|
||||
alias Blksize_t = int;
|
||||
alias Ino_t = ulong;
|
||||
|
||||
struct Stat
|
||||
{
|
||||
|
||||
@@ -2,13 +2,13 @@ module libc @if(env::FREEBSD);
|
||||
|
||||
// Checked for x86_64
|
||||
|
||||
def Blksize_t = int;
|
||||
def Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid);
|
||||
def Dev_t = ulong;
|
||||
def Ino_t = ulong;
|
||||
def Mode_t = ushort;
|
||||
def Blkcnt_t = long;
|
||||
def Fflags_t = uint;
|
||||
alias Blksize_t = int;
|
||||
alias Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid);
|
||||
alias Dev_t = ulong;
|
||||
alias Ino_t = ulong;
|
||||
alias Mode_t = ushort;
|
||||
alias Blkcnt_t = long;
|
||||
alias Fflags_t = uint;
|
||||
|
||||
struct Stat @if(env::X86_64)
|
||||
{
|
||||
|
||||
@@ -2,14 +2,14 @@ module libc @if(env::LINUX);
|
||||
|
||||
// Checked for x86_64, this is notoriously incorrect when comparing with Rust code etc
|
||||
|
||||
def Blksize_t = $typefrom(env::X86_64 ? long.typeid : CInt.typeid);
|
||||
def Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid);
|
||||
def Blkcnt_t = long;
|
||||
def Ino_t = ulong;
|
||||
def Dev_t = ulong;
|
||||
def Mode_t = uint;
|
||||
def Ino64_t = ulong;
|
||||
def Blkcnt64_t = long;
|
||||
alias Blksize_t = $typefrom(env::X86_64 ? long.typeid : CInt.typeid);
|
||||
alias Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid);
|
||||
alias Blkcnt_t = long;
|
||||
alias Ino_t = ulong;
|
||||
alias Dev_t = ulong;
|
||||
alias Mode_t = uint;
|
||||
alias Ino64_t = ulong;
|
||||
alias Blkcnt64_t = long;
|
||||
|
||||
struct Stat @if(env::X86_64)
|
||||
{
|
||||
|
||||
@@ -18,18 +18,18 @@ const int RTLD_LOCAL = 0x4;
|
||||
const int RTLD_GLOBAL = 0x8;
|
||||
const int RTLD_NODELETE = 0x1000;
|
||||
|
||||
def Pid_t = int;
|
||||
def Uid_t = uint;
|
||||
def Gid_t = uint;
|
||||
alias Pid_t = int;
|
||||
alias Uid_t = uint;
|
||||
alias Gid_t = uint;
|
||||
|
||||
const CUInt SA_ONSTACK = env::LINUX ? 0x08000000 : 0x0001;
|
||||
const CUInt SA_RESTART = env::LINUX ? 0x10000000 : 0x0002;
|
||||
const CUInt SA_RESETHAND = env::LINUX ? 0x80000000 : 0x0004;
|
||||
const CUInt SA_SIGINFO = env::LINUX ? 0x00000004 : 0x0040;
|
||||
|
||||
def Sigset_t = uint @if(!env::LINUX);
|
||||
def Sigset_t = ulong[16] @if(env::LINUX);
|
||||
def SigActionFunction = fn void(CInt, void*, void*);
|
||||
alias Sigset_t = uint @if(!env::LINUX);
|
||||
alias Sigset_t = ulong[16] @if(env::LINUX);
|
||||
alias SigActionFunction = fn void(CInt, void*, void*);
|
||||
|
||||
struct Sigaction
|
||||
{
|
||||
|
||||
@@ -1,19 +1,30 @@
|
||||
module libc @if(env::WIN32);
|
||||
import std::os::win32;
|
||||
|
||||
alias fdopen = _fdopen;
|
||||
alias close = _close;
|
||||
alias fileno = _fileno;
|
||||
alias isatty = _isatty;
|
||||
alias difftime = _difftime64;
|
||||
alias fseek = _fseeki64;
|
||||
alias ftell = _ftelli64;
|
||||
alias timegm = _mkgmtime64;
|
||||
alias mktime = _mktime64;
|
||||
|
||||
extern fn CFile __acrt_iob_func(CInt c);
|
||||
extern fn CInt _close(Fd fd); def close = _close;
|
||||
extern fn double _difftime64(Time_t time1, Time_t time2); def difftime = _difftime64;
|
||||
extern fn CFile _fdopen(Fd fd, ZString mode); def fdopen = _fdopen;
|
||||
extern fn CInt _fileno(CFile stream); def fileno = _fileno;
|
||||
extern fn CInt _fseeki64(CFile, long, int); def fseek = _fseeki64;
|
||||
extern fn CLong _ftelli64(CFile); def ftell = _ftelli64;
|
||||
extern fn CInt _close(Fd fd);
|
||||
extern fn double _difftime64(Time_t time1, Time_t time2);
|
||||
extern fn CFile _fdopen(Fd fd, ZString mode);
|
||||
extern fn CInt _fileno(CFile stream);
|
||||
|
||||
extern fn CInt _fseeki64(CFile, long, int);
|
||||
extern fn CLong _ftelli64(CFile);
|
||||
extern fn Errno _get_timezone(CLong *timezone);
|
||||
extern fn Tm* _gmtime64_s(Tm* buf, Time_t *timer);
|
||||
extern fn CInt _isatty(Fd fd); def isatty = _isatty;
|
||||
extern fn CInt _isatty(Fd fd);
|
||||
extern fn Tm* _localtime64_s(Tm* buf, Time_t *timer);
|
||||
extern fn Time_t _mkgmtime64(Tm* timeptr); def timegm = _mkgmtime64;
|
||||
extern fn Time_t _mktime64(Tm *timeptr); def mktime = _mktime64;
|
||||
extern fn Time_t _mkgmtime64(Tm* timeptr);
|
||||
extern fn Time_t _mktime64(Tm *timeptr);
|
||||
extern fn usz _msize(void* ptr);
|
||||
extern fn CInt _read(Fd fd, void* buffer, CUInt buffer_size);
|
||||
extern fn CInt _setjmp(JmpBuf* buffer, void* frameptr);
|
||||
@@ -31,9 +42,11 @@ extern fn CInt shutdown(Win32_SOCKET s, CInt how);
|
||||
|
||||
struct SystemInfo
|
||||
{
|
||||
union {
|
||||
union
|
||||
{
|
||||
uint dwOemId;
|
||||
struct {
|
||||
struct
|
||||
{
|
||||
ushort wProcessorArchitecture;
|
||||
ushort wReserved;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user