Skip to content

Commit 74b3a8d

Browse files
authored
Copy Android constants needed by Channel over to NIOCore too (#1924)
Motivation: Unbreak Android build from NIOCore not having these constants defined. Modifications: Copy the same constants that Channel was using in NIO over. Result: Android compiles again and the same tests pass.
1 parent e66b64e commit 74b3a8d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/NIOCore/BSDSocketAPI.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,14 @@ private let sysInet_pton: @convention(c) (CInt, UnsafePointer<CChar>?, UnsafeMut
6868
#endif
6969

7070
// Work around SO_TIMESTAMP/SO_RCVTIMEO being awkwardly defined in glibc.
71-
#if os(Android) && arch(arm)
71+
#if os(Android)
72+
let IFF_BROADCAST: CUnsignedInt = numericCast(CNIOLinux.IFF_BROADCAST.rawValue)
73+
let IFF_POINTOPOINT: CUnsignedInt = numericCast(CNIOLinux.IFF_POINTOPOINT.rawValue)
74+
let IFF_MULTICAST: CUnsignedInt = numericCast(CNIOLinux.IFF_MULTICAST.rawValue)
75+
#if arch(arm)
7276
let SO_RCVTIMEO = SO_RCVTIMEO_OLD
7377
let SO_TIMESTAMP = SO_TIMESTAMP_OLD
78+
#endif
7479
#elseif os(Linux)
7580
let SO_TIMESTAMP = CNIOLinux_SO_TIMESTAMP
7681
let SO_RCVTIMEO = CNIOLinux_SO_RCVTIMEO

0 commit comments

Comments
 (0)