Commit 406baf4b12

Al Hoang <3811822-hoanga@users.noreply.gitlab.com>
2021-11-01 03:22:56
update compilation includes for haiku
1 parent b26b72f
src/Compilation.zig
@@ -3836,6 +3836,15 @@ fn detectLibCFromLibCInstallation(arena: *Allocator, target: Target, lci: *const
             list.appendAssumeCapacity(shared_dir);
         }
     }
+    if (target.os.tag == .haiku) {
+        const include_dir_path = lci.include_dir orelse return error.LibCInstallationNotAvailable;
+        const os_dir = try std.fs.path.join(arena, &[_][]const u8{ include_dir_path, "os" });
+        list.appendAssumeCapacity(os_dir);
+
+        const config_dir = try std.fs.path.join(arena, &[_][]const u8{ include_dir_path, "config" });
+        list.appendAssumeCapacity(config_dir);
+    }
+
     return LibCDirs{
         .libc_include_dir_list = list.items,
         .libc_installation = lci,
src/libc_installation.zig
@@ -321,7 +321,7 @@ pub const LibCInstallation = struct {
         const sys_include_dir_example_file = if (is_windows)
             "sys\\types.h"
         else if (is_haiku)
-            "posix/errno.h"
+            "errno.h"
         else
             "sys/errno.h";