Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/NIOCore/FileHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extension UInt64 {
}
}
}
#elseif arch(arm) || arch(i386) || arch(arm64_32)
Copy link
Contributor

Choose a reason for hiding this comment

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

If this only matters the pointer size, _pointerBitWidth(_64) and _pointerBitWidth(_32) might be better choice

Copy link
Member

Choose a reason for hiding this comment

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

+1, otherwise it misses plenty of other 32-bit architectures that in theory could be supported in the future.

Copy link
Member

Choose a reason for hiding this comment

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

That's up to the NIO folks but

  • _pointerBitWidth* is underscored and we have non-underscored alternatives (but yes, they're annoying)
  • mixed platforms like arm64_32 need to fall into the correct place, which in this case would be true (assuming that _pointerBitWidth(_32) is true for arm64_32

Copy link
Contributor

Choose a reason for hiding this comment

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

My gut feeling is to avoid the underscored APIs. If it becomes necessary to support more 32-bit architectures in the future then we should push to get a non-underscored API.

Copy link
Contributor Author

@scottmarchant scottmarchant Mar 25, 2025

Choose a reason for hiding this comment

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

Sounds like the consensus is stick with || arch(wasm32). I'll leave as-is unless someone voice opinions otherwise. Happy to change this if desired, though.

I tried out adding || _pointerBitWidth(_32) instead of || arch(wasm32), and that also worked, just as a data point.

Copy link
Member

Choose a reason for hiding this comment

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

Friendly ping @glbrntt to approve & merge

#elseif arch(arm) || arch(i386) || arch(arm64_32) || arch(wasm32)
// 32 bit architectures
// Note: for testing purposes you can also use these defines for 64 bit platforms, they'll just consume twice as
// much space, nothing else will go bad.
Expand Down
Loading