diff --git a/glib/gmain.c b/glib/gmain.c index 9de1453407d07987d45d5fa744f77ab39260f205..775b55c0ab4dad7bd86b770933a7953ea02d94b6 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -48,6 +48,15 @@ #define G_MAIN_POLL_DEBUG #endif +/* We need to include this as early as possible, because on some + * platforms like AIX, redefines the names we use for + * GPollFD struct members. + * See https://gitlab.gnome.org/GNOME/glib/-/issues/3500 */ + +#ifdef HAVE_POLL_H +#include +#endif + #ifdef G_OS_UNIX #include "glib-unix.h" #include @@ -69,10 +78,6 @@ #include #include -#ifdef HAVE_POLL_H -#include -#endif - #ifdef HAVE_PIDFD #include #include