XXX base gcc
Reordering needed to prefer long long because base-gcc doesn't recognize
  #pragma GCC diagnostic error "-Wincompatible-pointer-types"
and doesn't fail to compile the test case (gint64 should be long long).

IP_RECVTOS check:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/5454

XXX don't pick up libatomic from lang/gcc/

Index: meson.build
--- meson.build.orig
+++ meson.build
@@ -1649,19 +1649,6 @@ endif
 # works.
 if long_long_size == long_size
   if cc.compiles('''#if defined(_AIX) && !defined(__GNUC__)
-                    #pragma options langlvl=stdc99
-                    #endif
-                    #pragma GCC diagnostic error "-Wincompatible-pointer-types"
-                    #include <stdint.h>
-                    #include <stdio.h>
-                    int main () {
-                      int64_t i1 = 1;
-                      long *i2 = &i1;
-                      (void) i2;
-                      return 1;
-                    }''', name : 'int64_t is long')
-    int64_t_typedef = 'long'
-  elif cc.compiles('''#if defined(_AIX) && !defined(__GNUC__)
                       #pragma options langlvl=stdc99
                       #endif
                       #pragma GCC diagnostic error "-Wincompatible-pointer-types"
@@ -1674,6 +1661,19 @@ if long_long_size == long_size
                         return 1;
                       }''', name : 'int64_t is long long')
     int64_t_typedef = 'long long'
+  elif cc.compiles('''#if defined(_AIX) && !defined(__GNUC__)
+                    #pragma options langlvl=stdc99
+                    #endif
+                    #pragma GCC diagnostic error "-Wincompatible-pointer-types"
+                    #include <stdint.h>
+                    #include <stdio.h>
+                    int main () {
+                      int64_t i1 = 1;
+                      long *i2 = &i1;
+                      (void) i2;
+                      return 1;
+                    }''', name : 'int64_t is long')
+    int64_t_typedef = 'long'
   else
     error('Cannot detect int64_t typedef')
   endif
@@ -2066,6 +2066,10 @@ else
 endif
 glib_conf.set('HAVE_IPV6', have_ipv6)
 
+# IP_RECVTOS is not available on every platform (e.g. OpenBSD)
+have_ip_recvtos = host_system != 'windows' and cc.has_header_symbol('netinet/in.h', 'IP_RECVTOS')
+glib_conf.set('HAVE_IP_RECVTOS', have_ip_recvtos)
+
 # We need to decide at configure time if GLib will use real atomic
 # operations ("lock free") or emulated ones with a mutex.  This is
 # because we must put this information in glibconfig.h so we know if
@@ -2308,9 +2312,9 @@ libatomic_test_code = '''
     return 0;
   }'''
 atomic_dep = []
-if cc.links(libatomic_test_code, args : '-latomic', name : 'check for -latomic')
-  atomic_dep = cc.find_library('atomic')
-endif
+#if cc.links(libatomic_test_code, args : '-latomic', name : 'check for -latomic')
+#  atomic_dep = cc.find_library('atomic')
+#endif
 
 # First check in libc, fallback to libintl, and as last chance build
 # proxy-libintl subproject.
