Commit Graph

8767 Commits

Author SHA1 Message Date
Andrew Kelley
c236cbff39
Merge pull request #5003 from emekoi/fix-mingw
fix compilation under mingw
2020-04-11 16:43:38 -04:00
Andrew Kelley
eefe6956fd
clarify what "not valid" means 2020-04-11 16:43:19 -04:00
emekoi
de08d283da fix compilation under mingw 2020-04-11 15:18:54 -05:00
emekoi
1a4f46ae7d add note about @tagName for non-exhaustive enums 2020-04-11 01:01:37 -05:00
Andrew Kelley
a6e288d5fe
Merge pull request #4711 from leroycep/feature-file-locks
Add lock option to File.OpenFlags and File.CreateFlags
2020-04-10 15:00:45 -04:00
Timon Kruiper
121307679b Fix generated docs of user code
fff3c1fff4 broke the docs generation for
own user code. This adds a workaround, because all the code in docs/main.js
is relying on the fact that the root package of the main package is the
root package itself.
2020-04-10 14:59:51 -04:00
LemonBoy
72dca05f5c debug: Fix parsing of DWARF info for BE machines
Tested with ppc32
2020-04-10 14:59:19 -04:00
Vexu
1b1cbd9358
Merge pull request #4973 from SuperAuguste/nameless-fields
Nameless fields
2020-04-10 21:31:32 +03:00
Auguste Rame
df14578c9d
Merge branch 'master' into nameless-fields 2020-04-10 11:49:50 -04:00
Vexu
732c0cb58c
Merge pull request #4985 from Vexu/assignment-error
Add missing error message for invalid assignment
2020-04-10 18:26:45 +03:00
Andrew Kelley
4871345545 update readme instructions for homebrew 2020-04-10 01:29:04 -04:00
Andrew Kelley
e857190dab put the previous commit behind cmake option ZIG_PREFER_CLANG_CPP_DYLIB
Without this, building from source caused:

CommandLine Error: Option 'mc-relax-all' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

This is due to LLVM static libs compiled in multiple times. But without
the LLVM static libs on the linker line, it caused undefined symbol
linker errors.

So our hands are tied. Homebrew users will have to specify
`-DZIG_PREFER_CLANG_CPP_DYLIB`.
2020-04-10 01:25:15 -04:00
Andrew Kelley
aaf99371b2 look for clang-cpp shared lib when it exists
See #4799
2020-04-10 00:38:19 -04:00
Andrew Kelley
543031db35
Merge pull request #4982 from MageJohn/fix/binarySearch
sort.binarySearch: fix integer underflow (#4980)
2020-04-09 14:58:07 -04:00
joachimschmidt557
f1360bee1c Update docgen to new ArrayList API 2020-04-09 14:57:14 -04:00
Vexu
f60e7348d5
add error message for invalid assignment 2020-04-09 11:50:32 +03:00
Yuri Pieters
f5f77089b7 sort.binarySearch: Remove unneeded edge case check 2020-04-09 09:13:47 +01:00
Andrew Kelley
beae932e0f
Merge pull request #4975 from Vexu/param-reassign
Fix missing compile error on assign to slice and array parameters
2020-04-08 21:02:50 -04:00
markfirmware
c3afaa1f58 Update langref.html.in 2020-04-08 21:00:43 -04:00
Michael Dusan
57a2c5a63c ci: bump static-qemu 5.0.0-rc1 → 5.0.0-rc2 2020-04-08 21:00:17 -04:00
Yuri Pieters
b7e72cc421 sort.binarySearch: test for regresson of #4980 2020-04-09 02:00:08 +01:00
Yuri Pieters
447dc2bb90 sort.binarySearch: fix integer underflow (#4980)
When the key was smaller than any value in the array, an error was
ocurring with the mid being zero and having 1 subtracted from it.
2020-04-09 01:58:57 +01:00
LeRoyce Pearson
5951211d3f Reduce file lock test sleep time 2020-04-08 18:03:52 -06:00
Andrew Kelley
c45ba49b8b
fix formatted printing warning
needed to use ZIG_PRI_u64 instead of %lu
2020-04-08 19:30:18 -04:00
LeRoyce Pearson
d4161e1667 Close file1 in nonblocking lock test 2020-04-08 16:42:11 -06:00
LeRoyce Pearson
772bb1ade3 Disable open flock flags on darwin
The tests were put into a deadlock, and it seems that darwin doesn't
support `O_SYNC`, though it supports `O_NONBLOCK`. It shouldn't block
even with that, but I'm not sure why else it would fail.
2020-04-08 16:38:58 -06:00
Andrew Kelley
d5087ccbc8
cmake: expose ZIG_TARGET_MCPU option 2020-04-08 17:41:51 -04:00
Andrew Kelley
29ea425ca2
Merge branch 'LakeByTheWoods-translate_ptr_int'
closes #4688
2020-04-08 14:11:16 -04:00
Lachlan Easton
d7902707bc
Translate C: Allow casting literal ints to pointers 2020-04-08 14:11:01 -04:00
Vexu
7b5fb79b5b
Translate C: Put an alignCast in c style pointer casts to allow opaque types to cast properly in C macros
Translate C: add test case for aligning opaque types in pointer casts
2020-04-08 14:11:01 -04:00
LeRoyce Pearson
d0d7895d33 Return error from else
That removes the other switch cases (`error.WouldBlock` here) from the
error set, I think.
2020-04-08 08:37:17 -06:00
Vexu
b1e44adcba
move array and struct const checks to more appropriate places 2020-04-08 14:32:02 +03:00
LeRoyce Pearson
45d6fb9e36 Catch error.WouldBlock as unreachable 2020-04-08 00:39:17 -06:00
Andrew Kelley
b3aef49eea
zig provides shlwapi.lib for *-windows-gnu
closes #3711
2020-04-08 01:21:00 -04:00
LeRoyce Pearson
858aefac7f Add OpenFileW share_access_nonblocking parameter 2020-04-07 21:26:46 -06:00
Phil Schumann
b109186dd5
std/zig/parse_string_literal.zig: add hex+unicode escapes (#4678) 2020-04-07 20:27:18 -04:00
LeRoyce Pearson
317f06dc77 Add lock_nonblocking flag for creating or opening files
Also, make windows share delete access. Rationale: this is how it works
on Unix systems, mostly because locks are (usually) advisory on Unix.
2020-04-07 18:00:12 -06:00
LeRoyce Pearson
117d15ed7a Fix file locking on windows
The share_access bitfield was being ORed with what was supposed to be
parts of the default value, meaning that the share_access would be
more permissive than expected.
2020-04-07 16:49:37 -06:00
LeRoyce Pearson
71c5aab3e7 Make lock option an enum
For some reason, this breaks file locking on windows. Not sure if this is
a problem with wine.
2020-04-07 16:49:30 -06:00
xackus
66b2477ab6 fix lazy value in ir_analyze_instruction_elem_ptr 2020-04-07 18:22:17 -04:00
Vexu
ff0f97a1bc
fix missing compile error on assign to slice and array parameters 2020-04-08 00:27:14 +03:00
Andrew Kelley
ed23dad487
fix the new runtime-safety tests
Thanks to Vexu's work in e62671f643, compile errors were identified in
these test cases! This commit fixes them to use `const` as appropriate.
2020-04-07 16:05:42 -04:00
SuperAuguste
116c76cf82 fix tests 2020-04-07 15:19:28 -04:00
SuperAuguste
882aa86843 more fixes 2020-04-07 15:08:46 -04:00
Andrew Kelley
4d290758bb
fix compile errors in some std.Target functions
The `ve` architecture needed to be added to a couple switch statements.
2020-04-07 15:06:58 -04:00
xackus
b7f116a774 langref: small updates 2020-04-07 14:54:53 -04:00
Andrew Kelley
22dbeab29d
Merge pull request #4857 from LemonBoy/fix-4777
Rewrite the bound checks in slice operator
2020-04-07 14:51:25 -04:00
LemonBoy
cc0fca9d83 stage1: Respect the specified name for extern var
Extend the logic used for function definitions to variables.

Closes #4947
2020-04-07 14:48:37 -04:00
Vexu
adaf7ad672
Merge pull request #4684 from LakeByTheWoods/comment_failed_decls
Translate C: Add comment containing c source location for failed decls
2020-04-07 21:47:32 +03:00
SuperAuguste
f21ac0220a msvc fix 2020-04-07 14:39:24 -04:00