Merged from upstream, fixed 'args' name colission

This commit is contained in:
Zachary Pierson
2017-04-06 18:14:42 -05:00
parent c0019cc305
commit 6b33b254e9
4 changed files with 206 additions and 2 deletions
+3 -1
View File
@@ -276,7 +276,9 @@ extern "C" {
// TODO(bill): How many of these headers do I really need?
// #include <stdarg.h>
// #include <stddef.h>
#if !defined(GB_SYSTEM_WINDOWS)
#include <stddef.h>
#endif
+6
View File
@@ -6792,6 +6792,12 @@ void ir_gen_tree(irGen *s) {
} else if (e->kind == Entity_Procedure && e->Procedure.link_name.len > 0) {
// Handle later
} else if (scope->is_init && e->kind == Entity_Procedure && str_eq(name, str_lit("main"))) {
#ifdef GB_SYSTEM_OSX
} else if (str_eq(name, str_lit("args")) && str_eq(e->token.pos.file, get_fullpath_core(heap_allocator(), str_lit("os_x.odin")))) {
#endif
#ifdef GB_SYSTEM_LINUX
} else if (str_eq(name, str_lit("args")) && str_eq(e->token.pos.file, get_fullpath_core(heap_allocator(), str_lit("os_linux.odin")))) {
#endif
} else {
name = ir_mangle_name(s, e->token.pos.file, e);
}