tcpdump mailing list archives
<errno.h> in the Win32 version
From: "Gisle Vanem" <gvanem () yahoo no>
Date: Fri, 4 Apr 2014 15:55:43 +0200
I note that a local "Win32/include/errno.h" is shadowing for the real <errno.h> which is not nice. And shouldn't sys-headers come first in missing/inet_pton.c?#include <tcpdump-stdinc.h> #include <errno.h>
Since MSVC's <errno.h> has a 'EAFNOSUPPORT', but MingW+Watcomdoes not, I think it's cleaner to remove the local Win32/include/errno.h and do some checks in tcpdump-stdinc.h instead:
-#include <Ws2tcpip.h> +#include <ws2tcpip.h> <<<!! use the real name incase someone cross-compiles #include "bittypes.h" #include <ctype.h> #include <time.h> #include <io.h> +#include <errno.h> ... +/* It is in MSVC's <errno.h>, but not defined in MingW+Watcom. + */ +#ifndef EAFNOSUPPORT +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#endif + Other targets using missing/inet_pton.c should thus work as before.BTW. there is a similar issue with EAFNOSUPPORT (and _errno()) in libpcap that I can come back to.
--gv _______________________________________________ tcpdump-workers mailing list tcpdump-workers () lists tcpdump org https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers
Current thread:
- <errno.h> in the Win32 version Gisle Vanem (Apr 04)