diff options
| author | David <seda18@rolmail.net> | 2025-05-21 00:57:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-21 00:57:38 +0200 |
| commit | 55848363fd5c88bd6313880e770515a9c548c0df (patch) | |
| tree | 1c2cb9fe2d20f6273d41e238aa366f775611f413 /lib/std/c.zig | |
| parent | a63f7875f451bda975ddabcc0c1feed10a216516 (diff) | |
| download | zig-55848363fd5c88bd6313880e770515a9c548c0df.tar.gz zig-55848363fd5c88bd6313880e770515a9c548c0df.zip | |
libc: implement common `abs` for various integer sizes (#23893)
* libc: implement common `abs` for various integer sizes
* libc: move imaxabs to inttypes.zig and don't use cInclude
* libc: delete `fabs` c implementations because already implemented in compiler_rt
* libc: export functions depending on the target libc
Previously all the functions that were exported were handled equally,
though some may exist and some not inside the same file. Moving the
checks inside the file allows handling different functions differently
* remove empty ifs in inttypes
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
* remove empty ifs in stdlib
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
* libc: use `@abs` for the absolute value calculation
---------
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
Diffstat (limited to 'lib/std/c.zig')
| -rw-r--r-- | lib/std/c.zig | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/std/c.zig b/lib/std/c.zig index e61c8990c3..1cfd441072 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -10822,6 +10822,9 @@ else b: c_longdouble, }; +pub const intmax_t = i64; +pub const uintmax_t = u64; + pub extern "c" fn pthread_getthreadid_np() c_int; pub extern "c" fn pthread_set_name_np(thread: pthread_t, name: [*:0]const u8) void; pub extern "c" fn pthread_get_name_np(thread: pthread_t, name: [*:0]u8, len: usize) void; |
