More VS2013 fixes 13/8513/3
authorDave Thaler <dthaler@microsoft.com>
Tue, 7 Jun 2016 00:19:55 +0000 (17:19 -0700)
committerDavid Antler <david.a.antler@intel.com>
Tue, 7 Jun 2016 23:10:30 +0000 (23:10 +0000)
Change-Id: I038f6ddc0cd654b2b2a687f6564d5a66a048dbb3
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8513
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: David Antler <david.a.antler@intel.com>
Reviewed-by: Daniel Jay Ferguson <daniel.j.ferguson@intel.com>
resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.c
resource/csdk/connectivity/src/ip_adapter/windows/caipnwmonitor.c
resource/csdk/stack/test/stacktests.cpp

index 5a28696..c6efa8d 100644 (file)
@@ -19,6 +19,9 @@
 #ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
 
 #include "debug.h"
 #include "pdu.h"
index 8c9490a..a6b2e38 100644 (file)
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <errno.h>
 #include <winsock2.h>
+#include <iphlpapi.h>
 #include "platform_features.h"
 #include <iptypes.h>
 #include <stdbool.h>
index beaa35e..5bb4c16 100644 (file)
@@ -1678,6 +1678,8 @@ TEST(StackResourceAccess, DeleteMiddleResource)
     EXPECT_EQ(OC_STACK_OK, OCStop());
 }
 
+// Visual Studio versions earlier than 2015 have bugs in is_pod and report the wrong answer.
+#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
 TEST(PODTests, OCHeaderOption)
 {
     EXPECT_TRUE(std::is_pod<OCHeaderOption>::value);
@@ -1685,8 +1687,9 @@ TEST(PODTests, OCHeaderOption)
 
 TEST(PODTests, OCCallbackData)
 {
-    EXPECT_TRUE(std::is_pod<OCHeaderOption>::value);
+    EXPECT_TRUE(std::is_pod<OCCallbackData>::value);
 }
+#endif
 
 TEST(OCDoDirectPairingTests, Nullpeer)
 {