From dc7311bec7fd58f29ee7af16ddb25dca6a9cc827 Mon Sep 17 00:00:00 2001
From: gnzlbg <gonzalobg88@gmail.com>
Date: Tue, 14 May 2019 14:01:40 +0200
Subject: [PATCH] Include aio.h before sys/mount.h on linux

---
 libc-test/build.rs | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/libc-test/build.rs b/libc-test/build.rs
index 68013617..50082d8e 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2260,6 +2260,17 @@ fn test_linux(target: &str) {
     // FIXME: still necessary?
     cfg.flag("-Wno-deprecated-declarations");
 
+    // note: aio.h must be included before sys/mount.h
+    if !uclibc {
+        assert!(gnu || musl);
+        // optionally included in uclibc
+        headers! { cfg:
+                   "sys/xattr.h",
+                   "sys/sysinfo.h",
+                   "aio.h",
+        }
+    }
+
     headers! { cfg:
                "ctype.h",
                "dirent.h",
@@ -2395,16 +2406,6 @@ fn test_linux(target: &str) {
         }
     }
 
-    if !uclibc {
-        assert!(gnu || musl);
-        // optionally included in uclibc
-        headers! { cfg:
-                   "sys/xattr.h",
-                   "sys/sysinfo.h",
-                   "aio.h",
-        }
-    }
-
     // DCCP support
     if !uclibc && !musl {
         assert!(gnu);
-- 
GitLab