Skip to content

Commit

Permalink
htons compile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Feb 5, 2016
1 parent b10b2f2 commit d0b57c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Socket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public class Socket: Hashable, Equatable {

private class func htonsPort(port: in_port_t) -> in_port_t {
#if os(Linux)
return htons(port)
return port.bigEndian
#else
let isLittleEndian = Int(OSHostByteOrder()) == OSLittleEndian
return isLittleEndian ? _OSSwapInt16(port) : port
Expand All @@ -213,4 +213,4 @@ public class Socket: Hashable, Equatable {

public func ==(socket1: Socket, socket2: Socket) -> Bool {
return socket1.socketFileDescriptor == socket2.socketFileDescriptor
}
}

0 comments on commit d0b57c0

Please sign in to comment.