Fix compilation with old versions of MSVC.

Some old versions of MSVC have broken C preprocessors and failed to
handle #ifdef/#else/#endif in the middle of a macro call.  Just
This commit is contained in:
Gisle Vanem 2014-03-11 13:21:30 -07:00 committed by Guy Harris
parent d08b4abef4
commit 48d8b05b1c

View File

@ -150,13 +150,11 @@ ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha
if (cp + 16 > ep) if (cp + 16 > ep)
goto corrupt; goto corrupt;
ND_TCHECK2(*cp, 16); ND_TCHECK2(*cp, 16);
ND_PRINT((ndo, "%s%s", sep,
#ifdef INET6 #ifdef INET6
ip6addr_string(cp) ND_PRINT((ndo, "%s%s", sep, ip6addr_string(cp)));
#else #else
"(compiled w/o IPv6)" ND_PRINT((ndo, "%s(compiled w/o IPv6)", sep));
#endif /* INET6 */ #endif /* INET6 */
));
cp += 16; cp += 16;
sep = ", "; sep = ", ";
} }
@ -202,13 +200,11 @@ ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
if (cp + 17 > ep) if (cp + 17 > ep)
goto corrupt; goto corrupt;
ND_TCHECK2(*cp, 17); ND_TCHECK2(*cp, 17);
ND_PRINT((ndo, "%s%s/%u", sep,
#ifdef INET6 #ifdef INET6
ip6addr_string(cp), ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(cp), *(cp + 16)));
#else #else
"(compiled w/o IPv6)", ND_PRINT((ndo, "%s(compiled w/o IPv6)/%u", sep, *(cp + 16)));
#endif /* INET6 */ #endif /* INET6 */
*(cp + 16)));
cp += 17; cp += 17;
sep = ", "; sep = ", ";
} }