Commit Graph

6452 Commits

Author SHA1 Message Date
Andrew Kelley
4b80e376e3
std.net.getAddressList 2019-10-28 15:29:50 -04:00
Andrew Kelley
4f594527c0
detect async fn recursion and emit compile error 2019-10-28 15:10:48 -04:00
Andrew Kelley
a3222b5ff1
remove dead tls code 2019-10-28 15:10:12 -04:00
Andrew Kelley
b37c009683
Merge pull request #3541 from xackus/language_server
* fix json parser crashing on empty input

* make implicit cast of tagged unions to enums easier to find in docs
2019-10-28 15:08:33 -04:00
Timon Kruiper
03603ea353 Std docs: Fix a js error that would cause some function to be not rendered 2019-10-28 15:06:55 -04:00
Andrew Kelley
f2d0d9820d
synchronize the target features for compiling C code
d91fc0fdd8 changed zig's behavior to
disable the SSE feature when cross compiling for i386-freestanding.

This commit does the same when compiling C Code.
2019-10-28 14:37:32 -04:00
Nathan Michaels
6fdeaac338 Add some documentation for standard library things. (#3540)
* Add some documentation for standard library things.

Added a bunch of descriptions for array_list.
Added some usage notes for failing_allocator.
Documented some of mem.Allocator.
2019-10-28 03:57:23 -04:00
xackus
36fa5fabc6 rename error and specify it in function 2019-10-27 21:52:28 +01:00
xackus
eeb6536c85
better test name for empty string
Co-Authored-By: Andrew Kelley <andrew@ziglang.org>
2019-10-27 21:41:52 +01:00
xackus
8960e8090e make implicit cast of tagged unions to enums easier to find in docs 2019-10-27 21:35:22 +01:00
Andrew Kelley
8af6c7e34c
Merge pull request #3522 from SebastianKeller/WriteJson
Added 'writeJson' to write_stream.zig:
2019-10-27 15:53:24 -04:00
Sebastian Keller
78b00c0b51 Added test for 'emitJson' 2019-10-27 20:49:42 +01:00
Sebastian Keller
ac705a7bb6 Unified public api 2019-10-27 20:15:48 +01:00
Henry Wu
f756d875b1 generated docs: vertically align fns with comments 2019-10-27 15:11:36 -04:00
Andrew Kelley
4a57913ca0
std.target: use mem instead of std.mem 2019-10-27 14:27:20 -04:00
Benoit Giannangeli
73c4a5f186 lib/std/target.zig: Added missing 'mem' constant 2019-10-27 14:26:25 -04:00
xackus
a0abd3be85 fix json parser crashing on empty input
remove unreachable code
2019-10-27 10:45:54 +01:00
Andrew Kelley
05003d533a
Merge pull request #3537 from lun-4/fix/accept4
fix std.os.accept4
2019-10-26 21:31:38 -04:00
Luna
d4e41c5bc6 std: make addr_size parameter be a pointer to socklen_t
removes ptrCast
2019-10-26 22:05:17 -03:00
Luna
bf16fc210b fix std.os.accept4
- add WouldBlock to list of errors in AcceptError
 - ptrCast addr_size to the system's socklen_t, instead of assuming it's
    usize
2019-10-26 22:00:50 -03:00
Andrew Kelley
fafd1fd480
ci: disable test-compare-output on aarch64 2019-10-26 18:48:42 -04:00
Noam Preil
d91fc0fdd8 Don't use SSE on freestanding 2019-10-26 16:46:43 -04:00
Noam Preil
b8305b5648 Don't save/restore stack on newStackCall to noreturn function 2019-10-26 16:45:46 -04:00
Andrew Kelley
ee21bab253
ci: -Dskip-release for aarch64 to hit 1 hour time limit 2019-10-26 13:14:54 -04:00
Timon Kruiper
d04c58816d Translate-c: Fix a segfault when to many errors are emitted
This was already fixed when doing `@cImport`, but not yet when
running `zig translate-c`.
2019-10-26 13:09:23 -04:00
Andrew Kelley
05fd59e06a
ci: enable more passing tests on aarch64-linux 2019-10-26 12:09:15 -04:00
Michael Dusan
3aeb1b115d stage1: fix compile error on macOS Xcode 11.2
src/codegen.cpp:7713:33: error: unused variable 'global_linkage_values' [-Werror,-Wunused-const-variable]
static const GlobalLinkageValue global_linkage_values[] = {
2019-10-25 17:49:01 -04:00
Andrew Kelley
e219f0c786
fix regression in zig run
changes in 1dcf540426 added a "double
free" of the progress node, causing a segfault for `zig run` when there
is a terminal attached. fixed.
2019-10-25 13:03:12 -04:00
Andrew Kelley
952aa7a9c1
ci: perform git config inside zig git repo dir 2019-10-25 04:26:22 -04:00
Andrew Kelley
c5e26b8673
ci: force git name-rev to be 9 on all targets 2019-10-25 03:27:00 -04:00
Andrew Kelley
aa2607a109
Merge branch 'ci-drone-cloud' 2019-10-24 21:41:14 -04:00
Andrew Kelley
6eba65bd7f
ci: add aarch64 to download page 2019-10-24 21:40:26 -04:00
Andrew Kelley
bf5be65be6
disable not working stuff 2019-10-24 21:13:47 -04:00
Andrew Kelley
55c282ed51
os.dup2: handle EBAF 2019-10-24 21:13:05 -04:00
Andrew Kelley
f6367a0751
ci: build docs, fix PR logic 2019-10-24 20:47:50 -04:00
Andrew Kelley
695a746aa0
ci: use x86_64 namespaced docker image
I took a risk that docker had implemented namespacing with regards to
architectures correctly, but of course they didn't. So the CI docker
image for x86_64 was clobbered by an aarch64 image with the same name.

Now we're doing arch namespaces with the tag name, so here's the x86_64
one.
2019-10-24 20:46:07 -04:00
Andrew Kelley
551e70dcb2
ci: add s3 secrets to drone config 2019-10-24 19:46:11 -04:00
Andrew Kelley
43f5054a90
ci: drone tests only aarch64 with docker image 2019-10-24 19:46:11 -04:00
Andrew Kelley
79cb383f7d
fix 32-bit build of translate_c.zig 2019-10-24 19:46:11 -04:00
Andrew Kelley
0e9f32d42b
disable static build for now until the docker image is ready 2019-10-24 19:46:11 -04:00
Andrew Kelley
099532af87
add Drone Cloud CI configuration 2019-10-24 19:46:11 -04:00
Andrew Kelley
ad438a95c5
avoid passing -march=native when not supported
Clang does not support -march=native for all targets.
Arguably it should always work, but in reality it gives:
error: the clang compiler does not support '-march=native'
If we move CPU detection logic into Zig itelf, we will not need this,
instead we will always pass target features and CPU configuration explicitly.
For now, we simply avoid passing the flag when it is known to not be
supported.
2019-10-24 19:43:56 -04:00
Andrew Kelley
f8bd1cd3b1
implement partial C ABI support for aarch64 2019-10-24 19:13:21 -04:00
Sebastian Keller
6257b4c596 Shortened switch statement 2019-10-24 22:44:12 +02:00
Andrew Kelley
32c89531b1
Add missing compile error when ptr used instead of array
in array literals.

Fixes #3524
2019-10-24 16:23:33 -04:00
Sebastian Keller
b82b6a7093 Added 'writeJson' to write_stream.zig:
Small addition to make writing a json value easier
2019-10-24 14:23:36 +02:00
Andrew Kelley
345042ecbc
Merge pull request #3519 from ziglang/move-builtin-types
move types from builtin to std
2019-10-24 02:25:22 -04:00
Andrew Kelley
60cd11bd4b
get rid of std.os.foo.is_the_target
It had the downside of running all the comptime blocks and resolving
all the usingnamespaces of each system, when just trying to discover if
the current system is a particular one.

For Darwin, where it's nice to use `std.Target.current.isDarwin()`, this
demonstrates the utility that #425 would provide.
2019-10-24 01:14:52 -04:00
Andrew Kelley
8591731f2b
refAllDecls in a test block to limit when it gets run 2019-10-24 00:32:18 -04:00
Andrew Kelley
17eb24a7e4
move types from builtin to std
* All the data types from `@import("builtin")` are moved to
  `@import("std").builtin`. The target-related types are moved
  to `std.Target`. This allows the data types to have methods, such as
  `std.Target.current.isDarwin()`.
 * `std.os.windows.subsystem` is moved to
   `std.Target.current.subsystem`.
 * Remove the concept of the panic package from the compiler
   implementation. Instead, `std.builtin.panic` is always the panic
   function. It checks for `@hasDecl(@import("root"), "panic")`,
   or else provides a default implementation.

This is an important step for multibuilds (#3028). Without this change,
the types inside the builtin namespace look like different types, when
trying to merge builds with different target settings. With this change,
Zig can figure out that, e.g., `std.builtin.Os` (the enum type) from one
compilation and `std.builtin.Os` from another compilation are the same
type, even if the target OS value differs.
2019-10-23 19:09:49 -04:00