The runCases function incorrectly called the introspect.findZigLibDir
function, causing a possible error, depending on the location of the
local cache directory, since the current executable is check-case.
Use findZigLibDirFromSelfExe, passing the zig_exe_path argument.
The current CI scripts work correctly because ZIG_LOCAL_CACHE_DIR is set
to "$(pwd)/zig-local-cache".
Fixes#15044
PPC targets can also use the functionality-equivalent standard routine, so
unconditionally export the standard routine.
Fixup of #16054 merged in f043071cdf.
The assert is changed from `int != 0` to `int > 0` because negative
integers always return `false`.
Python's `math.log2` does the same and errors for 0 or negative integers.
isatty on Windows is implemented as a isCygwinPty call and a GetConsoleMode call, so calling isatty just duplicates the function calls we already need to do in supportsAnsiEscapeCodes.
Make to avoid releasing request's connection twice.
Change the `Request.connection` field optional. This field is null while the connection is released.
Fixes#15965
Adress review comments from https://github.com/ziglang/zig/pull/13977
by using the same naming convention as zstd.
And by using `finish()` instead of `close()` for the finalisation of the compressed stream.
rationale:
- it is not the same as how close() is usually used, since it must be called to flush and write the final bytes. And as such it may fail.
- it is not the same `flush` in the deflate code, which allows to keep writting more bytes later, and doesn't write the final checksum.
- it is the same name as used in the original zlib library (Z_FINISH)
Also, use a packed struct for the header, which seems a better fit.
* langref: improve the Hello World section
Clarify that a Zig source file must have the .zig extension.
Fix a typo.
* langref: improve the Comments section
- Document how doc comments are used by -femit-docs
- Rename "Doc comments" to "Doc Comments", for consistency
- Clarify that placing a doc comment in an unexpected place is a
compiler error and add two incorrect examples
- Document the current Autodoc behavior, when normal comments are
interleaved with doc comments
- Rewrite the documentation for top-level doc comments
* langref: improve the Zig Test section
Document that the test name can also be an identifier, in addition to a
string literal.
Update the test output for the first test.
Closes#14085
Anecdote 1: The generic version is way more popular than the non-generic
one in Zig codebase:
git grep -w alignForward | wc -l
56
git grep -w alignForwardGeneric | wc -l
149
git grep -w alignBackward | wc -l
6
git grep -w alignBackwardGeneric | wc -l
15
Anecdote 2: In my project (turbonss) that does much arithmetic and
alignment I exclusively use the Generic functions.
Anecdote 3: we used only the Generic versions in the Macho Man's linker
workshop.
Adds conditional exports
- __fixkfti
- __fixunskfti
- __floattikf
- __negkf2
- __mulkc3
- __divkc3
- __powikf2
and adjusts tools/gen_stubs.zig.
From https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html:
"When long double transitions to __float128 on PowerPC in the future,
__ibm128 will remain for use in conversions between the two types."
Hence `__extendkftf2` and `__trunctfkf2` for conversion are superfluous
and only using f128 for `kf` routines is justified.
Closes#16057.
Missed this originally because I was only able to trigger it when
SA_RESTART was missing from the sigaction handlers. I'm unconvinced this
is actually a sane way for stdlib to behave (see #15664). But this does
duplicate the existing behavior throughout os.zig which IMO should be
prioritized here.
See https://reviews.llvm.org/D81809 for upstream description.
In summary this is ~10x improvement for small divisors and similar
performance for equal divisors.
Closes#13523.
This is needed in order to remove math.{min,max} from std in favour of
the builtins, since the builtins need the behavior fix from the previous
commit.
Note from Andrew: I updated this commit with zig1.wasm built by me.
Signed-off-by: Andrew Kelley <andrew@ziglang.org>
I achieved this through a major refactor of the logic of analyzeMinMax.
This change should be compatible with vectors of comptime_int, which
Andrew said are supposed to work (but which currently do not).
We now resolve undefined symbols during incremental-compilation
where we discard the current symbol if we detect we found
an existing symbol which is not the one currently being updated.
The symbol will always be discarded in favor of the existing symbol
in such a case.
When lowering a decl value we verify whether its owner decl index
equals to the decl index of the decl being lowered. When this is not
the case, we are lowering an alias. So instead, we will now lower
the owner decl instead and call its symbol to ensure its type
is being correctly generated.