Commit Graph

4753 Commits (8ce130de3cf38e09cfbcbd1b22da34ae5b27a040)

Author SHA1 Message Date
Jimmi Holst Christensen 7c38651a65 Merge branch 'master' of github.com:ziglang/zig 2019-04-07 03:19:08 +02:00
Jimmi Holst Christensen 6960cd156a Added regression test for #1607. fixes #1607 2019-04-07 03:18:51 +02:00
Andrew Kelley 77c2036159
Merge pull request #2200 from ziglang/fix-1726
fixed #1726
2019-04-06 12:49:00 -04:00
Jimmi Holst Christensen 65cf5a8e44 removed todo comment and added test 2019-04-06 11:04:55 +02:00
Jimmi Holst Christensen 3109c89850 fixed 1726 2019-04-06 10:56:07 +02:00
Andrew Kelley f00adb47f5
ir: avoid dependency on isnan
there's a simple way to check for nan that does not need this header.
hryx on IRC reported that Linux Mint based on ubuntu 16.04, kernel
4.15.0, x86_64 did not have the isnan function.
2019-04-06 01:03:30 -04:00
Andrew Kelley 974977f12f
docgen: add a space between the header and the section symbol 2019-04-05 23:12:25 -04:00
Andrew Kelley 83390bdfdd
fix dereferencing a zero bit type
Before only u0 was special cased in handling a dereference;
now all zero bit types are handled the same way. Dereferencing
a pointer to a zero bit type always gives a comptime-known
result.

This previously had been failing on master branch but went unnoticed
because until 846f72b57c the CI server was mistakenly not actually
running the single-threaded tests with --single-threaded.

This fixes the standard library tests with --single-threaded
--release-fast.
2019-04-05 20:18:26 -04:00
Shritesh Bhattarai 3854bb9198 wasm: Pass --allow-undefined and --export-all to the linker 2019-04-05 18:46:11 -04:00
Shritesh Bhattarai 66fab05eba build: usageAndErr clean exit (#2194)
* build: usageAndErr clean exit
2019-04-05 18:38:11 -04:00
Shritesh Bhattarai 895e6eabc2 Fix getCurrentId test for pthreads (#2197)
* Fix getCurrentId test for pthreads
2019-04-05 18:12:46 -04:00
vegecode d72239d339 Add divdf3 to compiler_rt
Also adds __aeabi_ddiv for arm32 targets
2019-04-05 18:10:19 -04:00
Andrew Kelley 1f9ebf49f8
ci: stop doing the branch redirect thing
Now that we have https://ziglang.org/download/index.json

See #1046
2019-04-05 17:33:58 -04:00
Andrew Kelley f6be6ace1f
docgen: allow urls to have numbers 2019-04-05 17:33:58 -04:00
Andrew Kelley fd65cdc55a
fix incorrect Thread.getCurrentId test
Documentation comments copied here:

On Linux, it is possible that the thread spawned with `spawnThread`
finishes executing entirely before the clone syscall completes. In this
case, `std.os.Thread.handle` will return 0 rather than the
no-longer-existing thread's pid.
2019-04-05 16:06:35 -04:00
Andrew Kelley c47c2a2f2a stage1: fix debug builds on macOS 2019-04-05 15:39:00 -04:00
Andrew Kelley 846f72b57c
zig build: support single-threaded builds
and fix the zig test suite not setting the --single-threaded flag
2019-04-05 14:54:37 -04:00
Andrew Kelley a5b47bc2c2
docs: update `@typeInfo` definition and clarify field order 2019-04-05 12:38:15 -04:00
Shritesh Bhattarai 2f236e6efb fmt: support trailing comma after var_args 2019-04-05 12:27:13 -04:00
Shritesh Bhattarai 6cc2d3938e support comptime_int in formatInt{,Value} 2019-04-05 11:11:04 -04:00
Jay Weisskopf 3cce56af99 docs: Use section symbol §, not paragraph symbol ¶
A header may cover more than one paragraph, so a section symbol is more appropriate. 

https://en.wikipedia.org/wiki/Section_sign
2019-04-05 11:09:38 -04:00
vegecode c24a49a1a7 Fixes to divsf3 (#2186)
* Fixes to divsf3

Embarrassingly failed to notice a section that was unchanged from where
it was copied from mulXf3.zig. The test cases for this function series
div{s,d,t}f3 are very incomplete and don't exercise all code paths.

Remove unnecessary switch from divsf3 left during development from when
I tried to make it generic to support f32, f64, and f128 in one go.

Make runtime safety dependent on whether a test is being run.

* divsf3: switch plus to minus
2019-04-05 11:04:46 -04:00
Shawn Landden aecbd1892a Simplify math.isnan
We can just rely on the builtin behavior.
2019-04-05 11:03:57 -04:00
Andrew Kelley 1dc6751721
fix NaN comparing equal to itself
This was broken both in comptime code and in runtime code.

closes #1174
2019-04-04 22:07:15 -04:00
Shritesh Bhattarai 8e6ff8d615 fmt: format multi line only on trailing comma (#2184)
* fmt: format multi line only on trailing comma
2019-04-04 19:33:32 -04:00
Andrew Kelley 5866dfe4d9
Merge pull request #2109 from emekoi/fix-mingw
fixed libc command on mingw
2019-04-04 15:55:40 -04:00
Andrew Kelley be0f656c21
fix `@divFloor` returning incorrect value and add `__modti3`
Closes #2152
See #1290
2019-04-04 15:45:37 -04:00
vegecode 12c4ab3927 Add divsf3 to compiler rt 2019-04-04 15:38:09 -04:00
Andrew Kelley 7dd1e0fc2b
docs: add Variables section
closes #1927
2019-04-04 12:26:47 -04:00
Andrew Kelley c195d645e4
add regression test for #1025
closes #1025
2019-04-04 01:45:18 -04:00
Andrew Kelley 947c87b558
threads: fix using unmapped memory in some cases
as pointed out in #musl IRC, the memory for the fs register address
value needs to be taken into account in the mmap call.
2019-04-04 01:36:01 -04:00
hryx e827b9661b zig fmt: Prevent for-else on same line when body is interrupted by LF 2019-04-04 01:31:39 -04:00
hryx cec8c8678a zig fmt: Fix regression in for-else (#2178) 2019-04-04 01:31:39 -04:00
Andrew Kelley 90b6eab05a
docs: complete the documentation for extern struct
closes #1522
2019-04-04 01:23:41 -04:00
Andrew Kelley e4d595a8ba
fix thread local variables for non- position independent code
This fixes comes thanks to Rich Felker from the musl libc project,
who gave me this crucial information:

"to satisfy the abi, your init code has to write the same value
to that memory location as the value passed to the [arch_prctl]
syscall"

This commit also changes the rules for when to build statically
by default. When building objects and static libraries, position
independent code is disabled if no libraries will be dynamically
linked and the target does not require position independent code.

closes #2063
2019-04-04 01:08:26 -04:00
Ruslan Prokopchuk 70ae3222b5 handle LibExeObjStep.disable_gen_h
It is sometimes useful to skip generating of the header file (e.g. https://github.com/ziglang/zig/issues/2173), and zig compiler provides an option `--disable-gen-h` to control that behaviour. However, setting `lib.disable_gen_h = true` in a typical `build.zig` didn't append the option to arguments. This commit fixes it and adds a convenient `setDisableGenH` setter.
2019-04-03 18:31:25 -04:00
Andrew Kelley 4795f161e6
Merge pull request #2175 from tgschultz/stdlib-serialization-minor_changes
Minor changes to serializer/deserializer
2019-04-03 18:13:25 -04:00
Andrew Kelley b60f2d0c9f
langref: rework the theming and layout
* Instead of the only color scheme being dark, the language reference
   now has a light theme by default, and respects the user's light/dark
   preference via prefers-color-scheme media query. Most browsers don't
   support this yet, so we just have to wait patiently for the future to
   arrive. closes #2172.

 * Instead of a side bar index, the index is inline with the rest of the
   content. This is simpler and more friendly to all user agents, and means
   we don't need the media query for mobile devices. It also makes
   back-references work, so now headers link to the table of contents
   and the table of contents links to headers.
2019-04-03 17:39:07 -04:00
tgschultz fe33d8ea14 Changes as suggested by andrewrk 2019-04-03 20:05:24 +00:00
Andrew Kelley 692086f898
ci: add missing cache control headers and update download/index.json 2019-04-03 16:04:24 -04:00
tgschultz ba774c5697 (De)serializer now uses enum instead of bool to determine packing mode (byte/bit).
Optional is initialized in a more straight-forward way by deserializer.
2019-04-03 15:47:46 +00:00
Andrew Kelley 85edf55b73
Merge pull request #2135 from ziglang/decouple-llvm-types
decouple llvm types from zig types
2019-04-02 23:17:17 -04:00
Andrew Kelley 025a1475c4
emit better debug info for enums
fixes llvm assertion when building for windows
2019-04-02 19:40:33 -04:00
Andrew Kelley 6a7b75b73c
fix LLVM assertion failures 2019-04-02 19:09:25 -04:00
Andrew Kelley 15bd4aa54f fix setting union body twice 2019-04-02 18:43:25 -04:00
Andrew Kelley e9dc504141
avoid tripping assertion for setting struct body twice 2019-04-02 18:31:19 -04:00
Andrew Kelley d577dde636
passing all tests 2019-04-02 18:31:19 -04:00
Andrew Kelley 9780fd59f0
put the alignment hack in for unions too. fixes std tests 2019-04-02 18:31:19 -04:00
Andrew Kelley cb0241fe44
behavior tests passing again 2019-04-02 18:31:19 -04:00
Andrew Kelley 4c38a8cce1
more regression fixes. empty test passes again 2019-04-02 18:31:19 -04:00