aboutsummaryrefslogtreecommitdiff
path: root/std
AgeCommit message (Collapse)Author
2019-03-31Add __aeabi_mem{cmp,clr,set,cpy,move} to compiler-rtvegecode
2019-03-31Add memcmp to builtinsvegecode
2019-03-31Veritcally align array literal columnshryx
2019-03-30Merge pull request #2112 from shritesh/param_decl_doc_commentsAndrew Kelley
Add doc_comments to param decl
2019-03-30fmt: Fix param decl testShritesh Bhattarai
2019-03-30Add doc_comments to param declShritesh Bhattarai
2019-03-29fix std.ascii type error and inverted logicRohlem
previously: ``` ...\lib\zig\std\ascii.zig:203:20: error: unable to perform binary not operation on type 'comptime_int' return c | ~0b00100000; ^ ```
2019-03-29add std.ascii to std.std test "std"Rohlem
2019-03-29fix tests for math.mulWideShawn Landden
2019-03-28std.mulWide() whose return is twice as wideShawn Landden
2019-03-27fix build on arm64Shawn Landden
2019-03-26Use linux.exit_group if not single threadedShritesh Bhattarai
2019-03-26fmt: check for extra newline at end of fileShritesh Bhattarai
`anything_changed` checks if `source_index` == `source.len` Fixes #2074
2019-03-26std.ascii: respond to reviewShawn Landden
This won't generate as much mode in debug mode, as it doesn't check for overflow.
2019-03-25munmap allows address 0Andrew Kelley
fixes test suite regression on macOS from previous commit
2019-03-25implement allowzero pointer attributeAndrew Kelley
closes #1953 only needed for freestanding targets. also adds safety for `@intToPtr` when the address is zero.
2019-03-24introduce the enum literal typeAndrew Kelley
see #683
2019-03-23add compile error for ignoring errorAndrew Kelley
closes #772
2019-03-23character literals: allow unicode escapesAndrew Kelley
also make the documentation for character literals more clear. closes #2089 see #2097
2019-03-22add mulXf3 to compiler-rtAndrew Kelley
this adds the following functions to compiler-rt: * `__mulsf3` * `__muldf3` * `__multf3` See #1290
2019-03-22std: add ascii with C ASCII character classesShawn Landden
Does NOT look at the locale the way the C functions do. int isalnum(int c); int isalpha(int c); int iscntrl(int c); int isdigit(int c); int isgraph(int c); int islower(int c); int isprint(int c); int ispunct(int c); int isspace(int c); int isupper(int c); int isxdigit(int c); int isascii(int c); int isblank(int c); int toupper(int c); int tolower(int c); Tested to match glibc (when using C locale) with this program: const c = @cImport({ // See https://github.com/ziglang/zig/issues/515 @cDefine("_NO_CRT_STDIO_INLINE", "1"); @cInclude("stdio.h"); @cInclude("string.h"); @cInclude("ctype.h"); }); const std = @import("std"); const ascii = std.ascii; const abort = std.os.abort; export fn main(argc: c_int, argv: **u8) c_int { var i: u8 = undefined; i = 0; while (true) { if (ascii.isAlNum(i) != (c.isalnum(i) > 0)) { abort(); } if (ascii.isAlpha(i) != (c.isalpha(i) > 0)) { abort(); } if (ascii.isCtrl(i) != (c.iscntrl(i) > 0)) { abort(); } if (ascii.isDigit(i) != (c.isdigit(i) > 0)) { abort(); } if (ascii.isGraph(i) != (c.isgraph(i) > 0)) { abort(); } if (ascii.isLower(i) != (c.islower(i) > 0)) { abort(); } if (ascii.isPrint(i) != (c.isprint(i) > 0)) { abort(); } if (ascii.isPunct(i) != (c.ispunct(i) > 0)) { abort(); } if (ascii.isSpace(i) != (c.isspace(i) > 0)) { abort(); } if (ascii.isUpper(i) != (c.isupper(i) > 0)) { abort(); } if (ascii.isXDigit(i) != (c.isxdigit(i) > 0)) { abort(); } if (i == 255) { break; } i += 1; } _ = c.printf(c"Success!\n"); return 0; }
2019-03-20Merge remote-tracking branch 'origin/llvm8'Andrew Kelley
2019-03-20Merge pull request #2079 from Sahnvour/issue-2050Andrew Kelley
Fixes c_ABI tests on windows
2019-03-19build.zig: allow run() on non-native target artifactsAndrew Kelley
2019-03-19better buffer length for formatIntUnsignedAndrew Kelley
see #1358
2019-03-18Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
2019-03-18libc: separate linux headers from musl/glibcAndrew Kelley
2019-03-16print a message instead of returning an error when debug info comes from a ↵Sahnvour
source file not found (for example compiled on another computer)
2019-03-16avoid reading LineBlockFragmentHeader at all if the address is not in range, ↵Sahnvour
thus simplifying code and improving speed of execution
2019-03-16allow pdb modules to have no C13 data, this happens if the module is strippedSahnvour
2019-03-16correct padding handling between std.pdb.ModInfo entries in DbiStreamSahnvour
2019-03-15fix regressions on Windows from previous commitAndrew Kelley
2019-03-15breaking changes to std.mem.Allocator interface APIAndrew Kelley
Before, allocator implementations had to provide `allocFn`, `reallocFn`, and `freeFn`. Now, they must provide only `reallocFn` and `shrinkFn`. Reallocating from a zero length slice is allocation, and shrinking to a zero length slice is freeing. When the new memory size is less than or equal to the previous allocation size, `reallocFn` now has the option to return `error.OutOfMemory` to indicate that the allocator would not be able to take advantage of the new size. For more details see #1306. This commit closes #1306. This commit paves the way to solving #2009. This commit also introduces a memory leak to all coroutines. There is an issue where a coroutine calls the function and it frees its own stack frame, but then the return value of `shrinkFn` is a slice, which is implemented as an sret struct. Writing to the return pointer causes invalid memory write. We could work around it by having a global helper function which has a void return type and calling that instead. But instead this hack will suffice until I rework coroutines to be non-allocating. Basically coroutines are not supported right now until they are reworked as in #1194.
2019-03-14Add /lib/x86_64-linux-gnu or similar to default system library search pathsAkuli
this makes compiling with libraries like zlib and ncurses easier
2019-03-14breaking: fix @typeInfo handling of global error set typeAndrew Kelley
`builtin.TypeInfo.ErrorSet` is now `?[]Error` instead of `struct{errors:[]Error}`. closes #1936
2019-03-13fix target_requires_pic and reloc_modeAndrew Kelley
disable failing thread local variable test. see #2063
2019-03-13breaking: remove --static; add -dynamicAndrew Kelley
`--static` is no longer an option. Instead, Zig makes things as static as possible by default. `-dynamic` can be used to choose a dynamic library rather than a static one. `--enable-pic` is a new option. Usually it will be enabled automatically, but in the case of build-exe with no dynamic libraries on Linux or freestanding, Zig chooses off by default. closes #1703 closes #1828
2019-03-13this empty import workaround no longer necessaryAndrew Kelley
2019-03-13Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
2019-03-11zig build: do a better job of detecting system pathsAndrew Kelley
See #2041
2019-03-11remove the valgrind integration with std.mem.AllocatorAndrew Kelley
See #1837
2019-03-11Merge branch 'valgrind' of https://github.com/daurnimator/zig into ↵Andrew Kelley
daurnimator-valgrind
2019-03-11add test for spawning child process with empty environmentAndrew Kelley
thanks to BenoitJGirard for pointing out the child process implementation needs 3 extra null bytes in #2031
2019-03-10Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
2019-03-10std.zig: `this` is no longer a keywordAndrew Kelley
2019-03-10Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
2019-03-09Merge pull request #2038 from ziglang/cachingAndrew Kelley
breaking changes to zig build API and improved caching
2019-03-09disable flaky event test until post coroutine rewriteAndrew Kelley
2019-03-09fix running things with zig build on WindowsAndrew Kelley
Windows doesn't have rpaths for DLLs so we instead add search paths to Path environment variable when running an executable that depends on DLLs built with zig build.
2019-03-08breaking changes to zig build API and improved cachingAndrew Kelley
* in Zig build scripts, getOutputPath() is no longer a valid function to call, unless setOutputDir() was used, or within a custom make() function. Instead there is more convenient API to use which takes advantage of the caching system. Search this commit diff for `exe.run()` for an example. * Zig build by default enables caching. All build artifacts will go into zig-cache. If you want to access build artifacts in a convenient location, it is recommended to add an `install` step. Otherwise you can use the `run()` API mentioned above to execute programs directly from their location in the cache. Closes #330. `addSystemCommand` is available for programs not built with Zig build. * Please note that Zig does no cache evicting yet. You may have to manually delete zig-cache directories periodically to keep disk usage down. It's planned for this to be a simple Least Recently Used eviction system eventually. * `--output`, `--output-lib`, and `--output-h` are removed. Instead, use `--output-dir` which defaults to the current working directory. Or take advantage of `--cache on`, which will print the main output path to stdout, and the other artifacts will be in the same directory with predictable file names. `--disable-gen-h` is available when one wants to prevent .h file generation. * `@cImport` is always independently cached now. Closes #2015. It always writes the generated Zig code to disk which makes debug info and compile errors better. No more "TODO: remember C source location to display here" * Fix .d file parsing. (Fixes the MacOS CI failure) * Zig no longer creates "temporary files" other than inside a zig-cache directory. This breaks the CLI API that Godbolt uses. The suggested new invocation can be found in this commit diff, in the changes to `test/cli.zig`.