Andrew Kelley
598e80957e
windows: call CancelIo when canceling an fs watch
2018-08-10 13:19:07 -04:00
Andrew Kelley
23af36c54f
windows fs watching: fix not initializing table value
2018-08-09 21:48:25 -04:00
Andrew Kelley
26a842c264
windows: only create io completion port once
2018-08-09 20:12:46 -04:00
Andrew Kelley
b219feb3f1
initial windows implementation of std.event.fs.Watch
2018-08-09 16:48:44 -04:00
Andrew Kelley
c63ec9886a
std.event.fs.preadv windows implementation
2018-08-08 16:55:19 -04:00
Andrew Kelley
8b456927be
std.event.fs.pwritev windows implementation
...
also fix 2 bugs where the function didn't call allocator.shrink:
* std.mem.join
* std.os.path.resolve
2018-08-08 15:06:32 -04:00
Andrew Kelley
d2dd29e80c
separate os.Thread.Id and os.Thread.Handle because of windows
2018-08-06 17:25:24 -04:00
Matthew D. Steele
86d1cc8e2f
Add thread ID support to std.os.Thread ( fixes #1316 )
2018-08-03 21:36:04 -04:00
Andrew Kelley
729f2aceb0
fix API of RtlGenRandom
2018-08-02 13:34:31 -04:00
kristopher tate
782043e2e6
std/os/windows/util.zig: SKIP instead of PASS on non-windows systems;
...
Tracking Issue #1318 ;
2018-08-03 02:16:49 +09:00
kristopher tate
22fd359e2c
std/os/windows/advapi32.zig: add SystemFunction036;
...
Tracking Issue #1318 ;
2018-08-03 02:14:06 +09:00
Sahnvour
2ec9a11646
Very much WIP base implementation for #721 .
...
Currently does:
- read COFF executable file
- locate and load corresponding .pdb file
- expose .pdb content as streams (PDB format)
2018-07-21 20:30:11 +02:00
Andrew Kelley
58c5f94a99
self-hosted: share C++ code for finding libc on windows
2018-07-20 23:38:13 -04:00
Andrew Kelley
3bb00eac37
self-hosted: implement getAppDataDir for windows
2018-07-17 00:01:36 -04:00
Andrew Kelley
ac096c2949
zig fmt
2018-07-12 19:24:32 -04:00
Andrew Kelley
9462852433
std.event.Loop multithreading for windows using IOCP
2018-07-09 16:49:46 -04:00
Andrew Kelley
caa0085057
implement std.os.cpuCount for windows
2018-07-09 13:19:11 -04:00
Andrew Kelley
1aafbae5be
remove []u8 casting syntax. add @bytesToSlice
and @sliceToBytes
...
See #1061
2018-06-18 17:25:29 -04:00
Andrew Kelley
7912061226
remove integer and float casting syntax
...
* add `@intCast`
* add `@floatCast`
* add `@floatToInt`
* add `@intToFloat`
See #1061
2018-06-17 02:57:07 -04:00
Andrew Kelley
7580e39b38
zig fmt
2018-06-12 02:18:11 -04:00
Andrew Kelley
3dd9af9948
implement std.os.Dir for windows
...
improve std.os.File.access so that it does not depend on shlwapi.dll
closes #1084
2018-06-12 01:57:09 -04:00
Andrew Kelley
77678b2cbc
breaking syntax change: orelse keyword instead of ?? ( #1096 )
...
use the `zig-fmt-optional-default` branch to have zig fmt
automatically do the changes.
closes #1023
2018-06-10 01:13:51 -04:00
Andrew Kelley
b11c5d8f82
fix std.os.windows.PathFileExists specified in the wrong DLL ( #1066 )
...
closes #1054
2018-06-06 15:36:47 -04:00
Andrew Kelley
652f4bdf62
disallow unknown-length pointer to opaque
...
This also means that translate-c has to detect when a pointer to
opaque is happening, and use `*` instead of `[*]`.
See #1059
2018-06-05 18:03:21 -04:00
Andrew Kelley
96164ce613
disallow single-item pointer indexing
...
add pointer arithmetic for unknown length pointer
2018-06-04 01:39:57 -04:00
Andrew Kelley
fcbb7426fa
use * for pointer type instead of &
...
See #770
To help automatically translate code, see the
zig-fmt-pointer-reform-2 branch.
This will convert all & into *. Due to the syntax
ambiguity (which is why we are making this change),
even address-of & will turn into *, so you'll have
to manually fix thes instances. You will be guaranteed
to get compile errors for them - expected 'type', found 'foo'
2018-05-31 17:28:07 -04:00
Andrew Kelley
ea58f4a5a9
run zig fmt on the codebase
2018-05-30 16:09:11 -04:00
Andrew Kelley
0c16cd2d0e
run zig fmt on the codebase
...
See #1003
2018-05-29 04:23:38 -04:00
Andrew Kelley
6376d96824
support kernel threads for windows
...
* remove std.os.spawnThreadAllocator - windows does not support
an explicit stack, so using an allocator for a thread stack
space does not work.
* std.os.spawnThread - instead of accepting a stack argument, the
implementation will directly allocate using OS-specific APIs.
2018-04-29 02:40:22 -04:00
Andrew Kelley
da2af9c613
fixups
2018-04-22 13:36:26 -04:00
Andrew Kelley
0dcadc61b4
Merge branch 'std.os.time' of https://github.com/tgschultz/zig into tgschultz-std.os.time
2018-04-22 13:24:25 -04:00
tgschultz
8b66dd8c7d
Added unstaged changes.
2018-04-18 13:55:42 -05:00
Marc Tiehuis
03bec631bd
Replace File.exists with File.access
2018-04-13 21:27:09 +12:00
Andrew Kelley
445b03384a
introduce std.heap.ArenaAllocator and std.heap.DirectAllocator
...
* DirectAllocator does the underlying syscall for every allocation.
* ArenaAllocator takes another allocator as an argument and
allocates bytes up front, falling back to DirectAllocator with
increasingly large allocation sizes, to avoid calling it too often.
Then the entire arena can be freed at once.
The self hosted parser is updated to take advantage of ArenaAllocator
for the AST that it returns. This significantly reduces the complexity
of cleanup code.
docgen and build runner are updated to use the combination of
ArenaAllocator and DirectAllocator instead of IncrementingAllocator,
which is now deprecated in favor of FixedBufferAllocator combined
with DirectAllocator.
The C allocator calls aligned_alloc instead of malloc, in order to
respect the alignment parameter.
Added asserts in Allocator to ensure that implementors of the
interface return slices of the correct size.
Fixed a bug in Allocator when you call realloc to grow the allocation.
2018-02-12 02:14:44 -05:00
Andrew Kelley
a2bd9f8912
std lib: modify allocator idiom
...
Before we accepted a nullable allocator for some stuff like
opening files. Now we require an allocator.
Use the mem.FixedBufferAllocator pattern if a bound on the amount
to allocate is known.
This also establishes the pattern that usually an allocator is the
first argument to a function (possibly after "self").
fix docs for std.cstr.addNullByte
self hosted compiler:
* only build docs when explicitly asked to
* clean up main
* stub out zig fmt
2018-02-09 18:27:50 -05:00
Andrew Kelley
32c988a2d7
fix build runner on windows
2018-02-09 00:24:23 -05:00
Andrew Kelley
0d5ff6f462
error sets - most tests passing
2018-02-08 02:08:45 -05:00
Andrew Kelley
31abef172a
fix accidentally linking against kernel32 on non windows
2018-02-04 22:13:21 -05:00
Andrew Kelley
b8f59e14cd
*WIP* error sets - correctly resolve inferred error sets
2018-02-02 18:13:32 -05:00
Andrew Kelley
5f518dbeb9
*WIP* error sets converting std lib
2018-01-31 22:48:40 -05:00
Andrew Kelley
3671582c15
syntax: functions require return type. remove ->
...
The purpose of this is:
* Only one way to do things
* Changing a function with void return type to return a possible
error becomes a 1 character change, subtly encouraging
people to use errors.
See #632
Here are some imperfect sed commands for performing this update:
remove arrow:
```
sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig")
```
add void:
```
sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig")
```
Some cleanup may be necessary, but this should do the bulk of the work.
2018-01-25 04:10:11 -05:00
Andrew Kelley
b3a6faf13e
replace %defer with errdefer
...
See #632
now we have 1 less sigil
2018-01-23 23:08:09 -05:00
Jimmi Holst Christensen
a76023bcd8
Removed PLARGE_INTEGER
2018-01-19 21:49:16 +01:00
Jimmi Holst Christensen
90714a3831
Implemented windows versions of seekTo and getPos
2018-01-19 21:30:57 +01:00
Andrew Kelley
632d143bff
replace a %% b
with a catch b
...
See #632
better fits the convention of using keywords for control flow
2018-01-07 17:28:20 -05:00
Andrew Kelley
66717db735
replace %return
with try
...
See #632
better fits the convention of using keywords for control flow
2018-01-07 16:53:13 -05:00
Andrew Kelley
e1c03d9e8e
self-hosted compiler works on windows
...
* better error message for realpath failing
* fix bug in std.io.readFileAllocExtra incorrectly returning
error.EndOfStream
* implement std.os.selfExePath and std.os.selfExeDirPath for windows
2018-01-04 13:48:45 -05:00
Andrew Kelley
ea805c5fe7
fix darwin and windows from previous commit
2017-12-22 02:33:39 -05:00
Andrew Kelley
d917815d81
explicitly return from blocks
...
instead of last statement being expression value
closes #629
2017-12-22 00:50:30 -05:00
dimenus
a7d07d412c
Added DLL loading capability in windows to the std lib.
2017-11-16 21:49:05 -06:00
Andrew Kelley
20c2dbdbd3
add windows implementation of io.File.getEndPos
2017-11-10 14:36:03 -05:00
Andrew Kelley
fcef7c4bb2
fix std.io.InStream for windows
...
now we handle PIPE_BROKEN as an EOF
also set up framework for debugging unexpected posix/windows errors
2017-10-15 16:45:43 -04:00
Andrew Kelley
bb169a7b36
fix child process stdio piping behavior on windows
2017-10-15 16:03:32 -04:00
Andrew Kelley
a98373f144
use correct integer type for windows BOOL
2017-10-15 14:01:55 -04:00
Andrew Kelley
8ab5313043
implement environment variables for windows
2017-10-15 01:23:10 -04:00
Andrew Kelley
531f3344dc
implement std.os.rename for windows
2017-10-14 17:56:18 -04:00
Andrew Kelley
61d715d784
implement std.os.symLink for windows
2017-10-14 17:39:44 -04:00
Andrew Kelley
ad6eec9480
fix regressions from previous commit on windows
2017-10-14 17:10:53 -04:00
Andrew Kelley
0307dc0b77
organize windows utility functions
2017-10-14 16:59:43 -04:00
Andrew Kelley
0bc80411f6
implement os.makeDir for windows
2017-10-14 15:32:29 -04:00
Andrew Kelley
8d3eaab871
implement std.os.ChildProcess for windows
2017-10-14 15:32:18 -04:00
Andrew Kelley
7f9dc4ebc1
fix std.os.getRandomBytes for windows
2017-10-11 23:14:48 -04:00
Andrew Kelley
b61a6ec8a6
implement command line argument parsing for windows
...
See #302
2017-10-11 22:50:16 -04:00
Andrew Kelley
e6334fe46d
implement std.io.InStream for windows
...
See #302
2017-10-09 15:59:10 -04:00
Andrew Kelley
c4262da8de
implement os.path.real for windows and update allocator interface
2017-10-09 14:21:35 -04:00
Andrew Kelley
a4310cf8b4
implement std.os.deleteFile for windows
2017-10-08 23:06:56 -04:00
Andrew Kelley
9d5f15fe3d
implement os.getCwd for windows
2017-10-08 21:44:24 -04:00
Andrew Kelley
fd5a5db400
implement IncrementingAllocator for Windows
2017-09-27 22:59:58 -04:00
Andrew Kelley
8f0dfcbcfb
Revert "windows API functions are not stdcalls"
...
This reverts commit 59410a2f13
.
yes they are
2017-09-24 04:18:13 -04:00
Andrew Kelley
59410a2f13
windows API functions are not stdcalls
2017-09-24 04:09:13 -04:00
Andrew Kelley
ba41be67f0
windows gui hello world
2017-09-24 03:55:45 -04:00
Andrew Kelley
751ab72a82
std: fix os.sleep on darwin and windows
2017-09-19 09:46:41 -04:00
Jonathan Marler
3f8b26c06a
Allow INVALID_HANDLE_VALUE for windows to work on 32-bit and 64-bit. ( #457 )
2017-09-10 11:16:27 -04:00
Andrew Kelley
57fb8efde2
add missing stdcallcc to ExitProcess decl
2017-08-06 16:13:52 -04:00
Andrew Kelley
6a93dda3e1
progress toward windows hello world working
2017-06-14 00:04:34 -04:00
Andrew Kelley
199bbb6292
progress toward hello world without libc in windows
2017-06-04 10:08:55 -04:00