Commit Graph

4033 Commits (280187031a68c577e84c72add037271153d27c62)

Author SHA1 Message Date
Andrew Kelley 280187031a
tests: make type info tests not depend on builtin.Os enum 2018-12-23 18:03:22 -05:00
Andrew Kelley 45081c1e9c
hello world example can use `const` instead of `var` 2018-12-23 13:57:37 -05:00
Andrew Kelley 218a4d4b30
comptime: ability to @ptrCast to an extern struct and read fields 2018-12-22 23:06:30 -05:00
Andrew Kelley f301474531
self-hosted: add DeviceBusy as a BuildError 2018-12-21 23:01:21 -05:00
Andrew Kelley 0eba5b6744
I observed open() return EBUSY on linux
when trying to open for writing a tty fd that is already opened with
screen
2018-12-21 19:50:21 -05:00
Andrew Kelley 56fedbb524
translate-c: --verbose-cimport prints clang command 2018-12-20 19:56:24 -05:00
myfreeweb fa6c7c1303 Use Ninja in .builds/freebsd.yml
It's faster and doesn't require manually getting the number of CPUs
2018-12-20 15:15:25 -05:00
tgschultz f35ba34a88 Removed allocator from Linux version DynLib. Added dynamic_library.zig to std test list. 2018-12-20 14:49:34 -05:00
Andrew Kelley 8cf3543c80
Merge branch 'mgxm-srtht_fbsd' 2018-12-20 14:18:22 -05:00
Andrew Kelley 2a776ed8a8
ci: only run the debug behavior tests for FreeBSD 2018-12-20 14:18:02 -05:00
Marcio Giaxa 4840600988
ci: add sr.ht build manifest for FreeBSD 2018-12-20 12:40:05 -05:00
Andrew Kelley 459045aa40
Merge branch 'kristate-zig-backport-issue1832' 2018-12-20 12:36:30 -05:00
Andrew Kelley 0f54194e6a
fixups 2018-12-20 12:36:15 -05:00
kristopher tate fb81b1978b
tests: re: 79db394;
ref: ziglang/zig#1832
2018-12-20 22:53:54 +09:00
kristopher tate 39567e8b50
src/analyze.cpp: support alignOf(struct T) aligned member inside struct T;
ref: ziglang/zig#1832
2018-12-20 22:53:54 +09:00
Andrew Kelley 8768816d69
std.io: call the idiomatic std.mem.readInt functions
I originally called the Slice variants to work around
comptime code not supporting `@ptrCast`, but I fixed that
in 757d0665 so now the workaround is no longer needed.
2018-12-19 17:48:21 -05:00
Jimmi Holst Christensen a7670e80a4 Added formatting of function pointers (#1843) 2018-12-19 10:07:35 -05:00
Jimmi Holst Christensen 45e72c0b39 Fixed intToPtr to fn type when the address is hardcoded (#1842)
* Fixed intToPtr to fn type

* Added test

* Import inttoptr.zig in behavior.zig
2018-12-19 09:39:18 -05:00
Jimmi Holst Christensen 260c3d9cc0 formatType can now format comptime_int 2018-12-19 11:50:29 +01:00
Andrew Kelley f6a02a427f
README: clarify self-hosted status 2018-12-18 15:55:00 -05:00
Andrew Kelley e077a44656
ir: delete dead code 2018-12-18 15:48:26 -05:00
Andrew Kelley f75262b79f
fix comptime pointer reinterpretation array index offset
closes #1835
2018-12-17 11:05:50 -05:00
Andrew Kelley 5a68c60023
ci: update msys packages before installing 2018-12-16 12:32:20 -05:00
Andrew Kelley 757d0665ae
implement comptime pointer cast
closes #955
closes #1835
2018-12-16 12:08:14 -05:00
Josh Wolfe 7533d1b14c mem foreign functions call the native ones
this reduces the amount of implementation to change for #1835
2018-12-16 11:59:29 -05:00
Andrew Kelley 624c74af6f
ci: install openssl on windows 2018-12-16 11:22:33 -05:00
Andrew Kelley 82bf1eb7a1
docs: fix alphabetical sorting of builtin functions 2018-12-14 20:21:23 -05:00
Andrew Kelley 0afb868684
Merge branch 'suirad-windows-wide-imports' 2018-12-13 18:50:11 -05:00
Andrew Kelley fff6e47125
fixups 2018-12-13 17:13:10 -05:00
Andrew Kelley 457f03e37d
Merge branch 'windows-wide-imports' of https://github.com/suirad/zig into suirad-windows-wide-imports 2018-12-13 15:57:24 -05:00
Andrew Kelley e98ba5fc40
add mem.readVarInt, fix InStream.readVarInt, fix stack traces
fixes a regression from b883bc8
2018-12-13 06:38:14 -05:00
Andrew Kelley 6395cf8d6b
fix mistakes introduced in b883bc8 2018-12-13 06:07:39 -05:00
Andrew Kelley 7417f2e4b3
freebsd: fix issues with syscalls 2018-12-13 00:33:13 -05:00
Andrew Kelley d770333827
freebsd: fix os_self_exe_path function and update std lib 2018-12-12 22:28:15 -05:00
Andrew Kelley b883bc873d
breaking API changes to all readInt/writeInt functions & more
* add `@bswap` builtin function. See #767
 * comptime evaluation facilities are improved to be able to
   handle a `@ptrCast` with a backing array.
 * `@truncate` allows "truncating" a u0 value to any integer
   type, and the result is always comptime known to be `0`.
 * when specifying pointer alignment in a type expression,
   the alignment value of pointers which do not have addresses
   at runtime is ignored, and always has the default/ABI alignment
 * threw in a fix to freebsd/x86_64.zig to update syntax from
   language changes
 * some improvements are pending #863

closes #638
closes #1733

std lib API changes
 * io.InStream().readIntNe renamed to readIntNative
 * io.InStream().readIntLe renamed to readIntLittle
 * io.InStream().readIntBe renamed to readIntBig
 * introduced io.InStream().readIntForeign
 * io.InStream().readInt has parameter order changed
 * io.InStream().readVarInt has parameter order changed
 * io.InStream().writeIntNe renamed to writeIntNative
 * introduced io.InStream().writeIntForeign
 * io.InStream().writeIntLe renamed to writeIntLittle
 * io.InStream().writeIntBe renamed to writeIntBig
 * io.InStream().writeInt has parameter order changed
 * mem.readInt has different parameters and semantics
 * introduced mem.readIntNative
 * introduced mem.readIntForeign
 * mem.readIntBE renamed to mem.readIntBig and different API
 * mem.readIntLE renamed to mem.readIntLittle and different API
 * introduced mem.readIntSliceNative
 * introduced mem.readIntSliceForeign
 * introduced mem.readIntSliceLittle
 * introduced mem.readIntSliceBig
 * introduced mem.readIntSlice
 * mem.writeInt has different parameters and semantics
 * introduced mem.writeIntNative
 * introduced mem.writeIntForeign
 * mem.writeIntBE renamed to mem.readIntBig and different semantics
 * mem.writeIntLE renamed to mem.readIntLittle and different semantics
 * introduced mem.writeIntSliceForeign
 * introduced mem.writeIntSliceNative
 * introduced mem.writeIntSliceBig
 * introduced mem.writeIntSliceLittle
 * introduced mem.writeIntSlice
 * removed mem.endianSwapIfLe
 * removed mem.endianSwapIfBe
 * removed mem.endianSwapIf
 * added mem.littleToNative
 * added mem.bigToNative
 * added mem.toNative
 * added mem.nativeTo
 * added mem.nativeToLittle
 * added mem.nativeToBig
2018-12-12 20:35:04 -05:00
Wink Saville 634d11ab28 Add add compiler_rt routines for float to signed integer conversion
And add std.math.f128_* constants.

The routines are:

  __fixdfdi, __fixdfsi, __fixdfti,
  __fixsfdi, __fixsfsi, __fixsfti,
  __fixtfdi, __fixtfsi, __fixtfti.

These all call fixint which is a generic zig function that does the
conversion:

  pub fn fixint(comptime fp_t: type, comptime fixint_t: type, a: fp_t) fixint_t

There are also a set tests:

  __fixdfdi_test, __fixdfsi_test, __fixdfti_test,
  __fixsfdi_test, __fixsfsi_test, __fixsfti_test,
  __fixtfdi_test, __fixtfsi_test, __fixtfti_test.
2018-12-12 00:21:42 -05:00
Jay Weisskopf 5f5364ad73 font-family fallbacks for unsupported system-ui 2018-12-11 01:44:48 -05:00
Jay Weisskopf 57113bab2f docs: Prefer system-ui font-family
system-ui is a new generic font-family for matching the font used in the operating system's native user interface. E.g. Roboto on Android, San Francisco on macOS, Segoe UI on Windows, etc.

https://caniuse.com/#search=system-ui
2018-12-11 01:44:48 -05:00
Henry Nelson 68b0fce62f Document explicitly ignoring expression values 2018-12-11 01:42:54 -05:00
Andrew Kelley 1b0f4d5976
implement compile error note for function parameter type mismatch 2018-12-05 15:32:25 -05:00
Jimmi Holst Christensen 518ff33e64 Allow packages in TestStep 2018-12-05 14:10:09 +01:00
Andrew Kelley 9ac838c8e3
LLD patch: allow non-allocated sections to go into allocated sections
Patch submitted upstream: https://reviews.llvm.org/D55276
2018-12-04 11:42:22 -05:00
Andrew Kelley 3a1612a0f5
std.debug: fix some issues with freestanding debug info 2018-12-02 23:46:45 -05:00
Andrew Kelley 5c3b8cb365
expose std.debug.DwarfInfo and delete unused function 2018-12-02 20:08:06 -05:00
Andrew Kelley a436d2ab8c
std.debug.printSourceAtAddressDwarf
which works in freestanding mode
2018-12-02 19:34:11 -05:00
Andrew Kelley 4292ed9571
std.debug.StackIterator 2018-12-02 18:54:04 -05:00
Andrew Kelley a40d160a5c
introduce std.io.SeekableStream
Relevant #764

dwarf debug info is modified to use this instead of std.os.File
directly to make it easier for bare metal projects to take advantage
of debug info parsing
2018-12-02 18:36:18 -05:00
Andrew Kelley 6f5e7ee09c
make std.unicode.Utf8Iterator public 2018-12-01 02:14:17 -05:00
Andrew Kelley a9eab69b58
zig build: addStaticExecutable 2018-12-01 01:21:59 -05:00
Suirad cf266ff80a Update tests 2018-11-30 02:15:33 -06:00