#define PCAP_DO_PRAGMA(x) _Pragma (#x)
#endif
+/*
+ * Suppress "enum value not explicitly handled in switch" warnings.
+ * We may have to build on multiple different Windows SDKs, so we
+ * may not be able to include all enum values in a switch, as they
+ * won't necessarily be defined on all the SDKs, and, unlike
+ * #defines, there's no easy way to test whether a given enum has
+ * a given value. It *could* be done by the configure script or
+ * CMake tests.
+ */
+#if defined(_MSC_VER)
+ #define DIAG_OFF_ENUM_SWITCH \
+ __pragma(warning(push)) \
+ __pragma(warning(disable:4061))
+ #define DIAG_ON_ENUM_SWITCH \
+ __pragma(warning(pop))
+#else
+ #define DIAG_OFF_ENUM_SWITCH
+ #define DIAG_ON_ENUM_SWITCH
+#endif
+
/*
* Suppress Flex, narrowing, and deprecation warnings.
*/
if (status == 0) {
/*
* We got the physical medium.
+ *
+ * XXX - we might want to check for NdisPhysicalMediumWiMax
+ * and NdisPhysicalMediumNative802_15_4 being
+ * part of the enum, and check for those in the "wireless"
+ * case.
*/
+DIAG_OFF_ENUM_SWITCH
switch (phys_medium) {
case NdisPhysicalMediumWirelessLan:
default:
/*
- * Not wireless.
+ * Not wireless or unknown
*/
break;
}
+DIAG_ON_ENUM_SWITCH
}
#endif
*flags |= PCAP_IF_CONNECTION_STATUS_DISCONNECTED;
break;
+ case MediaConnectStateUnknown:
default:
/*
* It's unknown whether it's connected or not.