diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-09-05 18:02:27 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-09-05 18:02:27 -0700 |
commit | 2cd8f771a04a5bc33133fcbf5a1b377870dbe0e7 (patch) | |
tree | 6f1fcc6a6a1fed9079c4ea46762f8cc844a2560c /pcap/pcap.h | |
parent | b08aa2705220364df0d51317689543639b04f5c7 (diff) | |
download | libpcap-2cd8f771a04a5bc33133fcbf5a1b377870dbe0e7.tar.gz |
We need to include <io.h>, as we call _get_osfhandle() in macros.
Also, explain *why* those calls are macros.
Diffstat (limited to 'pcap/pcap.h')
-rw-r--r-- | pcap/pcap.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pcap/pcap.h b/pcap/pcap.h index 9a3d4156..59ab73f6 100644 --- a/pcap/pcap.h +++ b/pcap/pcap.h @@ -73,6 +73,7 @@ #if defined(_WIN32) #include <winsock2.h> /* u_int, u_char etc. */ + #include <io.h> /* _get_osfhandle() */ #elif defined(MSDOS) #include <sys/types.h> /* u_int, u_char etc. */ #include <sys/socket.h> @@ -399,6 +400,15 @@ PCAP_API pcap_t *pcap_open_offline(const char *, char *); /* * If we're building libpcap, these are internal routines in savefile.c, * so we must not define them as macros. + * + * If we're not building libpcap, given that the version of the C runtime + * with which libpcap was built might be different from the version + * of the C runtime with which an application using libpcap was built, + * and that a FILE structure may differ between the two versions of the + * C runtime, calls to _fileno() must use the version of _fileno() in + * the C runtime used to open the FILE *, not the version in the C + * runtime with which libpcap was built. (Maybe once the Universal CRT + * rules the world, this will cease to be a problem.) */ #ifndef BUILDING_PCAP #define pcap_fopen_offline_with_tstamp_precision(f,p,b) \ |