From fcce1fd3fed3da6f39a6669163abbc525cd7e7e2 Mon Sep 17 00:00:00 2001 From: Erik Scrafford Date: Mon, 7 Aug 2017 14:57:19 -0700 Subject: [PATCH] Fixing errors encountered in xcode 9 --- NetDiag/QNNPing.m | 34 +++++++++++++++++----------------- NetDiag/QNNTraceRoute.m | 3 +++ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/NetDiag/QNNPing.m b/NetDiag/QNNPing.m index beda0eb..d779628 100644 --- a/NetDiag/QNNPing.m +++ b/NetDiag/QNNPing.m @@ -90,17 +90,17 @@ - (instancetype)init:(NSInteger)code }; typedef struct IPHeader IPHeader; -check_compile_time(sizeof(IPHeader) == 20); -check_compile_time(offsetof(IPHeader, versionAndHeaderLength) == 0); -check_compile_time(offsetof(IPHeader, differentiatedServices) == 1); -check_compile_time(offsetof(IPHeader, totalLength) == 2); -check_compile_time(offsetof(IPHeader, identification) == 4); -check_compile_time(offsetof(IPHeader, flagsAndFragmentOffset) == 6); -check_compile_time(offsetof(IPHeader, timeToLive) == 8); -check_compile_time(offsetof(IPHeader, protocol) == 9); -check_compile_time(offsetof(IPHeader, headerChecksum) == 10); -check_compile_time(offsetof(IPHeader, sourceAddress) == 12); -check_compile_time(offsetof(IPHeader, destinationAddress) == 16); +__Check_Compile_Time(sizeof(IPHeader) == 20); +__Check_Compile_Time(offsetof(IPHeader, versionAndHeaderLength) == 0); +__Check_Compile_Time(offsetof(IPHeader, differentiatedServices) == 1); +__Check_Compile_Time(offsetof(IPHeader, totalLength) == 2); +__Check_Compile_Time(offsetof(IPHeader, identification) == 4); +__Check_Compile_Time(offsetof(IPHeader, flagsAndFragmentOffset) == 6); +__Check_Compile_Time(offsetof(IPHeader, timeToLive) == 8); +__Check_Compile_Time(offsetof(IPHeader, protocol) == 9); +__Check_Compile_Time(offsetof(IPHeader, headerChecksum) == 10); +__Check_Compile_Time(offsetof(IPHeader, sourceAddress) == 12); +__Check_Compile_Time(offsetof(IPHeader, destinationAddress) == 16); typedef struct ICMPPacket { uint8_t type; @@ -116,12 +116,12 @@ - (instancetype)init:(NSInteger)code kQNNICMPTypeEchoRequest = 8 }; -check_compile_time(sizeof(ICMPPacket) == 8); -check_compile_time(offsetof(ICMPPacket, type) == 0); -check_compile_time(offsetof(ICMPPacket, code) == 1); -check_compile_time(offsetof(ICMPPacket, checksum) == 2); -check_compile_time(offsetof(ICMPPacket, identifier) == 4); -check_compile_time(offsetof(ICMPPacket, sequenceNumber) == 6); +__Check_Compile_Time(sizeof(ICMPPacket) == 8); +__Check_Compile_Time(offsetof(ICMPPacket, type) == 0); +__Check_Compile_Time(offsetof(ICMPPacket, code) == 1); +__Check_Compile_Time(offsetof(ICMPPacket, checksum) == 2); +__Check_Compile_Time(offsetof(ICMPPacket, identifier) == 4); +__Check_Compile_Time(offsetof(ICMPPacket, sequenceNumber) == 6); const int kQNNPacketSize = sizeof(ICMPPacket) + 100; diff --git a/NetDiag/QNNTraceRoute.m b/NetDiag/QNNTraceRoute.m index 591e6d1..ea2f453 100644 --- a/NetDiag/QNNTraceRoute.m +++ b/NetDiag/QNNTraceRoute.m @@ -15,6 +15,9 @@ #import #import +#import +#import + #import "QNNQue.h" #import "QNNTraceRoute.h"