Commit Graph

122 Commits (26e08d57016352c469ae34b3fbd61e7f2a85a76c)

Author SHA1 Message Date
Raul Leal 62c817420d [#3844 + #3767] update std.c and std.os.linux to use null-terminated pointer types (#3900)
* #3844 update std.c functions to use null-terminated pointer types

* check linux functions

* fix callsites

* fix io test

* Add allocPrintCstr function to remove other cast
2019-12-17 15:43:49 -05:00
LemonBoy 19ddbd9e9e Make sure the address is aligned for intToPtr ops
Closes #773
2019-12-15 14:41:05 -05:00
Heppokoyuki 5ada11449a fix con_in difinition and add EFI_SIMPLE_TEXT_INPUT_PROTOCOL difinition 2019-12-10 13:25:28 -05:00
emekoi 29fd727b79
fixed windows dynamic library loading and added loading for darwin 2019-12-10 11:41:54 -05:00
Robin Voetter 4b4fbe3887
Replace @typeOf with @TypeOf in all zig source
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
2019-12-10 11:09:41 -05:00
Andrew Kelley 03396b3caa
update docs to new fmt API 2019-12-08 23:46:50 -05:00
Andrew Kelley 8b2622cdd5
std.fmt.format: tuple parameter instead of var args 2019-12-08 22:53:51 -05:00
Andrew Kelley 525b1e8fb4
Merge pull request #3856 from ziglang/builtin-call
introduce `@call` and remove other builtin calls
2019-12-06 15:49:47 -05:00
Andrew Kelley 343987cd05
remove `@inlineCall` from zig 2019-12-06 14:12:01 -05:00
Vexu bfb15f1c9f fix casts 2019-12-05 15:47:06 -05:00
Andrew Kelley b7be57766b
Merge pull request #3715 from daurnimator/towards-afd
Misc windows additions+fixes
2019-12-02 16:12:55 -05:00
Andrew Kelley ad214c7aa0
bring your own OS layer in the std lib
closes #3784
2019-12-02 15:02:17 -05:00
Andrew Kelley b36c07a95a
Merge remote-tracking branch 'origin/master' into remove-array-type-coercion 2019-12-01 09:56:01 -05:00
Andrew Kelley 951dc451d6
Merge pull request #3808 from LemonBoy/i386-for-ya
linux-i386 support
2019-11-30 22:00:00 -05:00
Andrew Kelley 413f9a5cfc
move `std.fs.Dir.cwd` to `std.fs.cwd`
update to non-deprecated std.fs APIs throughout the codebase

Related: #3811
2019-11-30 15:35:27 -05:00
LemonBoy e1e06e6766 linux-i386 support 2019-11-30 16:13:33 +01:00
Andrew Kelley d87b13f2f7
fix windows std lib regressions 2019-11-29 21:55:27 -05:00
Andrew Kelley bf3ac66150
remove type coercion from array values to references
* Implements #3768. This is a sweeping breaking change that requires
   many (trivial) edits to Zig source code. Array values no longer
   coerced to slices; however one may use `&` to obtain a reference to
   an array value, which may then be coerced to a slice.

 * Adds `IrInstruction::dump`, for debugging purposes. It's useful to
   call to inspect the instruction when debugging Zig IR.

 * Fixes bugs with result location semantics. See the new behavior test
   cases, and compile error test cases.

 * Fixes bugs with `@typeInfo` not properly resolving const values.

 * Behavior tests are passing but std lib tests are not yet. There
   is more work to do before merging this branch.
2019-11-27 03:37:50 -05:00
daurnimator 8a71f77c4a
std: lie about windows socklen_t signed-ness 2019-11-27 13:01:34 +11:00
daurnimator edc84e7ef7
std: add more winsock functions 2019-11-27 13:01:33 +11:00
daurnimator 19f26578c0
std: windows sockaddr constants come from ws2_32 2019-11-27 13:01:32 +11:00
daurnimator 8aa3d6019c
std: add windows.USHORT definition 2019-11-27 13:01:30 +11:00
daurnimator 254c79125b
std: fix WSAIoctl definition
zig automatically passes functions as pointers
2019-11-27 13:01:28 +11:00
daurnimator d99f0a2b8f
std: IO_STATUS_BLOCK's status member is an NTSTATUS; add union 2019-11-27 13:01:10 +11:00
daurnimator 1537d4701e
std: fix definition of NtDeviceIoControlFile 2019-11-27 13:01:09 +11:00
daurnimator a453c99ba9
std: add comments for some nt status codes 2019-11-27 13:01:08 +11:00
daurnimator 2c6788d7de
std: add windows.closesocket 2019-11-27 13:01:07 +11:00
daurnimator 6b5b0e6cd6
std: fix windows.GetOverlappedResult 2019-11-27 13:01:05 +11:00
daurnimator ce9966a39b
std: improved windows.DeviceIoControl 2019-11-27 13:01:04 +11:00
daurnimator b05a5a3e52
std: add CreateEvent for windows 2019-11-27 13:01:03 +11:00
daurnimator 78c0d33eb7
std: add WaitForMultipleObjects for windows 2019-11-27 13:01:02 +11:00
daurnimator 21ca54f560
std: add alertable argument for windows.WaitForSingleObject 2019-11-27 13:00:59 +11:00
Jonathan S 4014a8e4b4 Avoid deprecated cwd-based functions for opening directories, preferring to open explicitly relative to `Dir.cwd()`. 2019-11-25 23:46:48 -05:00
Jonathan S 51c5740879 Use a specific access mask in `Dir.openDirListW` instead of a generic one. Untested.
The actual desired access mask in this case seems quite confusing and badly documented. The previous combination of `GENERIC_READ` and `SYNCHRONIZE` seems both illegal and redundant according to the [`ntifs.h` documentation](https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntcreatefile), which specifies that `GENERIC_READ` should not be used for directories and includes `SYNCHRONIZE`. `winnt.h` contains a number of relevant-sounding flags such as `FILE_ADD_FILE`, `FILE_ADD_SUBDIRECTORY`, and `FILE_DELETE_CHILD` that do not show up in documentation at all. These are equal in value to file-specific flags that are documented as flags you should not specify when opening a directory.
2019-11-25 23:46:47 -05:00
Andrew Kelley 4261fa3c49
move logic to the appropriate layers; add new compile error 2019-11-25 18:46:17 -05:00
Andrew Kelley 659c1bdeee
Merge branch 'wasi-run-tests' of https://github.com/fengb/zig into fengb-wasi-run-tests 2019-11-25 17:53:26 -05:00
Andrew Kelley cb38bd0a14
rename std.heap.direct_allocator to std.heap.page_allocator
std.heap.direct_allocator is still available for now but it is marked
deprecated.
2019-11-25 17:25:06 -05:00
Andrew Kelley bdf3680be1
zig fmt 2019-11-25 13:53:13 -05:00
Andrew Kelley 5a98dd42b3
Merge pull request #3728 from ziglang/null-terminated-pointers
sentinel-terminated pointers
2019-11-25 02:20:08 -05:00
daurnimator 69b780647a std: update for linux 5.4 2019-11-25 02:07:23 -05:00
Andrew Kelley d2cb740dd9 add missing null terminator in windows file path helper function 2019-11-25 01:10:30 -05:00
Andrew Kelley 29e438fd1f
more sentinel-terminated pointers std lib integration
See #3767
2019-11-25 00:43:36 -05:00
Andrew Kelley 15d415e10b
make std.mem.toSlice use null terminated pointers
and fix the fallout
2019-11-24 21:21:05 -05:00
Andrew Kelley 47f06be369
string literals are now null terminated
this also deletes C string literals from the language, and then makes
the std lib changes and compiler changes necessary to get the behavior
tests and std lib tests passing again.
2019-11-21 20:43:41 -05:00
Andrew Kelley cd5f4de2a6
std: remove O_LARGEFILE from OS bits when the OS does not define it 2019-11-21 20:34:55 -05:00
Benjamin Feng 0f0d01a037 Replace magic numbers with named constants 2019-11-21 18:41:02 -06:00
Andrew Kelley bf1cbebea1 improve std.fs.selfExePath and related functions on Windows 2019-11-21 18:51:12 -05:00
Andrew Kelley cd37c1a377
add std.fs.Dir.openRead
This is progress towards file system APIs that encourage avoiding
Time Of Check, Time Of Use bugs.
2019-11-21 17:07:29 -05:00
Benjamin Feng b88bb93af3 WASI isatty 2019-11-19 20:17:00 -06:00
Benjamin Feng 14e9c7d1f2 WASI clock functions 2019-11-19 19:44:19 -06:00