0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std
Evan Haas dc4fa83dd7
translate-c: add framework for special-casing macros
Some macros (for example any macro that uses token pasting) cannot be
directly translated to Zig, but may nevertheless still admit a Zig
implementation. This provides a mechanism for matching macros against
templates and mapping them to functions implemented in c_translation.zig.

A macro matches a template if it contains the same sequence of tokens, except
that the name and parameters may be renamed. No attempt is made to
semantically analyze the macro. For example the following two macros are
considered equivalent:

```C
```

But the following two are not:

```C
```
History 2021-07-22 08:09:46 -07:00
..
atomic stage2: miscellaneous fixes for the branch 2021-07-20 12:19:16 -07:00
build fix code broken from previous commit 2021-06-21 17:03:03 -07:00
c Add inotify_rm_watch definition to c/linux.zig 2021-07-15 10:54:05 +03:00
compress std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
crypto std.crypto: handle the top bit in 25519.field.fromBytes64() (#9435) 2021-07-22 01:27:42 +02:00
event std.Thread: even more typo fixes 2021-06-30 21:49:00 -05:00
fmt std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
fs changes to accomodate std.Thread update 2021-06-30 21:48:59 -05:00
hash Correct hasUniqueRepresentation for vectors 2021-07-21 15:19:57 -04:00
heap fix code broken from previous commit 2021-06-21 17:03:03 -07:00
io fix code broken from previous commit 2021-06-21 17:03:03 -07:00
json std/json: Fix premature closing brace being considered valid JSON 2021-05-13 11:11:28 +02:00
math FIX typo in doc comment for std.math.hypot (#9413) 2021-07-18 23:53:06 +02:00
mem fix code broken from previous commit 2021-06-21 17:03:03 -07:00
meta Correct hasUniqueRepresentation for vectors 2021-07-21 15:19:57 -04:00
net changes to accomodate std.Thread update 2021-06-30 21:48:59 -05:00
os Fixed compile error: 'bMenu' needs to casted. (#9426) 2021-07-22 01:28:21 +02:00
rand implement xoshiro256++ (#9298) 2021-07-04 16:15:23 +02:00
special Add support for NO_COLOR 2021-07-08 14:30:45 -04:00
target Fix lakemont CpuModel (#9099) 2021-06-17 16:37:38 -04:00
testing Year++ 2020-12-31 15:45:24 -08:00
Thread zig fmt 2021-06-30 21:49:38 -05:00
time Year++ 2020-12-31 15:45:24 -08:00
unicode std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
valgrind Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
x fix code broken from previous commit 2021-06-21 17:03:03 -07:00
zig translate-c: add framework for special-casing macros 2021-07-22 08:09:46 -07:00
array_hash_map.zig std: ArrayHashMap remove unused parameter 2021-06-21 17:03:03 -07:00
array_list.zig std.ArrayList: add missing assertion in appendSliceAssumeCapacity 2021-07-20 12:19:17 -07:00
ascii.zig add allocation free versions of lower/upper string 2021-06-08 14:27:44 -04:00
atomic.zig stage2: miscellaneous fixes for the branch 2021-07-20 12:19:16 -07:00
base64.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
bit_set.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
buf_map.zig Breaking hash map changes for 0.8.0 2021-06-03 17:02:16 -05:00
buf_set.zig Breaking hash map changes for 0.8.0 2021-06-03 17:02:16 -05:00
build.zig std/build: add --sysroot general option 2021-06-25 19:13:43 +02:00
builtin.zig std.builtin.panic: simpler default panic for stage2 2021-07-07 00:38:46 -07:00
c.zig std.Thread: more cleanup & testing 2021-06-30 21:49:00 -05:00
child_process.zig finish ChildProcess collectOutputWindows 2021-06-18 08:26:22 -06:00
coff.zig Add support for reading DWARF debug information from COFF files 2021-06-18 16:19:20 -07:00
compress.zig std: Update test "" to test where it makes sense 2021-01-22 15:46:58 +01:00
comptime_string_map.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
crypto.zig std: update usage of std.testing 2021-05-08 15:15:30 +03:00
cstr.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
debug.zig Add support for NO_COLOR 2021-07-08 14:30:45 -04:00
dwarf.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
dwarf_bits.zig Year++ 2020-12-31 15:45:24 -08:00
dynamic_library.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
elf.zig Add fat/universal dylib support to zig ld 2021-06-25 08:38:47 +02:00
enums.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
event.zig Year++ 2020-12-31 15:45:24 -08:00
fifo.zig std: update usage of std.testing 2021-05-08 15:15:30 +03:00
fmt.zig compile errors test harness: support unknown file/line/column 2021-07-02 13:28:31 -07:00
fs.zig std: implement a cross platform file locking abstraction 2021-06-29 14:25:04 -07:00
hash.zig Year++ 2020-12-31 15:45:24 -08:00
hash_map.zig std/hash_map: fix ensureUnusedCapacity() over-allocating 2021-07-12 11:31:36 -07:00
heap.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
io.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
json.zig fix style warning in json.zig 2021-07-19 12:55:05 +03:00
leb128.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
linked_list.zig std: fix code unblocked by previous commit 2021-06-21 17:03:03 -07:00
log.zig add compile error if root.log is not a function 2021-06-22 16:38:18 +03:00
macho.zig Add fat/universal dylib support to zig ld 2021-06-25 08:38:47 +02:00
math.zig zig fmt 2021-06-10 20:13:43 -07:00
mem.zig stage2: improve AstGen FileNotFound error message 2021-07-02 15:27:00 -07:00
meta.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
multi_array_list.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
net.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
once.zig changes to accomodate std.Thread update 2021-06-30 21:48:59 -05:00
os.zig std: remove dead code in std.os.read 2021-07-20 10:22:06 +02:00
packed_int_array.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
pdb.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
priority_dequeue.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
priority_queue.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
process.zig Add support for NO_COLOR 2021-07-08 14:30:45 -04:00
Progress.zig std.Progress: revert to the older strategy 2021-07-20 19:11:47 -07:00
rand.zig Switch rand.DefaultPrng to Xoshiro256++ (#9301) 2021-07-08 23:19:49 +02:00
SemanticVersion.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
sort.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
start.zig stage2 plan9: add aarch64 support 2021-07-11 01:58:26 -04:00
start_windows_tls.zig move behavior tests from test/stage1/ to test/ 2021-04-29 15:54:04 -07:00
std.zig x, x/os/Socket: initial work on new Socket abstraction 2021-04-25 21:15:02 +09:00
target.zig initial plan9 boilerplate 2021-07-08 14:10:49 -07:00
testing.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
Thread.zig stage2: miscellaneous fixes for the branch 2021-07-20 12:19:16 -07:00
time.zig std: update usage of std.testing 2021-05-08 15:15:30 +03:00
unicode.zig Add std.unicode.fmtUtf16le 2021-07-15 20:37:16 +03:00
valgrind.zig std: update regarding std.builtin reorganization 2021-05-17 16:08:09 -07:00
wasm.zig std: update usage of std.testing 2021-05-08 15:15:30 +03:00
x.zig x/io, x/os: async i/o reactor, cross-platform socket syscalls and bits 2021-06-01 18:22:57 +09:00
zig.zig plan9 cleanups 2021-07-08 14:24:16 -07:00