Commit Graph

4234 Commits

Author SHA1 Message Date
codic12
d8b133d733 c.zig: fix waitpid() definition 2021-06-11 20:43:14 +03:00
Ellis Trisk-Grove
ba7bfe949e std.build.InstallDir: make dupe() a public function
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2021-06-11 20:24:56 +03:00
Asa Zeren
6cc8845802 Change defineCMacro to take separate name and value arugments
Before this change, when one or more of name or value are not known at
comptime, build.zig files must allocate and do the concatanation, which can be
cumbersome, and also adds a redundant allocation when name and value are
slices. The new version only does a single allocation directly in the builder's
allocator to concatonate name and value.

The origional behavior is available in defineCMacroRaw, for use in situations
such as parseing c compiler arguments.

Additionally, several places have been updated to use the new funtions.
2021-06-11 20:18:19 +03:00
Veikka Tuominen
0bde5ce369
Merge pull request #8330 from kivikakk/single-limb-bigint-overflow
bigint add failures with aliasing
2021-06-11 19:17:01 +03:00
Veikka Tuominen
c5d4122684
Merge pull request #7959 from MasterQ32/build_rewrite
Make build.zig ready for generated files
2021-06-11 19:13:14 +03:00
codic12
1b3cc66334
c.zig: add sigfillset, alarm, sigwait
I've added these three functions to all switches except NetBSD, because I don't know what the function is named there. I've even added it on the .windows switch since all the posix functions seem to be there anyways.
2021-06-11 16:28:20 +03:00
Asherah Connor
e56ba4cee1 bigint: add ensureAdd(Scalar)Capacity, note aliasing requirements 2021-06-11 16:18:10 +03:00
Asherah Connor
b15e205438 bigint: use a stack local here to prevent aliasing issues 2021-06-11 16:18:10 +03:00
Asherah Connor
1db6018140 bigint: add failing tests for bigint carry 2021-06-11 16:18:06 +03:00
Veikka Tuominen
4b72b0560d make remaining enums in build.zig snake_case 2021-06-11 16:01:30 +03:00
LemonBoy
56c0a66ce3 std: Fix tanh for negative inputs
It turns out the code was not ported correctly from C and produced wrong
results for negative input values. As a bonus fix the NaN codepath by
adding yet another missing piece of code.

Spotted in #9047
2021-06-11 14:04:46 +03:00
viri
2ce033f415
std.os.windows: implement <timeapi.h> (#8801) 2021-06-11 12:19:35 +03:00
Felix (xq) Queißner
1c1ea2baa7 Code quality improvements to GeneratedFile, and manual implementation of Builder.addObjectSource. 2021-06-11 10:43:52 +03:00
Felix (xq) Queißner
98941cf27c Makes output path stuff more sane. 2021-06-11 10:43:38 +03:00
Felix (xq) Queißner
27bd0971bb Changes to .path instead of .getPathFn. Changes LibExeObjStep to also provide FileSource. 2021-06-11 10:39:50 +03:00
Felix (xq) Queißner
07acb1ccc9 Changes createExecutable parameter is_dynamic to a enum to make code more readable . 2021-06-11 10:38:57 +03:00
Felix (xq) Queißner
56cb0b5ca0 Moves files to file-global struct layout. 2021-06-11 10:33:27 +03:00
Felix (xq) Queißner
8501bb04ad Adds a lot of missing dupes, some more snakes. 2021-06-11 10:33:26 +03:00
Felix (xq) Queißner
4ed567d12e Adds more FileSources everywhere. 2021-06-11 10:33:26 +03:00
Felix (xq) Queißner
437f81aa9a Starts to replace special cases in std.build.FileSource. 2021-06-11 10:33:10 +03:00
Andrew Kelley
138afd5cbf zig fmt 2021-06-10 20:13:43 -07:00
Jens Goldberg
a3f7a48d9c netlink ifi_change no longer reserved
The documentation (e.g. `man 7 rtnetlink`) states that ifi_change "is reserved for future use and should be always set to 0xFFFFFFFF". This is no longer true, even though the text hasn't been updated.
2021-06-10 22:13:37 +03:00
purringChaos
2e4937b695 Correct a comment. 2021-06-10 13:49:09 -04:00
Frank Denis
2a7fdd56c6
aes 128-bit key expansion test - properly test the inverse round keys (#9065) 2021-06-10 12:58:50 +02:00
daurnimator
916b645fc1 Have std.fmt functions take case as an enum 2021-06-10 08:33:42 +03:00
Jakub Konka
e8e305b67c Re-enable multiple wasm32 vector tests
Fixes #5339
2021-06-09 23:54:23 -04:00
Lee Cannon
629e2e7844
Add a logging allocator that uses std.log (#8511) 2021-06-09 21:42:07 +03:00
Filippo Casarin
8b0dbca32d std.math.sqrt_int: fixed odd size integers types 2021-06-09 19:16:55 +03:00
viri
13dc34f779 std.Progress: use *W functions on windows
Closes #534.
See: https://source.winehq.org/git/wine.git/blob/refs/heads/stable:/dlls/kernelbase/console.c#l520
2021-06-09 19:10:28 +03:00
viri
610ce544d5 windows: remove TCHAR idiom entirely 2021-06-09 19:10:28 +03:00
Vincent Rischmann
c71e8a30cd os/linux: add fadvise 2021-06-09 18:15:50 +03:00
Vincent Rischmann
7f32c799a9 os/bits/linux: add the fadvise advice values 2021-06-09 18:15:50 +03:00
Matthew Borkowski
21af264e3a let GeneralPurposeAllocator retain metadata to report more double frees 2021-06-09 12:29:50 +03:00
Lee Cannon
50822530d3
Provide method to set logging level per scope (#8584) 2021-06-09 12:23:45 +03:00
Jakub Konka
2d43db1d76 libc,macos: update and add missing libc headers 2021-06-08 18:38:03 -04:00
jacob gw
b57ac48773 stage2: compile error for ambiguous decl refrences
std: fix compile errors from this change. This is a stage1 bug.
2021-06-08 18:13:12 -04:00
xackus
143688e266 add allocation free versions of lower/upper string
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2021-06-08 14:27:44 -04:00
Tom Maenan Read Cutting
c822a0b59f Add linkLibCpp helper to LibExeObjStep 2021-06-08 21:14:26 +03:00
LemonBoy
ec4e67fb0e std: Better formatting of tuple types
Skip the useless type name and the numeric field names.
2021-06-08 21:02:56 +03:00
Matthew Borkowski
ff0a15bb7a parse.zig: make parseParamDeclList check for nonfinal varargs 2021-06-08 20:50:55 +03:00
Matthew Borkowski
8bf04c3a69 parse.zig: simplify parseParamDeclList by always using scratch buffer 2021-06-08 20:50:55 +03:00
Dustin Taylor
c34e9c73ab
Limit Fixed Buffer Stream seekTo (#9023) 2021-06-08 20:34:57 +03:00
ArtixFox
032204ffe7
Changed return values of SectionHeaderIterator().next() to bswapAllFields() (#9014) 2021-06-08 20:32:12 +03:00
Jakub Konka
b0ee911c23 wasi: always grant fd_readdir right
Since v0.23 release of Wasmtime, if we want to iterate a directory
Y then directory Y needed to have been granted `fd_readdir` right.
However, it is now also required for directory X to carry `fd_readdir`
right, and so on, up-chain all the way until we reach the preopen
(which possesses all rights by default).

This caused problems for us since our libstd implementation is more
fine-grained and allowed for parent dirs not to carry the right while
allow for iterating on its children. My proposal here is to always
grant `fd_readdir` right as part of
`std.fs.Dir.OpenDirOptions.access_sub_paths`. This seems to be the
approach taken by Rust also, plus we should be justified to take this
approach since WASI is experimental and snapshot1 will be discontinued
eventually and replaced with a new approach to access management
that will require a complete rewrite of our libstd anyhow.
2021-06-08 05:48:33 +02:00
Jens Goldberg
7462b0e5b9
Add Linux XDP bits (#9019) 2021-06-07 21:33:29 -04:00
Andrew Kelley
b973e0a3e3 fix doc comments copy paste typo 2021-06-06 18:05:06 -07:00
LemonBoy
0c091f8b09 std: Add helpers to safely align pointers
Add two helpers to ensure people won't ignore some edge cases such as
pointers overflowing the address space.

Also fix #8924 to some degree, the amount of unchecked alignForward is
still scary.
2021-06-06 18:04:16 -07:00
LemonBoy
e44b55b072 std: Fix some BPF fn definitions
Cros-checked with bpf.h of kernel 5.12.9.
2021-06-06 20:41:14 -04:00
LemonBoy
734a5cd6d1 build: Avoid using undefined variables
Closes #9013
Closes #8928
Closes #7991
2021-06-06 19:57:07 -04:00
Frank Denis
ca6951ff79
std.crypto: timing-safe functions to add&subtract serialized integers (#8977)
This is useful to increment nonces and for scalar reduction.

It will avoid code duplication in crypto/25519 and crypto/pcurves/*
2021-06-06 16:37:58 +02:00