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
Benjamin Feng
c3d93cd9f2
WASI time_t / timespec
2019-11-19 16:12:26 -06:00
daurnimator
431eeb5e20
std: add pieces for WSAIoctl on windows
2019-11-15 10:31:52 +11:00
daurnimator
3b8afe31a0
std: add NtDeviceIoControlFile definition for windows
2019-11-15 10:31:51 +11:00
daurnimator
6469900e79
std: add WSAStartup and WSACleanup for windows
2019-11-15 10:31:47 +11:00
daurnimator
4cf535a01b
std: add WSASocketW for windows
2019-11-14 17:09:22 +11:00
daurnimator
d9d3268cc1
std: add DeviceIoControl and GetOverlappedResult for windows
2019-11-14 17:09:21 +11:00
daurnimator
f4c6cc3270
std: add winsock some definitions
2019-11-14 17:09:19 +11:00
daurnimator
a832b35c19
std: add windows socket constants
...
Taken from https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw
2019-11-14 17:09:17 +11:00
daurnimator
be86e41d97
std: add CTL_CODE function for windows
2019-11-14 17:09:16 +11:00
daurnimator
4830415071
std: add FILE_ANY_ constants for windows
2019-11-14 17:00:09 +11:00