Alex Martini
deb56e1ad2
Keep doc comments immediately before declarations.
...
If there's anything between them, DocC doesn't recognize that the doc
comment belongs to the declaration that comes after the interruption,
resulting in that declaration being undocumented.
2023-01-31 12:07:17 -08:00
Karoy Lorentey
a2bf0d5708
Merge pull request #118 from apple/maxd/fix-5.7-errors
2023-01-10 09:40:44 -08:00
Max Desiatov
b5e330163a
MachPortTests: fix build issues with Swift 5.7
2023-01-05 14:35:22 +00:00
Max Desiatov
3f66dfbaf8
MachPort: fix build issues with Swift 5.7
...
It seems that `#if $MoveOnly` check has no effect on Swift 5.7, so we should check whether Swift 5.8 or later are available first.
Resolves #117 .
2023-01-05 10:58:04 +00:00
Karoy Lorentey
ccea4eed1a
Merge pull request #116 from loffgren/machports
...
Add Mach.Port
2022-12-22 18:15:38 -08:00
Daniel Loffgren
700b8f867e
Use two space indentation
2022-12-22 18:01:40 -08:00
loffgren and Karoy Lorentey
d129f62ce9
Use Markdown code voice for initializer comment
...
Co-authored-by: Karoy Lorentey <klorentey@apple.com >
2022-12-22 17:12:26 -08:00
loffgren and Michael Ilseman
ae6b1f24a9
Remove space before inheritance colon
...
Co-authored-by: Michael Ilseman <michael.ilseman@gmail.com >
2022-12-22 14:52:36 -08:00
Daniel Loffgren
47feb93a38
Add a test that ensures makeSendOnce is creating unique send-once rights
2022-12-21 13:43:26 -08:00
Daniel Loffgren
6a9ebce259
Add public annotations where applicable
2022-12-21 13:20:38 -08:00
Daniel Loffgren
7f4560f022
Remove unnecessary RightTypes for Mach.Ports being constructed inline with a return
2022-12-21 13:12:13 -08:00
Daniel Loffgren
6dd57fe3a9
Add a friendly precondition message for the MACH_PORT_NULL check
2022-12-21 12:57:25 -08:00
Daniel Loffgren
551d7b897f
Use mach_port_destruct() to deinit receive rights eliminating the second syscall, and use mach_port_mod_refs() for all other right types to get a free type check at deinit time
...
mach_port_mod_refs() requires the type of right being modified. So,
MACH_PORT_DEAD must be identified as a separate type. As this is
something that shouldn't be possible for receive rights, preconditions
have also been added to protect against this particular error.
2022-12-21 12:53:47 -08:00
Daniel Loffgren
296374ecef
Label tuple contents for allocatePortPair() and relinquish()
2022-12-21 11:46:06 -08:00
Daniel Loffgren
213165ab72
size should be the number of natural_t's
2022-12-20 15:45:17 -08:00
Daniel Loffgren
bd036acda6
Storage should be initialized to MACH_PORT_NULL, rather than 0
2022-12-20 15:45:17 -08:00
Daniel Loffgren
4536c47763
Use precondition instead of assert, adding a machPrecondition for the common KERN_SUCCESS check
2022-12-20 15:45:17 -08:00
Daniel Loffgren
bdc776bd3e
Correct parameter whitespace
2022-12-19 17:14:53 -08:00
loffgren and Matt Wright
c2d940ecf3
Remove parens around RightType condition in initializer
...
Co-authored-by: Matt Wright <mww@apple.com >
2022-12-19 16:41:33 -08:00
Daniel Loffgren
304ccc3abb
Add Mach.Port
2022-12-07 17:24:26 -08:00
Florian Friedrich
77d9ca18c1
Add Sendable conformances ( #115 )
2022-11-30 14:04:49 -07:00
3405691582
18cceda484
Support OpenBSD. ( #113 )
...
Add the usual `os` conditionals and exclude errno constants that aren't
present on this platform.
Maybe availability annotations are a better way to deal with this, but
that is likely something that requires more careful consideration.
2022-10-31 09:22:05 -06:00
Saleem Abdulrasool
252c0f0905
Merge pull request #109 from krzyzanowskim/marcin/quote-cmake-include
...
Quote cmake include path
2022-09-17 08:42:39 -07:00
Marcin Krzyzanowski
e1f6974ba6
Quote include path
2022-09-10 02:21:53 +02:00
Alex Martini
015e9baf40
Fix a broken link. ( #107 )
2022-08-23 07:21:09 -06:00
Daniel Duan
036f567f23
Remove Windows warnings ( #105 )
...
These calls are missing their Windows counter parts, resulting warnings
stating `X is deprecated: The POSIX name for this item is deprecated.
Instead, use the ISO C and C++ conformant name: Y. See online help for
details`.
Add them like the rest.
2022-06-21 09:50:24 -06:00
Saleem Abdulrasool
348b4de820
Merge pull request #99 from compnerd/file-flags
...
Tests: remove some flags from file tests
2022-06-18 09:44:43 -07:00
Saleem Abdulrasool
e378fb2f0d
Tests: ignore XCTest manifest on newer Swift ( #91 )
...
This is motivated by the desire to build the test suite on Windows.
Newer versions of SPM have test discovery which obviates the test
manifest, which incidentally repairs the build on Windows while adopting
newer functionality and reducing management complexity.
2022-06-15 10:00:23 -06:00
Karoy Lorentey
63cdebeff6
Merge pull request #95 from compnerd/chartype
...
Tests: explicitly convert the character type
2022-06-13 16:32:28 -07:00
Karoy Lorentey
97a03f97c8
Merge pull request #103 from compnerd/array
...
Tests: change the conversion for string to array
2022-06-13 16:30:40 -07:00
Karoy Lorentey
0a7e8e121b
Merge pull request #100 from compnerd/utf16
...
Tests: explicitly convert to UTF16 on Windows
2022-06-13 16:14:41 -07:00
Karoy Lorentey
a102156af3
Merge pull request #96 from compnerd/not-errno
...
Tests: remove error codes that are unavailable on windows
2022-06-13 14:59:59 -07:00
Karoy Lorentey
dc5a3107c0
Merge pull request #102 from compnerd/underlying
...
Tests: adjust the Windows error codes
2022-06-13 14:55:14 -07:00
Karoy Lorentey
bcba321273
Merge pull request #104 from compnerd/validity
...
Tests: adjust invalid character
2022-06-13 14:34:45 -07:00
Saleem Abdulrasool
a5c43b17a9
Tests: adjust invalid character
...
Adjust the injected character to be an invalid UTF-16 and UTF-8
character. This is required to make the tests pass on Windows.
2022-06-12 14:34:12 -07:00
Saleem Abdulrasool
429f64259f
Tests: adjust the Windows error codes
...
The Windows error codes are not re-exported, explicitly import the
WinSDK module to gain access to the error codes. Add Windows specific
checks to ensure that the named forms match the underlying
implementation.
2022-06-12 12:35:54 -07:00
Saleem Abdulrasool
18c5f7a54b
Tests: change the conversion for string to array
...
Windows uses UTF16 for the platform character, not UTF8, and does not
map to CChar. Add a Windows path for the conversion.
2022-06-12 11:59:43 -07:00
Saleem Abdulrasool
f9a514897e
Tests: explicitly convert to UTF16 on Windows
...
File paths on Windows are represented in UTF16, while Swift strings are
UTF8. Explicitly convert from UTF16 on Windows.
2022-06-12 11:37:47 -07:00
Saleem Abdulrasool
8e247d927e
Tests: remove some flags from file tests
...
Windows does not support some flags (e.g. `O_CLOEXEC`). This removes
the unsupported options on Windows.
2022-06-12 11:33:45 -07:00
Saleem Abdulrasool
59ddf00c8e
Tests: remove error codes that are unavailable on windows
...
Not all the error codes are available on Windows, this matches
SystemErrno cases to remove the cases that have no definition on
Windows.
2022-06-12 11:21:16 -07:00
Saleem Abdulrasool
6d8abddbc8
Tests: explicitly convert the character type
...
The platform character type is different across Unix and Windows.
Explicitly convert the value to the expected type.
2022-06-11 14:50:35 -07:00
Karoy Lorentey
025bcb1165
Merge pull request #93 from apple/revert-89-sb/resize-windows
...
Revert "FileOperations: Add Windows implementation for FileDescriptor.resize(to:)"
1.2.1
2022-06-11 12:57:28 -07:00
Karoy Lorentey
f5e4aac51b
Revert "FileOperations: Add Windows implementation for FileDescriptor.resize(to:) ( #89 )"
...
This reverts commit 94fa6bd2ff .
2022-06-11 12:54:19 -07:00
Si Beaumont
94fa6bd2ff
FileOperations: Add Windows implementation for FileDescriptor.resize(to:) ( #89 )
...
* FileOperations: Add Windows implementation for FileDescriptor.resize(to:)
Replace _chsize with _chsize_s on Windows
1.2.0
2022-06-09 09:51:28 -06:00
Alsey Coleman Miller
a552fda216
Import C module as @_implementationOnly ( #83 )
2022-06-08 19:54:55 -06:00
Guillaume Lessard
bdb13a5a80
Merge pull request #80 from apple/glessard/rdar91436410
...
Mitigate misuse of Swift's pointer conversion feature
2022-06-03 16:52:30 -06:00
Guillaume Lessard
3920df78d9
Correct deprecation messages
2022-06-03 16:43:25 -06:00
Guillaume Lessard
469ede0fa2
Add tests for every new overload added
2022-06-03 16:43:25 -06:00
Guillaume Lessard
afe2d35d0b
Mitigate misuse of pointer conversion in FilePath inits
2022-06-03 16:43:25 -06:00
Guillaume Lessard
25380a1bea
Mitigate misuse of pointer conversion in String inits
2022-06-03 16:43:25 -06:00