Skip to content

Commit

Permalink
cgen: fix wrong type of vint_t and const riscv64 (#22251)
Browse files Browse the repository at this point in the history
  • Loading branch information
mengzhuo committed Sep 18, 2024
1 parent 65504ae commit 263ba23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/gen/c/cheaders.v
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ static void* g_live_info = NULL;

const c_builtin_types = '
//================================== builtin types ================================*/
#if defined(__x86_64__) || defined(_M_AMD64) || defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)
#if defined(__x86_64__) || defined(_M_AMD64) || defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) || (defined(__riscv_xlen) && __riscv_xlen == 64)
typedef int64_t vint_t;
#else
typedef int32_t vint_t;
Expand Down
3 changes: 3 additions & 0 deletions vlib/v/gen/c/comptime.v
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,9 @@ fn (mut g Gen) comptime_if_to_ifdef(name string, is_comptime_option bool) !strin
'i386' {
return '__V_x86'
}
'rv64', 'riscv64' {
return '__V_rv64'
}
// bitness:
'x64' {
return 'TARGET_IS_64BIT'
Expand Down

0 comments on commit 263ba23

Please sign in to comment.