On Thu, 25 Jan 2024 15:11:12 +0000
Jon Turney wrote:
> On 24/01/2024 15:22, Takashi Yano via Cygwin-apps wrote:
> > +#ifdef __CYGWIN__
> > +#define _GNU_SOURCE 1
> > +#endif
> > +
> 
> I'd suggest adding -D_GNU_SOURCE=1 to CPPFLAGS, rather than patching 
> this in everywhere it's needed.
> 
> (Setting this unconditionally could be added to the build system 
> somewhere, which is theoretically upstreamable, since it's only not 
> needed on linux for :reasons:)

Sounds good! Thanks.
I'll add it to CMakeLists.txt and Makfile for CYGWIN for the time being.

> > +#ifdef __CYGWIN__
> > +typedef uint32_t DWORD
> 
> Is it not possible to just #include <windows.h> here?  If not, perhaps a 
> comment why the definitions are copied would nice.

When I included <windows.h> here, many conflicts occured between
posix headers and w32api headers.
However, now I have found that including w32api headers after all
the posix headers and typedef IN6_ADDR like:

#ifdef __CYGWIN__
#include <windows.h>
#include <pdh.h>
#include <tlhelp32.h>
typedef struct {
  union {
    u_char Byte[16];
    u_short Word[8];
  } u;
} IN6_ADDR;
#include <iphlpapi.h>
#endif

solves the conflicts. Thanks!

-- 
Takashi Yano <takashi.y...@nifty.ne.jp>
  • [ITP] btop Takashi Yano via Cygwin-apps
    • Re: [ITP] btop Jon Turney via Cygwin-apps
      • Re: [ITP] btop Takashi Yano via Cygwin-apps

Reply via email to