traviscross / mtr

Official repository for mtr, a network diagnostic tool
http://www.bitwizard.nl/mtr/
GNU General Public License v2.0
2.6k stars 334 forks source link

on cygwin build error #477

Open pedoc opened 1 year ago

pedoc commented 1 year ago

version:

cat /proc/version
CYGWIN_NT-10.0-25375 version 3.4.6-1.x86_64 (corinna@calimero) (gcc version 11.3.0 20220421 (Fedora Cygwin 11.3.0-1) (GCC) ) 2023-02-14 13:23 UTC

On recent versions of cygwin, the icmpv6_echo_reply_lh typedef already exists.

$ grep -r icmpv6_echo_reply_lh /usr/include
/usr/include/w32api/ipexport.h:typedef struct icmpv6_echo_reply_lh {

ipexport.h(L105-102)

typedef struct icmpv6_echo_reply_lh {
  IPV6_ADDRESS_EX Address;
  ULONG Status;
  unsigned int RoundTripTime;
} ICMPV6_ECHO_REPLY_LH, *PICMPV6_ECHO_REPLY_LH;

typedef ICMPV6_ECHO_REPLY_LH ICMPV6_ECHO_REPLY;
typedef ICMPV6_ECHO_REPLY_LH *PICMPV6_ECHO_REPLY;

This leads to duplication of definitions in packet\probe_cygwin.h

If you delete the relevant definitions in /usr/include/w32api/ipexport.h, it can be compiled normally, but if you delete the definitions in packet\probe_cygwin.h, it fails.

apschultz commented 10 months ago

Slightly easier change that doesn't involve hacking standard headers:

https://github.com/traviscross/mtr/issues/465#issuecomment-1732383935