Skip to content

Commit 2e0f18a

Browse files
authored
Merge pull request #7 from escrafford/master
Fixing errors encountered in xcode 9
2 parents f267e24 + fcce1fd commit 2e0f18a

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

NetDiag/QNNPing.m

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,17 @@ - (instancetype)init:(NSInteger)code
9090
};
9191
typedef struct IPHeader IPHeader;
9292

93-
check_compile_time(sizeof(IPHeader) == 20);
94-
check_compile_time(offsetof(IPHeader, versionAndHeaderLength) == 0);
95-
check_compile_time(offsetof(IPHeader, differentiatedServices) == 1);
96-
check_compile_time(offsetof(IPHeader, totalLength) == 2);
97-
check_compile_time(offsetof(IPHeader, identification) == 4);
98-
check_compile_time(offsetof(IPHeader, flagsAndFragmentOffset) == 6);
99-
check_compile_time(offsetof(IPHeader, timeToLive) == 8);
100-
check_compile_time(offsetof(IPHeader, protocol) == 9);
101-
check_compile_time(offsetof(IPHeader, headerChecksum) == 10);
102-
check_compile_time(offsetof(IPHeader, sourceAddress) == 12);
103-
check_compile_time(offsetof(IPHeader, destinationAddress) == 16);
93+
__Check_Compile_Time(sizeof(IPHeader) == 20);
94+
__Check_Compile_Time(offsetof(IPHeader, versionAndHeaderLength) == 0);
95+
__Check_Compile_Time(offsetof(IPHeader, differentiatedServices) == 1);
96+
__Check_Compile_Time(offsetof(IPHeader, totalLength) == 2);
97+
__Check_Compile_Time(offsetof(IPHeader, identification) == 4);
98+
__Check_Compile_Time(offsetof(IPHeader, flagsAndFragmentOffset) == 6);
99+
__Check_Compile_Time(offsetof(IPHeader, timeToLive) == 8);
100+
__Check_Compile_Time(offsetof(IPHeader, protocol) == 9);
101+
__Check_Compile_Time(offsetof(IPHeader, headerChecksum) == 10);
102+
__Check_Compile_Time(offsetof(IPHeader, sourceAddress) == 12);
103+
__Check_Compile_Time(offsetof(IPHeader, destinationAddress) == 16);
104104

105105
typedef struct ICMPPacket {
106106
uint8_t type;
@@ -116,12 +116,12 @@ - (instancetype)init:(NSInteger)code
116116
kQNNICMPTypeEchoRequest = 8
117117
};
118118

119-
check_compile_time(sizeof(ICMPPacket) == 8);
120-
check_compile_time(offsetof(ICMPPacket, type) == 0);
121-
check_compile_time(offsetof(ICMPPacket, code) == 1);
122-
check_compile_time(offsetof(ICMPPacket, checksum) == 2);
123-
check_compile_time(offsetof(ICMPPacket, identifier) == 4);
124-
check_compile_time(offsetof(ICMPPacket, sequenceNumber) == 6);
119+
__Check_Compile_Time(sizeof(ICMPPacket) == 8);
120+
__Check_Compile_Time(offsetof(ICMPPacket, type) == 0);
121+
__Check_Compile_Time(offsetof(ICMPPacket, code) == 1);
122+
__Check_Compile_Time(offsetof(ICMPPacket, checksum) == 2);
123+
__Check_Compile_Time(offsetof(ICMPPacket, identifier) == 4);
124+
__Check_Compile_Time(offsetof(ICMPPacket, sequenceNumber) == 6);
125125

126126
const int kQNNPacketSize = sizeof(ICMPPacket) + 100;
127127

NetDiag/QNNTraceRoute.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#import <netinet/in.h>
1616
#import <netinet/tcp.h>
1717

18+
#import <sys/select.h>
19+
#import <sys/time.h>
20+
1821
#import "QNNQue.h"
1922
#import "QNNTraceRoute.h"
2023

0 commit comments

Comments
 (0)