From e85f05f02ba061ab9886ef73a0fa3d0de77764a5 Mon Sep 17 00:00:00 2001 From: Aymeric Wibo Date: Tue, 5 Nov 2024 19:11:40 +0100 Subject: [PATCH] ~: Fix some issues with building on Linux --- src/bsys.c | 3 ++- src/bsys/bob/main.c | 3 ++- src/build_step.h | 1 + src/class/cc.c | 3 ++- src/class/linker.c | 6 ++++-- src/cmd.c | 3 ++- src/cmd.h | 1 + src/cookie.h | 10 ++++++---- src/fsutil.h | 1 + src/main.c | 2 ++ 10 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/bsys.c b/src/bsys.c index 6ef1d5f3..f78d9578 100644 --- a/src/bsys.c +++ b/src/bsys.c @@ -1,8 +1,9 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2024 Aymeric Wibo -#include #include + +#include #include #include #include diff --git a/src/bsys/bob/main.c b/src/bsys/bob/main.c index 91df91ca..c5a44241 100644 --- a/src/bsys/bob/main.c +++ b/src/bsys/bob/main.c @@ -1,10 +1,11 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2024 Aymeric Wibo +#include + #include #include #include -#include #include #include #include diff --git a/src/build_step.h b/src/build_step.h index 8801c33f..10b12e4c 100644 --- a/src/build_step.h +++ b/src/build_step.h @@ -3,6 +3,7 @@ #pragma once +#include #include typedef int (*build_step_cb_t)(size_t data_count, void** data); diff --git a/src/class/cc.c b/src/class/cc.c index be88cdf7..4c3a2ad5 100644 --- a/src/class/cc.c +++ b/src/class/cc.c @@ -1,10 +1,11 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2024 Aymeric Wibo +#include + #include #include #include -#include #include #include #include diff --git a/src/class/linker.c b/src/class/linker.c index 8a93c670..9edc4d79 100644 --- a/src/class/linker.c +++ b/src/class/linker.c @@ -1,10 +1,11 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2024 Aymeric Wibo +#include + #include #include #include -#include #include #include #include @@ -15,6 +16,7 @@ #include #include #include +#include #include #include @@ -156,7 +158,7 @@ static int prep_link(state_t* state, flamingo_arg_list_t* args, flamingo_val_t** } char* cookie = NULL; - asprintf(&cookie, "%s/bob/linker.link.cookie.%llx.exe", out_path, total_hash); + asprintf(&cookie, "%s/bob/linker.link.cookie.%" PRIx64 ".exe", out_path, total_hash); assert(cookie != NULL); *rv = flamingo_val_make_cstr(cookie); diff --git a/src/cmd.c b/src/cmd.c index 45032496..21b4180a 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,8 +1,9 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2024 Aymeric Wibo -#include #include + +#include #include #include #include diff --git a/src/cmd.h b/src/cmd.h index 636fbe46..c58f7a5e 100644 --- a/src/cmd.h +++ b/src/cmd.h @@ -3,6 +3,7 @@ #pragma once +#include #include typedef struct { diff --git a/src/cookie.h b/src/cookie.h index 34fde79e..f78c86bb 100644 --- a/src/cookie.h +++ b/src/cookie.h @@ -3,17 +3,19 @@ #pragma once +#include + +#include + #include +#include #include #include #include -#include -#include - static inline char* gen_cookie(char* path, size_t path_size, char const* ext) { char* cookie = NULL; - asprintf(&cookie, "%s/bob/%.*s.cookie.%llx.%s", out_path, (int) path_size, path, str_hash(path), ext); + asprintf(&cookie, "%s/bob/%.*s.cookie.%" PRIx64 ".%s", out_path, (int) path_size, path, str_hash(path), ext); assert(cookie != NULL); size_t const prefix_len = strlen(out_path) + strlen("/bob/"); diff --git a/src/fsutil.h b/src/fsutil.h index e9b9aa9b..053f16cd 100644 --- a/src/fsutil.h +++ b/src/fsutil.h @@ -4,6 +4,7 @@ #pragma once #include +#include int rm(char const* path, char** err); int copy(char const* src, char const* dst, char** err); diff --git a/src/main.c b/src/main.c index cdfffddb..b889a1fd 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2023 Aymeric Wibo +#include + #include #include #include