mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-01 04:10:07 +00:00
Fix compilation issues on OSX
This commit is contained in:
+5
-3
@@ -7984,15 +7984,17 @@ gb_inline b32 gb_file_copy(char const *existing_filename, char const *new_filena
|
|||||||
|
|
||||||
gb_inline b32 gb_file_move(char const *existing_filename, char const *new_filename) {
|
gb_inline b32 gb_file_move(char const *existing_filename, char const *new_filename) {
|
||||||
if (link(existing_filename, new_filename) == 0) {
|
if (link(existing_filename, new_filename) == 0) {
|
||||||
if (unlink(existing_filename) != -1) {
|
return unlink(existing_filename) != -1;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
b32 gb_file_remove(char const *filename) {
|
b32 gb_file_remove(char const *filename) {
|
||||||
|
#if defined(GB_SYSTEM_OSX)
|
||||||
|
return unlink(existing_filename) != -1;
|
||||||
|
#else
|
||||||
return remove(filename) == 0;
|
return remove(filename) == 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3603,7 +3603,7 @@ String ir_mangle_name(irGen *s, String path, Entity *e) {
|
|||||||
cast(char *)new_name, max_len,
|
cast(char *)new_name, max_len,
|
||||||
"_%.*s-%u.%.*s",
|
"_%.*s-%u.%.*s",
|
||||||
cast(int)base_len, base,
|
cast(int)base_len, base,
|
||||||
file->id,
|
cast(u32)file->id,
|
||||||
LIT(name));
|
LIT(name));
|
||||||
} else {
|
} else {
|
||||||
new_name_len = gb_snprintf(
|
new_name_len = gb_snprintf(
|
||||||
|
|||||||
+1
-1
@@ -4759,7 +4759,7 @@ ParseFileError init_ast_file(AstFile *f, String fullpath) {
|
|||||||
TokenizerInitError err = init_tokenizer(&f->tokenizer, fullpath);
|
TokenizerInitError err = init_tokenizer(&f->tokenizer, fullpath);
|
||||||
if (err == TokenizerInit_None) {
|
if (err == TokenizerInit_None) {
|
||||||
isize file_size = f->tokenizer.end - f->tokenizer.start;
|
isize file_size = f->tokenizer.end - f->tokenizer.start;
|
||||||
isize init_token_cap = gb_max(next_pow2(file_size/2), 16);
|
isize init_token_cap = cast(isize)gb_max(next_pow2(cast(i64)(file_size/2ll)), 16);
|
||||||
array_init(&f->tokens, heap_allocator(), gb_max(init_token_cap, 16));
|
array_init(&f->tokens, heap_allocator(), gb_max(init_token_cap, 16));
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|||||||
Reference in New Issue
Block a user