diff --git a/glib/gmain.c b/glib/gmain.c index 9de145340..775b55c0a 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