Commit Graph

3439 Commits

Author SHA1 Message Date
LemonBoy
ac004e1bf1 stage1: Allow nameless test blocks
Nameless blocks are never filtered, the test prefix is still applied.
2021-01-22 15:46:58 +01:00
Andrew Kelley
0353c9601a
Merge pull request #7814 from LemonBoy/fix-7760
std: Fixed pipe2 fallback
2021-01-18 11:49:42 -08:00
Julian Maingot
384ccaa27a stage2: use %type not @type for libc stubs
Missed a couple places last time so just doing the rest.
2021-01-18 11:04:33 -08:00
Julian Maingot
4c5f69a065 update error return doc
Docs were out of sync with code
2021-01-18 11:04:33 -08:00
LemonBoy
6418f9ae91 std: Add missing cast when calling fcntl w/ constant args
comptime_int arguments are a big no no.
2021-01-18 18:02:09 +01:00
LemonBoy
f33bac2b12 std: define pipe2 only for os that support it 2021-01-18 17:24:26 +01:00
LemonBoy
9d18df142c std: Fixed pipe2 fallback
Use both F_SETFD and F_SETFL depending on what flag we're setting.

Closes #7760
2021-01-18 14:52:35 +01:00
Andrew Kelley
8436134499 std.ArrayHashMap: add "AssertDiscard" function variants
* Add `swapRemoveAssertDiscard`
 * Add `orderedRemoveAssertDiscard`
 * Deprecate `removeAssertDiscard`
2021-01-16 22:49:20 -07:00
Andrew Kelley
1f65828ec6
Merge pull request #7716 from koachan/sparc64-libs
stage1: SPARCv9 f128 enablement
2021-01-16 12:10:03 -08:00
Guillaume Ballet
f7d7cb6268 crypto: add legacy keccak hash functions 2021-01-15 12:36:38 -08:00
Koakuma
1d67ab8823 Fix _Qp_cmp definition 2021-01-15 19:07:39 +07:00
Koakuma
bbb58b10f6 Add compiler-rt stub for SPARC CPUs 2021-01-15 19:07:38 +07:00
Andrew Kelley
19f893c6bb std.Thread: avoid compile errors for single-threaded OS's 2021-01-14 22:42:29 -07:00
Andrew Kelley
ad301d687a fix namespace of kernel32 function calls 2021-01-14 21:42:49 -07:00
Andrew Kelley
9e1aeda3bf std.Thread.StaticResetEvent: call spinLoopHint appropriately 2021-01-14 21:34:30 -07:00
Andrew Kelley
9698ea3173 std.Thread.Mutex: restore the "Held" API
so that std.Thread.Mutex.Dummy can be used as a drop in replacement.
2021-01-14 21:28:22 -07:00
Andrew Kelley
a9667b5a85 organize std lib concurrency primitives and add RwLock
* move concurrency primitives that always operate on kernel threads to
   the std.Thread namespace
 * remove std.SpinLock. Nobody should use this in a non-freestanding
   environment; the other primitives are always preferable. In
   freestanding, it will be necessary to put custom spin logic in there,
   so there are no use cases for a std lib version.
 * move some std lib files to the top level fields convention
 * add std.Thread.spinLoopHint
 * add std.Thread.Condition
 * add std.Thread.Semaphore
 * new implementation of std.Thread.Mutex for Windows and non-pthreads Linux
 * add std.Thread.RwLock

Implementations provided by @kprotty
2021-01-14 20:41:37 -07:00
Asherah Connor
2b0e3ee228
std.os.uefi.protocols.FileProtocol: fix and expose get_position, set_position (#7762) 2021-01-13 21:46:22 -05:00
Jay Petacat
a021c7b1b2 Move fmt.testFmt to testing.expectFmt 2021-01-12 18:13:29 -08:00
Bill Nagel
2c79d669a7 add missing ECONNRESET from getsockoptError 2021-01-12 18:11:58 -08:00
Andrew Kelley
70c608add8
Merge pull request #7577 from semarie/emutls
implement emutls inside compiler_rt.zig
2021-01-12 17:54:02 -08:00
Andrew Kelley
e564d2ca3c
Merge pull request #7714 from mikdusan/target-macos
macos: reimplement OS version detection
2021-01-12 16:45:50 -08:00
Bill Nagel
1e2be14b6b define nfds_t for windows 2021-01-12 16:37:58 -08:00
Sébastien Marie
d7aa7dbab2 implement emutls in compiler_rt 2021-01-12 05:39:46 +00:00
Sébastien Marie
ebf2a7e9b9 add pthread_key functions 2021-01-12 05:39:46 +00:00
Andrew Kelley
8ea2b40e5f std.event.Loop: fix race condition when starting the time wheel
closes #7572
2021-01-11 22:23:03 -07:00
Andrew Kelley
5b2a79848c stage2: cleanups regarding red zone CLI flags
* CLI: change to -mred-zone and -mno-red-zone to match gcc/clang.
 * build.zig: remove the double negative and make it an optional bool.
   This follows precedent from other flags, allowing the compiler CLI to
   be the decider of what is default instead of duplicating the default
   value into the build system code.
 * Compilation: make it an optional `want_red_zone` instead of a
   `no_red_zone` bool. The default is decided by a call to
   `target_util.hasRedZone`.
 * When creating a Clang command line, put -mred-zone on the command
   line if we are forcing it to be enabled.
 * Update update_clang_options.zig with respect to the recent {s}/{} format changes.
 * `zig cc` integration with red zone preference.
2021-01-11 22:07:21 -07:00
Lee Cannon
8932c2d745 Added support for no red zone 2021-01-11 22:07:14 -07:00
Michael Dusan
4c3de99253
more fixups
- clarify comments
- `NativeTargetInfo.detect()` propagate macOS errors
- `macos.detect()` drop `std.log` usage
2021-01-11 20:58:31 -05:00
Michael Dusan
f2be1fb23e
macos: reimplement OS version detection
The macOS version is now obtained by parsing `SystemVersion.plist`.

Test cases added for plist files that date back to '2005 Panther and up
to the recent '2020 Big Sur 11.1 release of macOS.

Thus we are now able to reliably identify 10.3...11.1 and higher.

- drop use of kern.osproductversion sysctl
- drop use of kern.osversion sysctl (fallback)
- drop kern.osversion tests
- add `lib.std.zig.system.detect()`
- add minimalistic parser for `SystemVersion.plist`
- add test cases for { 10.3, 10.3.9, 10.15.6, 11.0, 11.1 }

closes #7569
2021-01-11 19:54:56 -05:00
Rohlem
c96272f618 std.os.windows.GetFinalPathNameByHandle: remove intermediate buffers
... and mem.copy operations. Requires slightly larger input buffers than result length. Add helper functions std.mem.alignInBytes and std.mem.alignInSlice.
2021-01-11 17:48:19 -07:00
Rohlem
f301a8467c std.os.windows.GetFinalPathNameByHandle: remove QueryInformationFile code path 2021-01-11 17:48:18 -07:00
Rohlem
cb20503990 std.os.windows.GetFinalPathNameByHandle: address non-structural review comments 2021-01-11 17:48:18 -07:00
Rohlem
64c5f4979e std.os.windows.GetFinalPathNameByHandle: replace kernel32 by ntdll call
Removes the call to kernel32.GetFinalPathNameByHandleW in favor of NtQueryObject, which means we can reuse the other codepath's logic for DOS naming.
2021-01-11 17:48:18 -07:00
Rohlem
964bbcd0b1 introduce std.os.windows.QueryObjectName 2021-01-11 17:48:18 -07:00
Rohlem
09dc651476 std.os.windows.GetFinalPathNameByHandle: add test 2021-01-11 17:48:18 -07:00
Rohlem
450e467201 std.os.windows.GetFinalPathNameByHandle: reintroduce kernel32 for compatibility
The NtQueryInformationFile with .FileNormalizedNameInformation is only available in Windows 10 1803 (rs4) and later, however there is probably still another route we can go via ntdll.
2021-01-11 17:48:18 -07:00
Rohlem
4b280ac7e9 add std.zig.system.windows version check utility functions 2021-01-11 17:48:17 -07:00
Rohlem
2922a48309 move windows runtime version detection into std.zig.system.windows 2021-01-11 17:48:16 -07:00
Jonathan Knezek
fc10c9c4ce
Add std.fmt.formatDuration and std.fmt.duration (#7297)
`formatDuration` works on a writer, and `duration` wraps a u64 to allow pleasant injection into format strings.
2021-01-11 19:15:56 -05:00
Andrew Kelley
4f5fa90d6d
Merge pull request #7195 from Aransentin/master
A win32-api proposal, implemented for user32.zig
2021-01-11 16:02:40 -08:00
Andrew Kelley
d68adc5382 std.EarlyEOFReader: rename to LimitedReader 2021-01-11 16:51:56 -07:00
daurnimator
01d1a8a783 std: use fifo.pump in writeFileAllUnseekable 2021-01-11 16:48:56 -07:00
daurnimator
e873668d38 std: add LimitedReader: reader that returns EOF early 2021-01-11 16:48:30 -07:00
daurnimator
8695b9fbe7 std: use reader.skipBytes to avoid infinite loop in writeFileAllUnseekable
skipBytes correctly handles EOF for us
2021-01-11 16:47:48 -07:00
daurnimator
0ab8ae944c std: reader.skipBytes's num_bytes should be a u64 2021-01-11 16:47:48 -07:00
Vincent Rischmann
3468872d83 os/bits/linux: add the termios cc bits 2021-01-11 15:39:36 -08:00
Andrew Kelley
ec9158305d
Merge pull request #7124 from LemonBoy/netstuff1
std: Decouple network streams from fs.File
2021-01-11 15:35:00 -08:00
Andrew Kelley
0c8e2c987d std CityHash: disable memory-expensive tests for now 2021-01-11 13:58:06 -07:00
Martin Wickham
21213127ec Modify cityhash to work at comptime 2021-01-11 13:52:52 -07:00