Skip to content

Commit

Permalink
~: Fix some issues with building on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Nov 5, 2024
1 parent 9a14f8a commit e85f05f
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/bsys.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2024 Aymeric Wibo

#include <bsys.h>
#include <common.h>

#include <bsys.h>
#include <fsutil.h>
#include <logging.h>
#include <str.h>
Expand Down
3 changes: 2 additions & 1 deletion src/bsys/bob/main.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2024 Aymeric Wibo

#include <common.h>

#include <bsys.h>
#include <build_step.h>
#include <cmd.h>
#include <common.h>
#include <frugal.h>
#include <fsutil.h>
#include <logging.h>
Expand Down
1 change: 1 addition & 0 deletions src/build_step.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#pragma once

#include <stdint.h>
#include <stdlib.h>

typedef int (*build_step_cb_t)(size_t data_count, void** data);
Expand Down
3 changes: 2 additions & 1 deletion src/class/cc.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2024 Aymeric Wibo

#include <common.h>

#include <build_step.h>
#include <class/class.h>
#include <cmd.h>
#include <common.h>
#include <cookie.h>
#include <frugal.h>
#include <fsutil.h>
Expand Down
6 changes: 4 additions & 2 deletions src/class/linker.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2024 Aymeric Wibo

#include <common.h>

#include <build_step.h>
#include <class/class.h>
#include <cmd.h>
#include <common.h>
#include <cookie.h>
#include <frugal.h>
#include <fsutil.h>
Expand All @@ -15,6 +16,7 @@
#include <assert.h>
#include <errno.h>
#include <fts.h>
#include <inttypes.h>
#include <stdio.h>
#include <sys/stat.h>

Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion src/cmd.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2024 Aymeric Wibo

#include <cmd.h>
#include <common.h>

#include <cmd.h>
#include <fsutil.h>
#include <logging.h>
#include <str.h>
Expand Down
1 change: 1 addition & 0 deletions src/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#pragma once

#include <sys/types.h>
#include <unistd.h>

typedef struct {
Expand Down
10 changes: 6 additions & 4 deletions src/cookie.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@

#pragma once

#include <common.h>

#include <str.h>

#include <assert.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <common.h>
#include <str.h>

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/");
Expand Down
1 change: 1 addition & 0 deletions src/fsutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#include <stdlib.h>
#include <sys/types.h>

int rm(char const* path, char** err);
int copy(char const* src, char const* dst, char** err);
Expand Down
2 changes: 2 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2023 Aymeric Wibo

#include <common.h>

#include <bsys.h>
#include <build_step.h>
#include <fsutil.h>
Expand Down

0 comments on commit e85f05f

Please sign in to comment.