mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix to simple a += b overload fallback. Renaming and reordering in the stdlib.
This commit is contained in:
2
lib/std/os/freebsd/general.c3
Normal file
2
lib/std/os/freebsd/general.c3
Normal file
@@ -0,0 +1,2 @@
|
||||
module std::os::freebsd @if(env::FREEBSD);
|
||||
|
||||
@@ -67,6 +67,17 @@ struct Darwin_segment_command_64
|
||||
uint flags; /* flags */
|
||||
}
|
||||
|
||||
struct Darwin_mach_timebase_info
|
||||
{
|
||||
uint numer;
|
||||
uint denom;
|
||||
}
|
||||
|
||||
alias Darwin_mach_timebase_info_t = Darwin_mach_timebase_info;
|
||||
alias Darwin_mach_timebase_info_data_t = Darwin_mach_timebase_info;
|
||||
|
||||
extern fn void mach_timebase_info(Darwin_mach_timebase_info_data_t* timebase);
|
||||
extern fn ulong mach_absolute_time();
|
||||
|
||||
fn String? executable_path(Allocator allocator)
|
||||
{
|
||||
@@ -155,3 +166,4 @@ fn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace)
|
||||
};
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
2
lib/std/os/macos/general.c3
Normal file
2
lib/std/os/macos/general.c3
Normal file
@@ -0,0 +1,2 @@
|
||||
module std::os::darwin @if(env::DARWIN);
|
||||
|
||||
1
lib/std/os/netbsd/general.c3
Normal file
1
lib/std/os/netbsd/general.c3
Normal file
@@ -0,0 +1 @@
|
||||
module std::os::netbsd @if(env::NETBSD);
|
||||
2
lib/std/os/openbsd/general.c3
Normal file
2
lib/std/os/openbsd/general.c3
Normal file
@@ -0,0 +1,2 @@
|
||||
module std::os::openbsd @if(env::OPENBSD);
|
||||
|
||||
68
lib/std/os/posix/clock.c3
Normal file
68
lib/std/os/posix/clock.c3
Normal file
@@ -0,0 +1,68 @@
|
||||
module std::os::posix @if(env::POSIX);
|
||||
import libc;
|
||||
|
||||
extern fn CInt clock_gettime(int type, TimeSpec *time);
|
||||
|
||||
module std::os::posix @if(env::OPENBSD);
|
||||
const CLOCK_REALTIME = 0;
|
||||
const CLOCK_PROCESS_CPUTIME_ID = 2;
|
||||
const CLOCK_MONOTONIC = 3;
|
||||
const CLOCK_THREAD_CPUTIME_ID = 4;
|
||||
const CLOCK_UPTIME = 5;
|
||||
const CLOCK_BOOTTIME = 6;
|
||||
|
||||
module std::os::posix @if(env::FREEBSD);
|
||||
const CLOCK_REALTIME = 0;
|
||||
const CLOCK_VIRTUAL = 1;
|
||||
const CLOCK_PROF = 2;
|
||||
const CLOCK_MONOTONIC = 4;
|
||||
const CLOCK_UPTIME = 5;
|
||||
const CLOCK_UPTIME_PRECISE = 7;
|
||||
const CLOCK_UPTIME_FAST = 8;
|
||||
const CLOCK_REALTIME_PRECISE = 9;
|
||||
const CLOCK_REALTIME_FAST = 10;
|
||||
const CLOCK_MONOTONIC_PRECISE = 11;
|
||||
const CLOCK_MONOTONIC_FAST = 12;
|
||||
const CLOCK_SECOND = 13;
|
||||
const CLOCK_THREAD_CPUTIME_ID = 14;
|
||||
const CLOCK_PROCESS_CPUTIME_ID = 15;
|
||||
const CLOCK_BOOTTIME = CLOCK_UPTIME;
|
||||
const CLOCK_REALTIME_COARSE = CLOCK_REALTIME_FAST;
|
||||
const CLOCK_MONOTONIC_COARSE = CLOCK_MONOTONIC_FAST;
|
||||
|
||||
module std::os::posix @if(env::NETBSD);
|
||||
const CLOCK_REALTIME = 0;
|
||||
const CLOCK_VIRTUAL = 1;
|
||||
const CLOCK_PROF = 2;
|
||||
const CLOCK_MONOTONIC = 3;
|
||||
const CLOCK_THREAD_CPUTIME_ID = 0x20000000;
|
||||
const CLOCK_PROCESS_CPUTIME_ID = 0x40000000;
|
||||
|
||||
module std::os::posix @if(env::WASI);
|
||||
// Not implemented
|
||||
const CLOCK_REALTIME = 0;
|
||||
const CLOCK_MONOTONIC = 0;
|
||||
|
||||
module std::os::posix @if(env::DARWIN);
|
||||
const CLOCK_REALTIME = 0;
|
||||
const CLOCK_MONOTONIC = 6;
|
||||
const CLOCK_MONOTONIC_RAW = 4;
|
||||
const CLOCK_MONOTONIC_RAW_APPROX = 5;
|
||||
const CLOCK_UPTIME_RAW = 8;
|
||||
const CLOCK_UPTIME_RAW_APPROX = 9;
|
||||
const CLOCK_PROCESS_CPUTIME_ID = 12;
|
||||
const CLOCK_THREAD_CPUTIME_ID = 16;
|
||||
|
||||
module std::os::posix @if(env::LINUX || env::ANDROID);
|
||||
const CLOCK_REALTIME = 0;
|
||||
const CLOCK_MONOTONIC = 1;
|
||||
const CLOCK_PROCESS_CPUTIME_ID = 2;
|
||||
const CLOCK_THREAD_CPUTIME_ID = 3;
|
||||
const CLOCK_MONOTONIC_RAW = 4;
|
||||
const CLOCK_REALTIME_COARSE = 5;
|
||||
const CLOCK_MONOTONIC_COARSE = 6;
|
||||
const CLOCK_BOOTTIME = 7;
|
||||
const CLOCK_REALTIME_ALARM = 8;
|
||||
const CLOCK_BOOTTIME_ALARM = 9;
|
||||
const CLOCK_TAI = 11;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
module std::os::posix;
|
||||
module std::os::posix @if(env::POSIX);
|
||||
|
||||
extern ZString* environ;
|
||||
|
||||
|
||||
1
lib/std/os/posix/net.c3
Normal file
1
lib/std/os/posix/net.c3
Normal file
@@ -0,0 +1 @@
|
||||
module std::os::posix @if(env::POSIX);
|
||||
6
lib/std/os/win32/clock.c3
Normal file
6
lib/std/os/win32/clock.c3
Normal file
@@ -0,0 +1,6 @@
|
||||
module std::os::win32 @if(env::WIN32);
|
||||
import std::math;
|
||||
|
||||
extern fn void getSystemTimeAsFileTime(Win32_FILETIME* time) @extern("GetSystemTimeAsFileTime");
|
||||
extern fn Win32_BOOL queryPerformanceFrequency(Win32_LARGE_INTEGER* lpFrequency) @extern("QueryPerformanceFrequency");
|
||||
extern fn Win32_BOOL queryPerformanceCounter(Win32_LARGE_INTEGER* lpPerformanceCount) @extern("QueryPerformanceCounter");
|
||||
@@ -1,5 +1,6 @@
|
||||
module std::os::win32 @if(env::WIN32);
|
||||
import libc;
|
||||
|
||||
enum Win32_GET_FILEEX_INFO_LEVELS
|
||||
{
|
||||
STANDARD,
|
||||
|
||||
@@ -122,11 +122,11 @@ const SD_RECEIVE = 0x00;
|
||||
const SD_SEND = 0x01;
|
||||
const SD_BOTH = 0x02;
|
||||
|
||||
extern fn CInt win32_WSAPoll(Win32_LPWSAPOLLFD fdArray, Win32_ULONG fds, Win32_INT timeout) @extern("WSAPoll") @builtin;
|
||||
extern fn WSAError win32_WSAGetLastError() @extern("WSAGetLastError") @builtin;
|
||||
extern fn void win32_WSASetLastError(WSAError error) @extern("WSASetLastError") @builtin;
|
||||
extern fn CInt win32_WSAStartup(Win32_WORD, void*) @extern("WSAStartup") @builtin;
|
||||
extern fn CInt win32_WSACleanup() @extern("WSACleanup") @builtin;
|
||||
extern fn CInt wsaPoll(Win32_LPWSAPOLLFD fdArray, Win32_ULONG fds, Win32_INT timeout) @extern("WSAPoll");
|
||||
extern fn WSAError wsaGetLastError() @extern("WSAGetLastError");
|
||||
extern fn void wsaSetLastError(WSAError error) @extern("WSASetLastError");
|
||||
extern fn CInt wsaStartup(Win32_WORD, void*) @extern("WSAStartup");
|
||||
extern fn CInt wsaCleanup() @extern("WSACleanup");
|
||||
|
||||
const int FIONBIO = -2147195266;
|
||||
const int FIONREAD = 1074030207;
|
||||
@@ -230,3 +230,4 @@ const WSAError QOS_EPSFILTERSPEC = 11028;
|
||||
const WSAError QOS_ESDMODEOBJ = 11029;
|
||||
const WSAError QOS_ESHAPERATEOBJ = 11030;
|
||||
const WSAError QOS_RESERVED_PETYPE = 11031;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user