Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SyntaxText] Always use memcmp #2617

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[SyntaxText] Always use memcmp #2617

wants to merge 1 commit into from

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Apr 22, 2024

compareMemory(_:_:_:) was to abstract memcmp or Collection.elementsEqual(_:) depending on the platform or build settings. Now that we consistently imports "platform" system module, so memcmp is reliably available.

@rintaro
Copy link
Member Author

rintaro commented Apr 22, 2024

@rintaro
Copy link
Member Author

rintaro commented Apr 22, 2024

@swift-ci Please test

@@ -25,6 +27,8 @@ import Darwin
import Glibc
#elseif canImport(Musl)
import Musl
Copy link
Member Author

@rintaro rintaro Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rintaro
Copy link
Member Author

rintaro commented Apr 22, 2024

🤔 https://ci.swift.org/job/swift-syntax-PR-macOS/4092/

/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-macos.swiftinterface:13:64: error: unexpected code '...' in parameter clause
   11 |   return y < x ? y : x
   12 | }
   13 | @inlinable public func min<T>(_ x: T, _ y: T, _ z: T, _ rest: T...) -> T where T : Swift.Comparable {
      |                                                                `- error: unexpected code '...' in parameter clause
   14 |   var minValue = min(min(x, y), z)
   15 |   // In case `value == minValue`, we pick `minValue`. See min(_:_:).

@rintaro
Copy link
Member Author

rintaro commented Apr 22, 2024

@swift-ci Please test macOS

@rintaro
Copy link
Member Author

rintaro commented Apr 22, 2024

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Apr 22, 2024

@swift-ci Please test Windows

@rintaro
Copy link
Member Author

rintaro commented Apr 23, 2024

Windows failure is probably because ucrt.modulemap is not a part of test (i.e. check-swift) dependencies in swift repo.

@rintaro
Copy link
Member Author

rintaro commented Apr 23, 2024

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Apr 24, 2024

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Apr 24, 2024

@swift-ci Please test Windows

`compareMemory(_:_:_:)` was to abstract `memcmp` or
`Collection.elementsEqual(_:)` depending on the platform or build
settings. Now that we consistently imports "platform" system module, so
`memcmp` is reliably available.
@rintaro
Copy link
Member Author

rintaro commented Apr 24, 2024

apple/swift#73224
@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Apr 24, 2024

apple/swift#73224
@swift-ci Please test Windows

2 similar comments
@rintaro
Copy link
Member Author

rintaro commented Apr 24, 2024

apple/swift#73224
@swift-ci Please test Windows

@rintaro
Copy link
Member Author

rintaro commented Apr 24, 2024

apple/swift#73224
@swift-ci Please test Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants