From dc767da12b0e03a6cd9ff20085565c95c06ef7bc Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Thu, 5 Sep 2024 21:17:40 +0200 Subject: [PATCH 01/13] Make tags use #+ syntax instead of //+ syntax so it no longer looks like a comment. Old style still works but is deprecated with a warning. Using unknown tags is now an error instead of a warning. There is a new token for #+ which consumes the whole line (or until it hits a comment). The tags are parsed like before. There are errors to tell you if you use something invalid in the pre-package-line block. --- src/parser.cpp | 155 ++++++++++++++++++++++++++++++++-------------- src/tokenizer.cpp | 15 +++++ 2 files changed, 123 insertions(+), 47 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index e3143dd33..03ed725c5 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -5337,6 +5337,12 @@ gb_internal Ast *parse_stmt(AstFile *f) { s = ast_empty_stmt(f, token); expect_semicolon(f); return s; + + case Token_FileTag: + // This is always an error because all valid file tags will have been processed in `parse_file` already. + // Any remaining file tags must be past the package line and thus invalid. + syntax_error(token, "Lines starting with #+ (file tags) are only allowed before the package line."); + return ast_bad_stmt(f, token, f->curr_token); } // Error correction statements @@ -6091,7 +6097,7 @@ gb_internal String build_tag_get_token(String s, String *out) { } gb_internal bool parse_build_tag(Token token_for_pos, String s) { - String const prefix = str_lit("+build"); + String const prefix = str_lit("build"); GB_ASSERT(string_starts_with(s, prefix)); s = string_trim_whitespace(substring(s, prefix.len, s.len)); @@ -6176,7 +6182,7 @@ gb_internal String vet_tag_get_token(String s, String *out) { gb_internal u64 parse_vet_tag(Token token_for_pos, String s) { - String const prefix = str_lit("+vet"); + String const prefix = str_lit("vet"); GB_ASSERT(string_starts_with(s, prefix)); s = string_trim_whitespace(substring(s, prefix.len, s.len)); @@ -6281,7 +6287,7 @@ gb_internal isize calc_decl_count(Ast *decl) { } gb_internal bool parse_build_project_directory_tag(Token token_for_pos, String s) { - String const prefix = str_lit("+build-project-name"); + String const prefix = str_lit("build-project-name"); GB_ASSERT(string_starts_with(s, prefix)); s = string_trim_whitespace(substring(s, prefix.len, s.len)); if (s.len == 0) { @@ -6325,6 +6331,48 @@ gb_internal bool parse_build_project_directory_tag(Token token_for_pos, String s return any_correct; } +gb_internal bool process_file_tag(const String &lc, const Token &tok, AstFile *f) { + if (string_starts_with(lc, str_lit("build-project-name"))) { + if (!parse_build_project_directory_tag(tok, lc)) { + return false; + } + } else if (string_starts_with(lc, str_lit("build"))) { + if (!parse_build_tag(tok, lc)) { + return false; + } + } else if (string_starts_with(lc, str_lit("vet"))) { + f->vet_flags = parse_vet_tag(tok, lc); + f->vet_flags_set = true; + } else if (string_starts_with(lc, str_lit("ignore"))) { + return false; + } else if (string_starts_with(lc, str_lit("private"))) { + f->flags |= AstFile_IsPrivatePkg; + String command = string_trim_starts_with(lc, str_lit("private ")); + command = string_trim_whitespace(command); + if (lc == "private") { + f->flags |= AstFile_IsPrivatePkg; + } else if (command == "package") { + f->flags |= AstFile_IsPrivatePkg; + } else if (command == "file") { + f->flags |= AstFile_IsPrivateFile; + } + } else if (lc == "lazy") { + if (build_context.ignore_lazy) { + // Ignore + } else if (f->pkg->kind == Package_Init && build_context.command_kind == Command_doc) { + // Ignore + } else { + f->flags |= AstFile_IsLazy; + } + } else if (lc == "no-instrumentation") { + f->flags |= AstFile_NoInstrumentation; + } else { + error(tok, "Unknown tag '%.*s'", LIT(lc)); + } + + return true; +} + gb_internal bool parse_file(Parser *p, AstFile *f) { if (f->tokens.count == 0) { return true; @@ -6337,15 +6385,38 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { String filepath = f->tokenizer.fullpath; String base_dir = dir_from_path(filepath); - if (f->curr_token.kind == Token_Comment) { - consume_comment_groups(f, f->prev_token); + + Array tags = array_make(ast_allocator(f)); + + bool has_first_invalid_pre_package_token = false; + Token first_invalid_pre_package_token; + + while (f->curr_token.kind != Token_package && f->curr_token.kind != Token_EOF) { + if (f->curr_token.kind == Token_Comment) { + consume_comment_groups(f, f->prev_token); + } else if (f->curr_token.kind == Token_FileTag) { + array_add(&tags, f->curr_token); + advance_token(f); + } else { + if (!has_first_invalid_pre_package_token) { + has_first_invalid_pre_package_token = true; + first_invalid_pre_package_token = f->curr_token; + } + + advance_token(f); + } } CommentGroup *docs = f->lead_comment; if (f->curr_token.kind != Token_package) { ERROR_BLOCK(); - syntax_error(f->curr_token, "Expected a package declaration at the beginning of the file"); + + // The while loop above scanned until it found the package token. If we never + // found one, then make this error appear on the first invalid token line. + Token t = has_first_invalid_pre_package_token ? first_invalid_pre_package_token : f->curr_token; + syntax_error(t, "Expected a package declaration at the beginning of the file"); + // IMPORTANT NOTE(bill): this is technically a race condition with the suggestion, but it's ony a suggession // so in practice is should be "fine" if (f->pkg && f->pkg->name != "") { @@ -6354,6 +6425,12 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { return false; } + // There was an OK package declaration. But there some invalid token was hit before the package declaration. + if (has_first_invalid_pre_package_token) { + syntax_error(first_invalid_pre_package_token, "There can only be lines starting with #+ or // before package declaration"); + return false; + } + f->package_token = expect_token(f, Token_package); if (f->package_token.kind != Token_package) { return false; @@ -6379,55 +6456,39 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { } f->package_name = package_name.string; - if (!f->pkg->is_single_file && docs != nullptr && docs->list.count > 0) { - for (Token const &tok : docs->list) { - GB_ASSERT(tok.kind == Token_Comment); - String str = tok.string; - if (string_starts_with(str, str_lit("//"))) { - String lc = string_trim_whitespace(substring(str, 2, str.len)); - if (lc.len > 0 && lc[0] == '+') { - if (string_starts_with(lc, str_lit("+build-project-name"))) { - if (!parse_build_project_directory_tag(tok, lc)) { + if (!f->pkg->is_single_file) { + if (docs != nullptr && docs->list.count > 0) { + for (Token const &tok : docs->list) { + GB_ASSERT(tok.kind == Token_Comment); + String str = tok.string; + if (string_starts_with(str, str_lit("//"))) { + String lc = string_trim_whitespace(substring(str, 2, str.len)); + if (string_starts_with(lc, str_lit("+"))) { + syntax_warning(tok, "//+ is deprecated: Use #+ instead"); + String lt = substring(lc, 1, lc.len); + if (process_file_tag(lt, tok, f) == false) { return false; } - } else if (string_starts_with(lc, str_lit("+build"))) { - if (!parse_build_tag(tok, lc)) { - return false; - } - } else if (string_starts_with(lc, str_lit("+vet"))) { - f->vet_flags = parse_vet_tag(tok, lc); - f->vet_flags_set = true; - } else if (string_starts_with(lc, str_lit("+ignore"))) { - return false; - } else if (string_starts_with(lc, str_lit("+private"))) { - f->flags |= AstFile_IsPrivatePkg; - String command = string_trim_starts_with(lc, str_lit("+private ")); - command = string_trim_whitespace(command); - if (lc == "+private") { - f->flags |= AstFile_IsPrivatePkg; - } else if (command == "package") { - f->flags |= AstFile_IsPrivatePkg; - } else if (command == "file") { - f->flags |= AstFile_IsPrivateFile; - } - } else if (lc == "+lazy") { - if (build_context.ignore_lazy) { - // Ignore - } else if (f->pkg->kind == Package_Init && build_context.command_kind == Command_doc) { - // Ignore - } else { - f->flags |= AstFile_IsLazy; - } - } else if (lc == "+no-instrumentation") { - f->flags |= AstFile_NoInstrumentation; - } else { - warning(tok, "Ignoring unknown tag '%.*s'", LIT(lc)); } } } } + + for (Token const &tok : tags) { + GB_ASSERT(tok.kind == Token_FileTag); + String str = tok.string; + + if (string_starts_with(str, str_lit("#+"))) { + String lt = string_trim_whitespace(substring(str, 2, str.len)); + if (process_file_tag(lt, tok, f) == false) { + return false; + } + } + } } + array_free(&tags); + Ast *pd = ast_package_decl(f, f->package_token, package_name, docs, f->line_comment); expect_semicolon(f); f->pkg_decl = pd; diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 4425bee29..e9bad390e 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -2,6 +2,7 @@ TOKEN_KIND(Token_Invalid, "Invalid"), \ TOKEN_KIND(Token_EOF, "EOF"), \ TOKEN_KIND(Token_Comment, "Comment"), \ + TOKEN_KIND(Token_FileTag, "FileTag"), \ \ TOKEN_KIND(Token__LiteralBegin, ""), \ TOKEN_KIND(Token_Ident, "identifier"), \ @@ -939,6 +940,20 @@ gb_internal void tokenizer_get_token(Tokenizer *t, Token *token, int repeat=0) { if (t->curr_rune == '!') { token->kind = Token_Comment; tokenizer_skip_line(t); + } else if (t->curr_rune == '+') { + token->kind = Token_FileTag; + + // Skip the line or until it ends or until we hit was is probably a comment. + // The parsing of tags happens in `parse_file`. + while (t->curr_rune != GB_RUNE_EOF) { + if (t->curr_rune == '\n') { + break; + } + if (t->curr_rune == '/') { + break; + } + advance_to_next_rune(t); + } } break; case '/': From 73e495434666b230e16ea7300c957ddc978e3e1a Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Sun, 8 Sep 2024 02:52:43 +0200 Subject: [PATCH 02/13] Better #+build tag error messages: Error when using more than one !notted operating system per build line. Error when using more than one operating system within a 'kind', such as writing #+build windows linux. --- src/parser.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index 03ed725c5..7f2fa9b70 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -6106,9 +6106,12 @@ gb_internal bool parse_build_tag(Token token_for_pos, String s) { } bool any_correct = false; + bool any_notted_os_seen = false; + bool any_os_seen = false; while (s.len > 0) { bool this_kind_correct = true; + bool this_kind_os_seen = false; do { String p = string_trim_whitespace(build_tag_get_token(s, &s)); @@ -6133,12 +6136,30 @@ gb_internal bool parse_build_tag(Token token_for_pos, String s) { continue; } + TargetOsKind os = get_target_os_from_string(p); TargetArchKind arch = get_target_arch_from_string(p); if (os != TargetOs_Invalid) { + // Catches cases where you have multiple !notted operating systems on a line. This never does what you think since + // you need a new build line to get a logical AND. + if (any_notted_os_seen && is_notted) { + syntax_error(token_for_pos, "Invalid build tag: Use a separate '#+build' line for each platform that has '!' in front."); + break; + } + + // Catches 'windows linux', which is an impossible combination. + if (this_kind_os_seen) { + syntax_error(token_for_pos, "Invalid build tag: Missing ',' before '%.*s'. Format: '#+build linux, windows, darwin' or '#+build linux amd64, darwin, windows i386'", LIT(p)); + break; + } + + this_kind_os_seen = true; + any_os_seen = true; + GB_ASSERT(arch == TargetArch_Invalid); if (is_notted) { this_kind_correct = this_kind_correct && (os != build_context.metrics.os); + any_notted_os_seen = true; } else { this_kind_correct = this_kind_correct && (os == build_context.metrics.os); } @@ -6427,7 +6448,7 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { // There was an OK package declaration. But there some invalid token was hit before the package declaration. if (has_first_invalid_pre_package_token) { - syntax_error(first_invalid_pre_package_token, "There can only be lines starting with #+ or // before package declaration"); + syntax_error(first_invalid_pre_package_token, "There can only be lines starting with '#+' or '//' before package declaration"); return false; } @@ -6464,7 +6485,7 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { if (string_starts_with(str, str_lit("//"))) { String lc = string_trim_whitespace(substring(str, 2, str.len)); if (string_starts_with(lc, str_lit("+"))) { - syntax_warning(tok, "//+ is deprecated: Use #+ instead"); + syntax_warning(tok, "'//+' is deprecated: Use '#+' instead"); String lt = substring(lc, 1, lc.len); if (process_file_tag(lt, tok, f) == false) { return false; From 3637dcbd04d328a110f0626171f2d49f7a96b09b Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Mon, 9 Sep 2024 21:03:23 +0200 Subject: [PATCH 03/13] Simplified error messages in parse_build_tag, removed the idea of making multiple notted operating systems since it was misinformed. --- src/parser.cpp | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index 7f2fa9b70..2df876d73 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -6106,12 +6106,13 @@ gb_internal bool parse_build_tag(Token token_for_pos, String s) { } bool any_correct = false; - bool any_notted_os_seen = false; - bool any_os_seen = false; while (s.len > 0) { bool this_kind_correct = true; + bool this_kind_os_seen = false; + bool this_kind_arch_seen = false; + int num_tokens = 0; do { String p = string_trim_whitespace(build_tag_get_token(s, &s)); @@ -6136,34 +6137,29 @@ gb_internal bool parse_build_tag(Token token_for_pos, String s) { continue; } - TargetOsKind os = get_target_os_from_string(p); TargetArchKind arch = get_target_arch_from_string(p); + num_tokens += 1; + + // Catches 'windows linux', which is an impossible combination. + // Also catches usage of more than two things within a comma separated group. + if (num_tokens > 2 || (this_kind_os_seen && os != TargetOs_Invalid) || (this_kind_arch_seen && arch != TargetArch_Invalid)) { + syntax_error(token_for_pos, "Invalid build tag: Missing ',' before '%.*s'. Format: '#+build linux, windows amd64, darwin'", LIT(p)); + break; + } + if (os != TargetOs_Invalid) { - // Catches cases where you have multiple !notted operating systems on a line. This never does what you think since - // you need a new build line to get a logical AND. - if (any_notted_os_seen && is_notted) { - syntax_error(token_for_pos, "Invalid build tag: Use a separate '#+build' line for each platform that has '!' in front."); - break; - } - - // Catches 'windows linux', which is an impossible combination. - if (this_kind_os_seen) { - syntax_error(token_for_pos, "Invalid build tag: Missing ',' before '%.*s'. Format: '#+build linux, windows, darwin' or '#+build linux amd64, darwin, windows i386'", LIT(p)); - break; - } - this_kind_os_seen = true; - any_os_seen = true; GB_ASSERT(arch == TargetArch_Invalid); if (is_notted) { this_kind_correct = this_kind_correct && (os != build_context.metrics.os); - any_notted_os_seen = true; } else { this_kind_correct = this_kind_correct && (os == build_context.metrics.os); } } else if (arch != TargetArch_Invalid) { + this_kind_arch_seen = true; + if (is_notted) { this_kind_correct = this_kind_correct && (arch != build_context.metrics.arch); } else { From 957cd64699f1f8f1d1f689025c708aebc3c32476 Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Mon, 9 Sep 2024 21:06:43 +0200 Subject: [PATCH 04/13] Rename process_file_tag -> parse_file_tag --- src/parser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index 2df876d73..3634da7fa 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -6348,7 +6348,7 @@ gb_internal bool parse_build_project_directory_tag(Token token_for_pos, String s return any_correct; } -gb_internal bool process_file_tag(const String &lc, const Token &tok, AstFile *f) { +gb_internal bool parse_file_tag(const String &lc, const Token &tok, AstFile *f) { if (string_starts_with(lc, str_lit("build-project-name"))) { if (!parse_build_project_directory_tag(tok, lc)) { return false; @@ -6483,7 +6483,7 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { if (string_starts_with(lc, str_lit("+"))) { syntax_warning(tok, "'//+' is deprecated: Use '#+' instead"); String lt = substring(lc, 1, lc.len); - if (process_file_tag(lt, tok, f) == false) { + if (parse_file_tag(lt, tok, f) == false) { return false; } } @@ -6497,7 +6497,7 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { if (string_starts_with(str, str_lit("#+"))) { String lt = string_trim_whitespace(substring(str, 2, str.len)); - if (process_file_tag(lt, tok, f) == false) { + if (parse_file_tag(lt, tok, f) == false) { return false; } } From cc724ff5d2ecc358f36c6c0ed3a25db6373ac95c Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Mon, 9 Sep 2024 21:13:39 +0200 Subject: [PATCH 05/13] Made error handling code in parse_file clearer. --- src/parser.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index 3634da7fa..aaaf02cee 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -6405,8 +6405,8 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { Array tags = array_make(ast_allocator(f)); - bool has_first_invalid_pre_package_token = false; - Token first_invalid_pre_package_token; + bool first_invalid_token_set = false; + Token first_invalid_token = {}; while (f->curr_token.kind != Token_package && f->curr_token.kind != Token_EOF) { if (f->curr_token.kind == Token_Comment) { @@ -6415,9 +6415,9 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { array_add(&tags, f->curr_token); advance_token(f); } else { - if (!has_first_invalid_pre_package_token) { - has_first_invalid_pre_package_token = true; - first_invalid_pre_package_token = f->curr_token; + if (!first_invalid_token_set) { + first_invalid_token_set = true; + first_invalid_token = f->curr_token; } advance_token(f); @@ -6431,7 +6431,7 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { // The while loop above scanned until it found the package token. If we never // found one, then make this error appear on the first invalid token line. - Token t = has_first_invalid_pre_package_token ? first_invalid_pre_package_token : f->curr_token; + Token t = first_invalid_token_set ? first_invalid_token : f->curr_token; syntax_error(t, "Expected a package declaration at the beginning of the file"); // IMPORTANT NOTE(bill): this is technically a race condition with the suggestion, but it's ony a suggession @@ -6443,8 +6443,8 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { } // There was an OK package declaration. But there some invalid token was hit before the package declaration. - if (has_first_invalid_pre_package_token) { - syntax_error(first_invalid_pre_package_token, "There can only be lines starting with '#+' or '//' before package declaration"); + if (first_invalid_token_set) { + syntax_error(first_invalid_token, "There can only be lines starting with '#+' or '//' before package declaration"); return false; } @@ -6481,7 +6481,7 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { if (string_starts_with(str, str_lit("//"))) { String lc = string_trim_whitespace(substring(str, 2, str.len)); if (string_starts_with(lc, str_lit("+"))) { - syntax_warning(tok, "'//+' is deprecated: Use '#+' instead"); + //syntax_warning(tok, "'//+' is deprecated: Use '#+' instead"); String lt = substring(lc, 1, lc.len); if (parse_file_tag(lt, tok, f) == false) { return false; From 580f0599cde713f5e1c7495174821abe6dc4a2a1 Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Mon, 9 Sep 2024 21:24:41 +0200 Subject: [PATCH 06/13] parse_file: Removed some nesting and removed probable incorrect safety check. --- src/parser.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index aaaf02cee..c2a9ff138 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -6452,14 +6452,6 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { if (f->package_token.kind != Token_package) { return false; } - if (docs != nullptr) { - TokenPos end = token_pos_end(docs->list[docs->list.count-1]); - if (end.line == f->package_token.pos.line || end.line+1 == f->package_token.pos.line) { - // Okay - } else { - docs = nullptr; - } - } Token package_name = expect_token_after(f, Token_Ident, "package"); if (package_name.kind == Token_Ident) { @@ -6478,14 +6470,17 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { for (Token const &tok : docs->list) { GB_ASSERT(tok.kind == Token_Comment); String str = tok.string; - if (string_starts_with(str, str_lit("//"))) { - String lc = string_trim_whitespace(substring(str, 2, str.len)); - if (string_starts_with(lc, str_lit("+"))) { - //syntax_warning(tok, "'//+' is deprecated: Use '#+' instead"); - String lt = substring(lc, 1, lc.len); - if (parse_file_tag(lt, tok, f) == false) { - return false; - } + + if (!string_starts_with(str, str_lit("//"))) { + continue; + } + + String lc = string_trim_whitespace(substring(str, 2, str.len)); + if (string_starts_with(lc, str_lit("+"))) { + syntax_warning(tok, "'//+' is deprecated: Use '#+' instead"); + String lt = substring(lc, 1, lc.len); + if (parse_file_tag(lt, tok, f) == false) { + return false; } } } From f9de8fdaba12746b9c458e916ba6bb9d7c5b7aa7 Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Mon, 9 Sep 2024 21:51:29 +0200 Subject: [PATCH 07/13] Documentation typo fix in tokenizer. --- src/tokenizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index e9bad390e..53f6135d0 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -943,7 +943,7 @@ gb_internal void tokenizer_get_token(Tokenizer *t, Token *token, int repeat=0) { } else if (t->curr_rune == '+') { token->kind = Token_FileTag; - // Skip the line or until it ends or until we hit was is probably a comment. + // Skip until end of line or until we hit what is probably a comment. // The parsing of tags happens in `parse_file`. while (t->curr_rune != GB_RUNE_EOF) { if (t->curr_rune == '\n') { From 8b84b9a4a26d7f2fb07a7e5dcd49b678d1c9be91 Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Sat, 14 Sep 2024 14:32:46 +0200 Subject: [PATCH 08/13] Docs are generated as expected again. --- src/parser.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index 51da21e9d..523dad8b8 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -6388,9 +6388,13 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { String filepath = f->tokenizer.fullpath; String base_dir = dir_from_path(filepath); + if (f->curr_token.kind == Token_Comment) { + consume_comment_groups(f, f->prev_token); + } - Array tags = array_make(ast_allocator(f)); + CommentGroup *docs = f->lead_comment; + Array tags = array_make(temporary_allocator()); bool first_invalid_token_set = false; Token first_invalid_token = {}; @@ -6410,8 +6414,6 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { } } - CommentGroup *docs = f->lead_comment; - if (f->curr_token.kind != Token_package) { ERROR_BLOCK(); @@ -6451,6 +6453,8 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { } f->package_name = package_name.string; + // TODO: Shouldn't single file only matter for build tags? no-instrumentation for example + // should be respected even when in single file mode. if (!f->pkg->is_single_file) { if (docs != nullptr && docs->list.count > 0) { for (Token const &tok : docs->list) { @@ -6485,8 +6489,6 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { } } - array_free(&tags); - Ast *pd = ast_package_decl(f, f->package_token, package_name, docs, f->line_comment); expect_semicolon(f); f->pkg_decl = pd; From c24e18bf1063cd86c200d51d585059f8aa099615 Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Sat, 14 Sep 2024 14:36:33 +0200 Subject: [PATCH 09/13] Fix incorrect syntax error in parse_file --- src/parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.cpp b/src/parser.cpp index 523dad8b8..22d92e87b 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -6432,7 +6432,7 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { // There was an OK package declaration. But there some invalid token was hit before the package declaration. if (first_invalid_token_set) { - syntax_error(first_invalid_token, "There can only be lines starting with '#+' or '//' before package declaration"); + syntax_error(first_invalid_token, "Expected only comments or lines starting with '#+' before the package declaration"); return false; } From b12d3124085058bc36f2e8feb5666a0c1f162343 Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Sat, 14 Sep 2024 17:59:50 +0200 Subject: [PATCH 10/13] core/odin: Added new file tag syntax as token. parse_file stores a list of tags that the file tag parser can use later. --- core/odin/ast/ast.odin | 1 + core/odin/parser/file_tags.odin | 39 ++++++++++++++++++++++-------- core/odin/parser/parse_files.odin | 4 +-- core/odin/parser/parser.odin | 31 +++++++++++++++++++++--- core/odin/tokenizer/token.odin | 2 ++ core/odin/tokenizer/tokenizer.odin | 20 +++++++++++++++ 6 files changed, 81 insertions(+), 16 deletions(-) diff --git a/core/odin/ast/ast.odin b/core/odin/ast/ast.odin index 9088da0ea..d67eb31f3 100644 --- a/core/odin/ast/ast.odin +++ b/core/odin/ast/ast.odin @@ -69,6 +69,7 @@ File :: struct { fullpath: string, src: string, + tags: [dynamic]tokenizer.Token, docs: ^Comment_Group, pkg_decl: ^Package_Decl, diff --git a/core/odin/parser/file_tags.odin b/core/odin/parser/file_tags.odin index b12c3b5fd..e2a07f8fb 100644 --- a/core/odin/parser/file_tags.odin +++ b/core/odin/parser/file_tags.odin @@ -51,7 +51,7 @@ get_build_arch_from_string :: proc(str: string) -> runtime.Odin_Arch_Type { parse_file_tags :: proc(file: ast.File, allocator := context.allocator) -> (tags: File_Tags) { context.allocator = allocator - if file.docs == nil { + if file.docs == nil && file.tags == nil { return } @@ -95,11 +95,9 @@ parse_file_tags :: proc(file: ast.File, allocator := context.allocator) -> (tags build_project_names: [dynamic][]string defer shrink(&build_project_names) - for comment in file.docs.list { - if len(comment.text) < 3 || comment.text[:2] != "//" { - continue - } - text := comment.text[2:] + parse_tag :: proc(text: string, tags: ^File_Tags, build_kinds: ^[dynamic]Build_Kind, + build_project_name_strings: ^[dynamic]string, + build_project_names: ^[dynamic][]string) { i := 0 skip_whitespace(text, &i) @@ -124,7 +122,7 @@ parse_file_tags :: proc(file: ast.File, allocator := context.allocator) -> (tags groups_loop: for { index_start := len(build_project_name_strings) - defer append(&build_project_names, build_project_name_strings[index_start:]) + defer append(build_project_names, build_project_name_strings[index_start:]) for { skip_whitespace(text, &i) @@ -143,10 +141,10 @@ parse_file_tags :: proc(file: ast.File, allocator := context.allocator) -> (tags } scan_value(text, &i) - append(&build_project_name_strings, text[name_start:i]) + append(build_project_name_strings, text[name_start:i]) } - append(&build_project_names, build_project_name_strings[index_start:]) + append(build_project_names, build_project_name_strings[index_start:]) } case "build": kinds_loop: for { @@ -156,7 +154,7 @@ parse_file_tags :: proc(file: ast.File, allocator := context.allocator) -> (tags arch_positive: runtime.Odin_Arch_Types arch_negative: runtime.Odin_Arch_Types - defer append(&build_kinds, Build_Kind{ + defer append(build_kinds, Build_Kind{ os = (os_positive == {} ? runtime.ALL_ODIN_OS_TYPES : os_positive) -os_negative, arch = (arch_positive == {} ? runtime.ALL_ODIN_ARCH_TYPES : arch_positive)-arch_negative, }) @@ -200,6 +198,27 @@ parse_file_tags :: proc(file: ast.File, allocator := context.allocator) -> (tags } } + if file.docs != nil { + for comment in file.docs.list { + if len(comment.text) < 3 || comment.text[:2] != "//" { + continue + } + text := comment.text[2:] + + parse_tag(text, &tags, &build_kinds, &build_project_name_strings, &build_project_names) + } + } + + for tag in file.tags { + if len(tag.text) < 3 || tag.text[:2] != "#+" { + continue + } + // Only skip # because parse_tag skips the plus + text := tag.text[1:] + + parse_tag(text, &tags, &build_kinds, &build_project_name_strings, &build_project_names) + } + tags.build = build_kinds[:] tags.build_project_name = build_project_names[:] diff --git a/core/odin/parser/parse_files.odin b/core/odin/parser/parse_files.odin index 5f455c749..d4e532ec7 100644 --- a/core/odin/parser/parse_files.odin +++ b/core/odin/parser/parse_files.odin @@ -77,9 +77,7 @@ parse_package :: proc(pkg: ^ast.Package, p: ^Parser = nil) -> bool { if !parse_file(p, file) { ok = false } - if file.pkg_decl == nil { - error(p, p.curr_tok.pos, "Expected a package declaration at the start of the file") - } else if pkg.name == "" { + if pkg.name == "" { pkg.name = file.pkg_decl.name } else if pkg.name != file.pkg_decl.name { error(p, file.pkg_decl.pos, "different package name, expected '%s', got '%s'", pkg.name, file.pkg_decl.name) diff --git a/core/odin/parser/parser.odin b/core/odin/parser/parser.odin index aab59c29d..9dfca40b5 100644 --- a/core/odin/parser/parser.odin +++ b/core/odin/parser/parser.odin @@ -161,11 +161,36 @@ parse_file :: proc(p: ^Parser, file: ^ast.File) -> bool { docs := p.lead_comment - p.file.pkg_token = expect_token(p, .Package) - if p.file.pkg_token.kind != .Package { - return false + invalid_pre_package_token: Maybe(tokenizer.Token) + + for p.curr_tok.kind != .Package && p.curr_tok.kind != .EOF { + if p.curr_tok.kind == .Comment { + consume_comment_groups(p, p.prev_tok) + } else if p.curr_tok.kind == .File_Tag { + append(&p.file.tags, p.curr_tok) + advance_token(p) + } else { + if invalid_pre_package_token == nil { + invalid_pre_package_token = p.curr_tok + } + + advance_token(p) + } } + if p.curr_tok.kind != .Package { + t := invalid_pre_package_token.? or_else p.curr_tok + error(p, t.pos, "Expected a package declaration at the start of the file") + return false + } + + p.file.pkg_token = expect_token(p, .Package) + + if ippt, ok := invalid_pre_package_token.?; ok { + error(p, ippt.pos, "Expected only comments or lines starting with '#+' before the package declaration") + return false + } + pkg_name := expect_token_after(p, .Ident, "package") if pkg_name.kind == .Ident { switch name := pkg_name.text; { diff --git a/core/odin/tokenizer/token.odin b/core/odin/tokenizer/token.odin index cd8953841..48d08f127 100644 --- a/core/odin/tokenizer/token.odin +++ b/core/odin/tokenizer/token.odin @@ -32,6 +32,7 @@ Token_Kind :: enum u32 { Invalid, EOF, Comment, + File_Tag, B_Literal_Begin, Ident, // main @@ -166,6 +167,7 @@ tokens := [Token_Kind.COUNT]string { "Invalid", "EOF", "Comment", + "FileTag", "", "identifier", diff --git a/core/odin/tokenizer/tokenizer.odin b/core/odin/tokenizer/tokenizer.odin index 62170aa10..c3a30581c 100644 --- a/core/odin/tokenizer/tokenizer.odin +++ b/core/odin/tokenizer/tokenizer.odin @@ -206,6 +206,23 @@ scan_comment :: proc(t: ^Tokenizer) -> string { return string(lit) } +scan_file_tag :: proc(t: ^Tokenizer) -> string { + offset := t.offset - 1 + + for t.ch != '\n' { + if t.ch == '/' { + next := peek_byte(t, 0) + + if next == '/' || next == '*' { + break + } + } + advance_rune(t) + } + + return string(t.src[offset : t.offset]) +} + scan_identifier :: proc(t: ^Tokenizer) -> string { offset := t.offset @@ -636,6 +653,9 @@ scan :: proc(t: ^Tokenizer) -> Token { if t.ch == '!' { kind = .Comment lit = scan_comment(t) + } else if t.ch == '+' { + kind = .File_Tag + lit = scan_file_tag(t) } case '/': kind = .Quo From 19f0127e553940bb333f61ab7e8dab6f7455115e Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Sat, 14 Sep 2024 18:27:49 +0200 Subject: [PATCH 11/13] Moved all packages in core, base, vendor, tests and examples to use new #+ file tag syntax. --- base/intrinsics/intrinsics.odin | 2 +- base/runtime/core.odin | 2 +- base/runtime/entry_unix.odin | 6 ++--- base/runtime/entry_wasm.odin | 6 ++--- base/runtime/entry_windows.odin | 6 ++--- base/runtime/heap_allocator_orca.odin | 4 ++-- base/runtime/heap_allocator_other.odin | 4 ++-- base/runtime/heap_allocator_unix.odin | 4 ++-- base/runtime/internal.odin | 2 +- base/runtime/os_specific_bsd.odin | 4 ++-- base/runtime/os_specific_darwin.odin | 4 ++-- base/runtime/os_specific_freestanding.odin | 4 ++-- base/runtime/os_specific_haiku.odin | 4 ++-- base/runtime/os_specific_js.odin | 4 ++-- base/runtime/os_specific_linux.odin | 2 +- base/runtime/os_specific_orca.odin | 4 ++-- base/runtime/os_specific_wasi.odin | 4 ++-- base/runtime/os_specific_windows.odin | 4 ++-- base/runtime/procs_darwin.odin | 2 +- base/runtime/procs_js.odin | 2 +- base/runtime/procs_wasm.odin | 2 +- base/runtime/procs_windows_amd64.odin | 4 ++-- base/runtime/procs_windows_i386.odin | 4 ++-- base/runtime/wasm_allocator.odin | 2 +- core/compress/zlib/zlib.odin | 2 +- core/crypto/_aes/hw_intel/api.odin | 2 +- core/crypto/_aes/hw_intel/ghash.odin | 2 +- .../_aes/hw_intel/hw_intel_keysched.odin | 2 +- .../_chacha20/simd256/chacha20_simd256.odin | 2 +- .../simd256/chacha20_simd256_stub.odin | 2 +- core/crypto/aes/aes_ctr_hw_intel.odin | 2 +- core/crypto/aes/aes_ecb_hw_intel.odin | 2 +- core/crypto/aes/aes_gcm_hw_intel.odin | 2 +- core/crypto/aes/aes_impl_hw_gen.odin | 2 +- core/crypto/aes/aes_impl_hw_intel.odin | 2 +- core/crypto/rand_bsd.odin | 2 +- core/crypto/rand_generic.odin | 14 ++++++------ core/debug/trace/trace_cpp.odin | 4 ++-- core/debug/trace/trace_nil.odin | 6 ++--- core/debug/trace/trace_windows.odin | 4 ++-- core/dynlib/lib_js.odin | 4 ++-- core/dynlib/lib_unix.odin | 4 ++-- core/dynlib/lib_windows.odin | 4 ++-- core/flags/errors_bsd.odin | 2 +- core/flags/errors_nonbsd.odin | 4 ++-- core/flags/internal_assignment.odin | 2 +- core/flags/internal_parsing.odin | 2 +- core/flags/internal_rtti.odin | 2 +- core/flags/internal_rtti_nonbsd.odin | 6 ++--- core/flags/internal_validation.odin | 2 +- core/fmt/example.odin | 2 +- core/fmt/fmt_js.odin | 2 +- core/fmt/fmt_os.odin | 6 ++--- core/image/bmp/bmp_js.odin | 2 +- core/image/bmp/bmp_os.odin | 2 +- core/image/general_js.odin | 2 +- core/image/general_os.odin | 2 +- core/image/netpbm/netpbm.odin | 2 +- core/image/netpbm/netpbm_js.odin | 2 +- core/image/netpbm/netpbm_os.odin | 2 +- core/image/png/png.odin | 2 +- core/image/png/png_js.odin | 2 +- core/image/png/png_os.odin | 2 +- core/image/qoi/qoi_js.odin | 2 +- core/image/qoi/qoi_os.odin | 2 +- core/image/tga/tga_js.odin | 2 +- core/image/tga/tga_os.odin | 2 +- core/log/file_console_logger.odin | 4 ++-- core/math/big/tune.odin | 2 +- core/math/math_basic.odin | 2 +- core/math/math_basic_js.odin | 2 +- core/math/noise/internal.odin | 2 +- core/mem/mutex_allocator.odin | 2 +- core/mem/tracking_allocator.odin | 2 +- core/mem/virtual/virtual_linux.odin | 4 ++-- core/mem/virtual/virtual_other.odin | 14 ++++++------ core/mem/virtual/virtual_platform.odin | 2 +- core/mem/virtual/virtual_posix.odin | 4 ++-- core/mem/virtual/virtual_windows.odin | 4 ++-- core/net/addr.odin | 2 +- core/net/common.odin | 2 +- core/net/dns.odin | 2 +- core/net/dns_unix.odin | 2 +- core/net/dns_windows.odin | 2 +- core/net/errors_darwin.odin | 2 +- core/net/errors_freebsd.odin | 2 +- core/net/errors_linux.odin | 2 +- core/net/errors_windows.odin | 2 +- core/net/interface.odin | 2 +- core/net/interface_darwin.odin | 2 +- core/net/interface_freebsd.odin | 2 +- core/net/interface_linux.odin | 2 +- core/net/interface_windows.odin | 2 +- core/net/socket.odin | 2 +- core/net/socket_darwin.odin | 2 +- core/net/socket_freebsd.odin | 2 +- core/net/socket_linux.odin | 2 +- core/net/socket_windows.odin | 2 +- core/os/dir_unix.odin | 2 +- core/os/os2/allocators.odin | 2 +- core/os/os2/dir_linux.odin | 2 +- core/os/os2/dir_posix.odin | 4 ++-- core/os/os2/dir_windows.odin | 2 +- core/os/os2/env_linux.odin | 2 +- core/os/os2/env_posix.odin | 4 ++-- core/os/os2/env_windows.odin | 2 +- core/os/os2/errors_linux.odin | 2 +- core/os/os2/errors_posix.odin | 4 ++-- core/os/os2/errors_windows.odin | 2 +- core/os/os2/file_linux.odin | 2 +- core/os/os2/file_posix.odin | 4 ++-- core/os/os2/file_posix_darwin.odin | 2 +- core/os/os2/file_posix_freebsd.odin | 2 +- core/os/os2/file_posix_netbsd.odin | 2 +- core/os/os2/file_posix_other.odin | 4 ++-- core/os/os2/file_windows.odin | 2 +- core/os/os2/heap_linux.odin | 2 +- core/os/os2/heap_posix.odin | 4 ++-- core/os/os2/heap_windows.odin | 2 +- core/os/os2/internal_util.odin | 2 +- core/os/os2/path_linux.odin | 2 +- core/os/os2/path_posix.odin | 4 ++-- core/os/os2/path_windows.odin | 2 +- core/os/os2/pipe_linux.odin | 2 +- core/os/os2/pipe_posix.odin | 4 ++-- core/os/os2/pipe_windows.odin | 2 +- core/os/os2/process_linux.odin | 4 ++-- core/os/os2/process_posix.odin | 4 ++-- core/os/os2/process_posix_darwin.odin | 2 +- core/os/os2/process_posix_other.odin | 4 ++-- core/os/os2/process_windows.odin | 2 +- core/os/os2/stat_linux.odin | 2 +- core/os/os2/stat_posix.odin | 4 ++-- core/os/os2/stat_windows.odin | 2 +- core/os/os2/temp_file_linux.odin | 2 +- core/os/os2/temp_file_posix.odin | 4 ++-- core/os/os2/temp_file_windows.odin | 2 +- core/os/os_freestanding.odin | 2 +- core/os/os_js.odin | 2 +- core/os/os_windows.odin | 2 +- core/os/stat_unix.odin | 2 +- core/path/filepath/path_unix.odin | 2 +- core/prof/spall/spall_linux.odin | 4 ++-- core/prof/spall/spall_unix.odin | 4 ++-- core/prof/spall/spall_windows.odin | 4 ++-- core/simd/x86/abm.odin | 2 +- core/simd/x86/adx.odin | 2 +- core/simd/x86/aes.odin | 2 +- core/simd/x86/cmpxchg16b.odin | 2 +- core/simd/x86/fxsr.odin | 2 +- core/simd/x86/pclmulqdq.odin | 2 +- core/simd/x86/rdtsc.odin | 2 +- core/simd/x86/sha.odin | 2 +- core/simd/x86/sse.odin | 2 +- core/simd/x86/sse2.odin | 2 +- core/simd/x86/sse3.odin | 2 +- core/simd/x86/sse41.odin | 2 +- core/simd/x86/sse42.odin | 2 +- core/simd/x86/ssse3.odin | 2 +- core/simd/x86/types.odin | 2 +- core/slice/sort_private.odin | 2 +- core/sync/futex_darwin.odin | 4 ++-- core/sync/futex_freebsd.odin | 4 ++-- core/sync/futex_haiku.odin | 2 +- core/sync/futex_linux.odin | 4 ++-- core/sync/futex_netbsd.odin | 2 +- core/sync/futex_openbsd.odin | 4 ++-- core/sync/futex_wasm.odin | 4 ++-- core/sync/futex_windows.odin | 4 ++-- core/sync/primitives_darwin.odin | 4 ++-- core/sync/primitives_freebsd.odin | 4 ++-- core/sync/primitives_haiku.odin | 2 +- core/sync/primitives_internal.odin | 2 +- core/sync/primitives_linux.odin | 4 ++-- core/sync/primitives_netbsd.odin | 2 +- core/sync/primitives_openbsd.odin | 4 ++-- core/sync/primitives_wasm.odin | 4 ++-- core/sync/primitives_windows.odin | 4 ++-- core/sys/darwin/darwin.odin | 2 +- core/sys/haiku/errors.odin | 2 +- core/sys/haiku/find_directory.odin | 2 +- core/sys/haiku/os.odin | 2 +- core/sys/haiku/types.odin | 2 +- core/sys/info/cpu_arm.odin | 2 +- core/sys/info/cpu_intel.odin | 2 +- core/sys/info/cpu_linux_arm.odin | 4 ++-- core/sys/info/cpu_linux_riscv64.odin | 4 ++-- core/sys/info/platform_bsd.odin | 2 +- core/sys/kqueue/kqueue.odin | 2 +- core/sys/linux/helpers.odin | 4 ++-- core/sys/linux/sys.odin | 2 +- core/sys/linux/syscall_amd64.odin | 2 +- core/sys/linux/syscall_arm32.odin | 2 +- core/sys/linux/syscall_arm64.odin | 2 +- core/sys/linux/syscall_i386.odin | 2 +- core/sys/linux/syscall_riscv64.odin | 2 +- core/sys/linux/wrappers.odin | 2 +- core/sys/unix/pthread_darwin.odin | 2 +- core/sys/unix/pthread_freebsd.odin | 2 +- core/sys/unix/pthread_linux.odin | 2 +- core/sys/unix/pthread_openbsd.odin | 2 +- core/sys/unix/pthread_unix.odin | 2 +- core/sys/unix/sysctl_darwin.odin | 2 +- core/sys/unix/sysctl_freebsd.odin | 2 +- core/sys/unix/sysctl_openbsd.odin | 2 +- core/sys/valgrind/callgrind.odin | 2 +- core/sys/valgrind/helgrind.odin | 2 +- core/sys/valgrind/memcheck.odin | 2 +- core/sys/valgrind/valgrind.odin | 2 +- core/sys/wasm/wasi/wasi_api.odin | 2 +- core/sys/windows/advapi32.odin | 2 +- core/sys/windows/bcrypt.odin | 2 +- core/sys/windows/bluetooth.odin | 2 +- core/sys/windows/codepage.odin | 2 +- core/sys/windows/comctl32.odin | 2 +- core/sys/windows/comdlg32.odin | 2 +- core/sys/windows/dbghelp.odin | 2 +- core/sys/windows/dnsapi.odin | 2 +- core/sys/windows/dwmapi.odin | 2 +- core/sys/windows/gdi32.odin | 2 +- core/sys/windows/hidpi.odin | 2 +- core/sys/windows/hidusage.odin | 2 +- core/sys/windows/ip_helper.odin | 2 +- core/sys/windows/kernel32.odin | 2 +- core/sys/windows/key_codes.odin | 2 +- core/sys/windows/known_folders.odin | 2 +- core/sys/windows/netapi32.odin | 2 +- core/sys/windows/ntdll.odin | 2 +- core/sys/windows/shcore.odin | 2 +- core/sys/windows/shell32.odin | 2 +- core/sys/windows/shlwapi.odin | 2 +- core/sys/windows/synchronization.odin | 2 +- core/sys/windows/system_params.odin | 2 +- core/sys/windows/tlhelp.odin | 2 +- core/sys/windows/user32.odin | 2 +- core/sys/windows/userenv.odin | 2 +- core/sys/windows/util.odin | 2 +- core/sys/windows/ux_theme.odin | 2 +- core/sys/windows/wgl.odin | 2 +- core/sys/windows/wglext.odin | 2 +- core/sys/windows/window_messages.odin | 2 +- core/sys/windows/winerror.odin | 2 +- core/sys/windows/winmm.odin | 2 +- core/sys/windows/winnls.odin | 2 +- core/sys/windows/winver.odin | 2 +- core/sys/windows/wow64_apiset.odin | 2 +- core/sys/windows/ws2_32.odin | 2 +- core/testing/events.odin | 2 +- core/testing/logging.odin | 2 +- core/testing/reporting.odin | 2 +- core/testing/runner.odin | 2 +- core/testing/signal_handler.odin | 2 +- core/testing/signal_handler_libc.odin | 4 ++-- core/testing/signal_handler_other.odin | 16 +++++++------- core/thread/thread_other.odin | 2 +- core/thread/thread_unix.odin | 4 ++-- core/thread/thread_windows.odin | 4 ++-- core/time/datetime/internal.odin | 2 +- core/time/time_essence.odin | 2 +- core/time/time_js.odin | 4 ++-- core/time/time_orca.odin | 4 ++-- core/time/time_other.odin | 22 +++++++++---------- core/time/time_unix.odin | 4 ++-- core/time/time_wasi.odin | 4 ++-- core/time/time_windows.odin | 2 +- core/time/tsc_darwin.odin | 2 +- core/time/tsc_freebsd.odin | 4 ++-- core/time/tsc_linux.odin | 4 ++-- examples/all/all_experimental.odin | 2 +- examples/all/all_linux.odin | 2 +- examples/all/all_posix.odin | 2 +- examples/demo/demo.odin | 2 +- tests/core/net/test_core_net.odin | 4 ++-- tests/core/net/test_core_net_freebsd.odin | 2 +- tests/core/odin/test_file_tags.odin | 16 +++++++------- tests/core/sys/posix/posix.odin | 2 +- tests/core/sys/posix/structs.odin | 2 +- tests/core/sys/windows/test_clipboard.odin | 2 +- tests/core/sys/windows/test_kernel32.odin | 2 +- tests/core/sys/windows/test_ole32.odin | 2 +- tests/core/sys/windows/test_user32.odin | 2 +- tests/core/sys/windows/test_windows.odin | 2 +- .../sys/windows/test_windows_generated.odin | 2 +- tests/core/sys/windows/test_winerror.odin | 2 +- tests/vendor/glfw/test_vendor_glfw.odin | 2 +- tests/vendor/lua/5.4/test_vendor_lua.5.4.odin | 2 +- vendor/ENet/unix.odin | 2 +- vendor/ENet/win32.odin | 2 +- vendor/commonmark/doc.odin | 2 +- vendor/directx/dxc/dxcdef_unix.odin | 2 +- vendor/directx/dxc/dxcdef_windows.odin | 2 +- vendor/egl/egl.odin | 2 +- vendor/fontstash/fontstash.odin | 2 +- vendor/fontstash/fontstash_os.odin | 2 +- vendor/fontstash/fontstash_other.odin | 2 +- vendor/glfw/native_darwin.odin | 2 +- vendor/glfw/native_linux.odin | 2 +- vendor/glfw/native_windows.odin | 2 +- vendor/miniaudio/common_unix.odin | 2 +- vendor/nanovg/gl/gl.odin | 2 +- vendor/nanovg/nanovg.odin | 2 +- vendor/stb/truetype/stb_truetype_wasm.odin | 2 +- vendor/wasm/js/dom.odin | 2 +- vendor/wasm/js/dom_all_targets.odin | 2 +- vendor/wasm/js/events.odin | 2 +- vendor/wasm/js/events_all_targets.odin | 2 +- vendor/wasm/js/general.odin | 2 +- vendor/wasm/js/memory_all_targets.odin | 2 +- vendor/wasm/js/memory_js.odin | 2 +- vendor/wgpu/examples/glfw/os_glfw.odin | 2 +- vendor/wgpu/examples/sdl2/os_sdl2.odin | 2 +- vendor/wgpu/glfwglue/glue.odin | 6 ++--- vendor/wgpu/sdl2glue/glue.odin | 6 ++--- vendor/x11/xlib/xlib_const.odin | 2 +- vendor/x11/xlib/xlib_keysym.odin | 2 +- vendor/x11/xlib/xlib_procs.odin | 2 +- vendor/x11/xlib/xlib_types.odin | 2 +- 317 files changed, 433 insertions(+), 433 deletions(-) diff --git a/base/intrinsics/intrinsics.odin b/base/intrinsics/intrinsics.odin index 3cf99bbd2..744a899c0 100644 --- a/base/intrinsics/intrinsics.odin +++ b/base/intrinsics/intrinsics.odin @@ -1,5 +1,5 @@ // This is purely for documentation -//+build ignore +#+build ignore package intrinsics // Package-Related diff --git a/base/runtime/core.odin b/base/runtime/core.odin index 90e049b0c..a5a3a4d8c 100644 --- a/base/runtime/core.odin +++ b/base/runtime/core.odin @@ -18,7 +18,7 @@ // This could change at a later date if the all these data structures are // implemented within the compiler rather than in this "preload" file // -//+no-instrumentation +#+no-instrumentation package runtime import "base:intrinsics" diff --git a/base/runtime/entry_unix.odin b/base/runtime/entry_unix.odin index 5dfd37f99..e2223d5d6 100644 --- a/base/runtime/entry_unix.odin +++ b/base/runtime/entry_unix.odin @@ -1,6 +1,6 @@ -//+private -//+build linux, darwin, freebsd, openbsd, netbsd, haiku -//+no-instrumentation +#+private +#+build linux, darwin, freebsd, openbsd, netbsd, haiku +#+no-instrumentation package runtime import "base:intrinsics" diff --git a/base/runtime/entry_wasm.odin b/base/runtime/entry_wasm.odin index 99cd8201d..52bb0e072 100644 --- a/base/runtime/entry_wasm.odin +++ b/base/runtime/entry_wasm.odin @@ -1,6 +1,6 @@ -//+private -//+build wasm32, wasm64p32 -//+no-instrumentation +#+private +#+build wasm32, wasm64p32 +#+no-instrumentation package runtime import "base:intrinsics" diff --git a/base/runtime/entry_windows.odin b/base/runtime/entry_windows.odin index 1e2dcc21a..8eb4cc7d1 100644 --- a/base/runtime/entry_windows.odin +++ b/base/runtime/entry_windows.odin @@ -1,6 +1,6 @@ -//+private -//+build windows -//+no-instrumentation +#+private +#+build windows +#+no-instrumentation package runtime import "base:intrinsics" diff --git a/base/runtime/heap_allocator_orca.odin b/base/runtime/heap_allocator_orca.odin index 9e719bcd0..be032a207 100644 --- a/base/runtime/heap_allocator_orca.odin +++ b/base/runtime/heap_allocator_orca.odin @@ -1,5 +1,5 @@ -//+build orca -//+private +#+build orca +#+private package runtime foreign { diff --git a/base/runtime/heap_allocator_other.odin b/base/runtime/heap_allocator_other.odin index 8a7ad1a47..507dbf318 100644 --- a/base/runtime/heap_allocator_other.odin +++ b/base/runtime/heap_allocator_other.odin @@ -1,5 +1,5 @@ -//+build js, wasi, freestanding, essence -//+private +#+build js, wasi, freestanding, essence +#+private package runtime _heap_alloc :: proc "contextless" (size: int, zero_memory := true) -> rawptr { diff --git a/base/runtime/heap_allocator_unix.odin b/base/runtime/heap_allocator_unix.odin index 60af9e761..d4590d2dd 100644 --- a/base/runtime/heap_allocator_unix.odin +++ b/base/runtime/heap_allocator_unix.odin @@ -1,5 +1,5 @@ -//+build linux, darwin, freebsd, openbsd, netbsd, haiku -//+private +#+build linux, darwin, freebsd, openbsd, netbsd, haiku +#+private package runtime when ODIN_OS == .Darwin { diff --git a/base/runtime/internal.odin b/base/runtime/internal.odin index ff60cf547..6905317fc 100644 --- a/base/runtime/internal.odin +++ b/base/runtime/internal.odin @@ -1,4 +1,4 @@ -//+vet !cast +#+vet !cast package runtime import "base:intrinsics" diff --git a/base/runtime/os_specific_bsd.odin b/base/runtime/os_specific_bsd.odin index 46ce51166..5d198484b 100644 --- a/base/runtime/os_specific_bsd.odin +++ b/base/runtime/os_specific_bsd.odin @@ -1,5 +1,5 @@ -//+build freebsd, openbsd, netbsd -//+private +#+build freebsd, openbsd, netbsd +#+private package runtime foreign import libc "system:c" diff --git a/base/runtime/os_specific_darwin.odin b/base/runtime/os_specific_darwin.odin index 1bf29e785..907899d7c 100644 --- a/base/runtime/os_specific_darwin.odin +++ b/base/runtime/os_specific_darwin.odin @@ -1,5 +1,5 @@ -//+build darwin -//+private +#+build darwin +#+private package runtime import "base:intrinsics" diff --git a/base/runtime/os_specific_freestanding.odin b/base/runtime/os_specific_freestanding.odin index 08ca4aa55..f975f61b8 100644 --- a/base/runtime/os_specific_freestanding.odin +++ b/base/runtime/os_specific_freestanding.odin @@ -1,5 +1,5 @@ -//+build freestanding -//+private +#+build freestanding +#+private package runtime // TODO(bill): reimplement `os.write` diff --git a/base/runtime/os_specific_haiku.odin b/base/runtime/os_specific_haiku.odin index f8dafac3d..0d1ec7a03 100644 --- a/base/runtime/os_specific_haiku.odin +++ b/base/runtime/os_specific_haiku.odin @@ -1,5 +1,5 @@ -//+build haiku -//+private +#+build haiku +#+private package runtime foreign import libc "system:c" diff --git a/base/runtime/os_specific_js.odin b/base/runtime/os_specific_js.odin index d35753604..f1d12c808 100644 --- a/base/runtime/os_specific_js.odin +++ b/base/runtime/os_specific_js.odin @@ -1,5 +1,5 @@ -//+build js -//+private +#+build js +#+private package runtime foreign import "odin_env" diff --git a/base/runtime/os_specific_linux.odin b/base/runtime/os_specific_linux.odin index 146e647fb..d7b7371a7 100644 --- a/base/runtime/os_specific_linux.odin +++ b/base/runtime/os_specific_linux.odin @@ -1,4 +1,4 @@ -//+private +#+private package runtime import "base:intrinsics" diff --git a/base/runtime/os_specific_orca.odin b/base/runtime/os_specific_orca.odin index b6f5930ab..876d7d44b 100644 --- a/base/runtime/os_specific_orca.odin +++ b/base/runtime/os_specific_orca.odin @@ -1,5 +1,5 @@ -//+build orca -//+private +#+build orca +#+private package runtime import "base:intrinsics" diff --git a/base/runtime/os_specific_wasi.odin b/base/runtime/os_specific_wasi.odin index b85d7adea..aa562050c 100644 --- a/base/runtime/os_specific_wasi.odin +++ b/base/runtime/os_specific_wasi.odin @@ -1,5 +1,5 @@ -//+build wasi -//+private +#+build wasi +#+private package runtime foreign import wasi "wasi_snapshot_preview1" diff --git a/base/runtime/os_specific_windows.odin b/base/runtime/os_specific_windows.odin index 6da569aee..b966193ca 100644 --- a/base/runtime/os_specific_windows.odin +++ b/base/runtime/os_specific_windows.odin @@ -1,5 +1,5 @@ -//+build windows -//+private +#+build windows +#+private package runtime foreign import kernel32 "system:Kernel32.lib" diff --git a/base/runtime/procs_darwin.odin b/base/runtime/procs_darwin.odin index 497978a76..4f4903d47 100644 --- a/base/runtime/procs_darwin.odin +++ b/base/runtime/procs_darwin.odin @@ -1,4 +1,4 @@ -//+private +#+private package runtime foreign import "system:Foundation.framework" diff --git a/base/runtime/procs_js.odin b/base/runtime/procs_js.odin index d3e12410c..58bed808d 100644 --- a/base/runtime/procs_js.odin +++ b/base/runtime/procs_js.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package runtime init_default_context_for_js: Context diff --git a/base/runtime/procs_wasm.odin b/base/runtime/procs_wasm.odin index 9f2e9befc..8da1564c6 100644 --- a/base/runtime/procs_wasm.odin +++ b/base/runtime/procs_wasm.odin @@ -1,4 +1,4 @@ -//+build wasm32, wasm64p32 +#+build wasm32, wasm64p32 package runtime @(private="file") diff --git a/base/runtime/procs_windows_amd64.odin b/base/runtime/procs_windows_amd64.odin index ea495f5fa..81d2cfb5d 100644 --- a/base/runtime/procs_windows_amd64.odin +++ b/base/runtime/procs_windows_amd64.odin @@ -1,5 +1,5 @@ -//+private -//+no-instrumentation +#+private +#+no-instrumentation package runtime foreign import kernel32 "system:Kernel32.lib" diff --git a/base/runtime/procs_windows_i386.odin b/base/runtime/procs_windows_i386.odin index 10422cf07..99c314228 100644 --- a/base/runtime/procs_windows_i386.odin +++ b/base/runtime/procs_windows_i386.odin @@ -1,5 +1,5 @@ -//+private -//+no-instrumentation +#+private +#+no-instrumentation package runtime @require foreign import "system:int64.lib" diff --git a/base/runtime/wasm_allocator.odin b/base/runtime/wasm_allocator.odin index 6bafaa489..574f3dd06 100644 --- a/base/runtime/wasm_allocator.odin +++ b/base/runtime/wasm_allocator.odin @@ -1,4 +1,4 @@ -//+build wasm32, wasm64p32 +#+build wasm32, wasm64p32 package runtime import "base:intrinsics" diff --git a/core/compress/zlib/zlib.odin b/core/compress/zlib/zlib.odin index 2dc9e81df..be8a7d7d3 100644 --- a/core/compress/zlib/zlib.odin +++ b/core/compress/zlib/zlib.odin @@ -1,4 +1,4 @@ -//+vet !using-param +#+vet !using-param package compress_zlib /* diff --git a/core/crypto/_aes/hw_intel/api.odin b/core/crypto/_aes/hw_intel/api.odin index 1796bb093..52669cb35 100644 --- a/core/crypto/_aes/hw_intel/api.odin +++ b/core/crypto/_aes/hw_intel/api.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package aes_hw_intel import "core:sys/info" diff --git a/core/crypto/_aes/hw_intel/ghash.odin b/core/crypto/_aes/hw_intel/ghash.odin index d61e71b3a..4320dd59b 100644 --- a/core/crypto/_aes/hw_intel/ghash.odin +++ b/core/crypto/_aes/hw_intel/ghash.odin @@ -20,7 +20,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build amd64 +#+build amd64 package aes_hw_intel import "base:intrinsics" diff --git a/core/crypto/_aes/hw_intel/hw_intel_keysched.odin b/core/crypto/_aes/hw_intel/hw_intel_keysched.odin index 911dffbd5..bdf0d3066 100644 --- a/core/crypto/_aes/hw_intel/hw_intel_keysched.odin +++ b/core/crypto/_aes/hw_intel/hw_intel_keysched.odin @@ -20,7 +20,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//+build amd64 +#+build amd64 package aes_hw_intel import "base:intrinsics" diff --git a/core/crypto/_chacha20/simd256/chacha20_simd256.odin b/core/crypto/_chacha20/simd256/chacha20_simd256.odin index 10f2d75fe..ccb02a947 100644 --- a/core/crypto/_chacha20/simd256/chacha20_simd256.odin +++ b/core/crypto/_chacha20/simd256/chacha20_simd256.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package chacha20_simd256 import "base:intrinsics" diff --git a/core/crypto/_chacha20/simd256/chacha20_simd256_stub.odin b/core/crypto/_chacha20/simd256/chacha20_simd256_stub.odin index 039d6cb96..ce673b42b 100644 --- a/core/crypto/_chacha20/simd256/chacha20_simd256_stub.odin +++ b/core/crypto/_chacha20/simd256/chacha20_simd256_stub.odin @@ -1,4 +1,4 @@ -//+build !amd64 +#+build !amd64 package chacha20_simd256 import "base:intrinsics" diff --git a/core/crypto/aes/aes_ctr_hw_intel.odin b/core/crypto/aes/aes_ctr_hw_intel.odin index 1c9e815ad..415758b24 100644 --- a/core/crypto/aes/aes_ctr_hw_intel.odin +++ b/core/crypto/aes/aes_ctr_hw_intel.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package aes import "base:intrinsics" diff --git a/core/crypto/aes/aes_ecb_hw_intel.odin b/core/crypto/aes/aes_ecb_hw_intel.odin index b2ff36a0c..f1d44a25f 100644 --- a/core/crypto/aes/aes_ecb_hw_intel.odin +++ b/core/crypto/aes/aes_ecb_hw_intel.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package aes import "base:intrinsics" diff --git a/core/crypto/aes/aes_gcm_hw_intel.odin b/core/crypto/aes/aes_gcm_hw_intel.odin index ffd8ed642..4cb5ab3b2 100644 --- a/core/crypto/aes/aes_gcm_hw_intel.odin +++ b/core/crypto/aes/aes_gcm_hw_intel.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package aes import "base:intrinsics" diff --git a/core/crypto/aes/aes_impl_hw_gen.odin b/core/crypto/aes/aes_impl_hw_gen.odin index 3557b1aae..0c9ec6edc 100644 --- a/core/crypto/aes/aes_impl_hw_gen.odin +++ b/core/crypto/aes/aes_impl_hw_gen.odin @@ -1,4 +1,4 @@ -//+build !amd64 +#+build !amd64 package aes @(private = "file") diff --git a/core/crypto/aes/aes_impl_hw_intel.odin b/core/crypto/aes/aes_impl_hw_intel.odin index 39ea2dc8d..0f1fa6143 100644 --- a/core/crypto/aes/aes_impl_hw_intel.odin +++ b/core/crypto/aes/aes_impl_hw_intel.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package aes import "core:crypto/_aes/hw_intel" diff --git a/core/crypto/rand_bsd.odin b/core/crypto/rand_bsd.odin index 641b72933..78a6fcaaf 100644 --- a/core/crypto/rand_bsd.odin +++ b/core/crypto/rand_bsd.odin @@ -1,4 +1,4 @@ -//+build freebsd, openbsd, netbsd +#+build freebsd, openbsd, netbsd package crypto foreign import libc "system:c" diff --git a/core/crypto/rand_generic.odin b/core/crypto/rand_generic.odin index 46fb881b3..ef578f5c0 100644 --- a/core/crypto/rand_generic.odin +++ b/core/crypto/rand_generic.odin @@ -1,10 +1,10 @@ -//+build !linux -//+build !windows -//+build !openbsd -//+build !freebsd -//+build !netbsd -//+build !darwin -//+build !js +#+build !linux +#+build !windows +#+build !openbsd +#+build !freebsd +#+build !netbsd +#+build !darwin +#+build !js package crypto HAS_RAND_BYTES :: false diff --git a/core/debug/trace/trace_cpp.odin b/core/debug/trace/trace_cpp.odin index dc723184a..8ef377cef 100644 --- a/core/debug/trace/trace_cpp.odin +++ b/core/debug/trace/trace_cpp.odin @@ -1,5 +1,5 @@ -//+private file -//+build linux, darwin +#+private file +#+build linux, darwin package debug_trace import "base:intrinsics" diff --git a/core/debug/trace/trace_nil.odin b/core/debug/trace/trace_nil.odin index ca8bd7817..8ee96720e 100644 --- a/core/debug/trace/trace_nil.odin +++ b/core/debug/trace/trace_nil.odin @@ -1,6 +1,6 @@ -//+build !windows -//+build !linux -//+build !darwin +#+build !windows +#+build !linux +#+build !darwin package debug_trace import "base:runtime" diff --git a/core/debug/trace/trace_windows.odin b/core/debug/trace/trace_windows.odin index de1461e96..c9868e338 100644 --- a/core/debug/trace/trace_windows.odin +++ b/core/debug/trace/trace_windows.odin @@ -1,5 +1,5 @@ -//+private -//+build windows +#+private +#+build windows package debug_trace import "base:intrinsics" diff --git a/core/dynlib/lib_js.odin b/core/dynlib/lib_js.odin index bfc724c12..698cfee9c 100644 --- a/core/dynlib/lib_js.odin +++ b/core/dynlib/lib_js.odin @@ -1,5 +1,5 @@ -//+build js -//+private +#+build js +#+private package dynlib _load_library :: proc(path: string, global_symbols := false) -> (Library, bool) { diff --git a/core/dynlib/lib_unix.odin b/core/dynlib/lib_unix.odin index 8adaadb2d..f467d730d 100644 --- a/core/dynlib/lib_unix.odin +++ b/core/dynlib/lib_unix.odin @@ -1,5 +1,5 @@ -//+build linux, darwin, freebsd, openbsd, netbsd -//+private +#+build linux, darwin, freebsd, openbsd, netbsd +#+private package dynlib import "core:os" diff --git a/core/dynlib/lib_windows.odin b/core/dynlib/lib_windows.odin index b41abe3b2..6c41a1a75 100644 --- a/core/dynlib/lib_windows.odin +++ b/core/dynlib/lib_windows.odin @@ -1,5 +1,5 @@ -//+build windows -//+private +#+build windows +#+private package dynlib import win32 "core:sys/windows" diff --git a/core/flags/errors_bsd.odin b/core/flags/errors_bsd.odin index 1fe6de90b..4d98d2ee4 100644 --- a/core/flags/errors_bsd.odin +++ b/core/flags/errors_bsd.odin @@ -1,4 +1,4 @@ -//+build netbsd, openbsd +#+build netbsd, openbsd package flags import "base:runtime" diff --git a/core/flags/errors_nonbsd.odin b/core/flags/errors_nonbsd.odin index e129aff74..28912b57f 100644 --- a/core/flags/errors_nonbsd.odin +++ b/core/flags/errors_nonbsd.odin @@ -1,5 +1,5 @@ -//+build !netbsd -//+build !openbsd +#+build !netbsd +#+build !openbsd package flags import "base:runtime" diff --git a/core/flags/internal_assignment.odin b/core/flags/internal_assignment.odin index be3997ef1..12ddb876f 100644 --- a/core/flags/internal_assignment.odin +++ b/core/flags/internal_assignment.odin @@ -1,4 +1,4 @@ -//+private +#+private package flags import "base:intrinsics" diff --git a/core/flags/internal_parsing.odin b/core/flags/internal_parsing.odin index 7a769b17c..4e49f45b0 100644 --- a/core/flags/internal_parsing.odin +++ b/core/flags/internal_parsing.odin @@ -1,4 +1,4 @@ -//+private +#+private package flags import "core:container/bit_array" diff --git a/core/flags/internal_rtti.odin b/core/flags/internal_rtti.odin index 4c1db5d0b..1c559ca55 100644 --- a/core/flags/internal_rtti.odin +++ b/core/flags/internal_rtti.odin @@ -1,4 +1,4 @@ -//+private +#+private package flags import "base:intrinsics" diff --git a/core/flags/internal_rtti_nonbsd.odin b/core/flags/internal_rtti_nonbsd.odin index 0044898d5..e1286186b 100644 --- a/core/flags/internal_rtti_nonbsd.odin +++ b/core/flags/internal_rtti_nonbsd.odin @@ -1,6 +1,6 @@ -//+private -//+build !netbsd -//+build !openbsd +#+private +#+build !netbsd +#+build !openbsd package flags import "core:net" diff --git a/core/flags/internal_validation.odin b/core/flags/internal_validation.odin index b71cf9fe7..afd05331c 100644 --- a/core/flags/internal_validation.odin +++ b/core/flags/internal_validation.odin @@ -1,4 +1,4 @@ -//+private +#+private package flags @require import "base:runtime" diff --git a/core/fmt/example.odin b/core/fmt/example.odin index 503e64f2b..6929e9be7 100644 --- a/core/fmt/example.odin +++ b/core/fmt/example.odin @@ -1,4 +1,4 @@ -//+build ignore +#+build ignore package custom_formatter_example import "core:fmt" import "core:io" diff --git a/core/fmt/fmt_js.odin b/core/fmt/fmt_js.odin index acf218eb5..ce90fbfe7 100644 --- a/core/fmt/fmt_js.odin +++ b/core/fmt/fmt_js.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package fmt import "core:bufio" diff --git a/core/fmt/fmt_os.odin b/core/fmt/fmt_os.odin index 9de0d43be..a481061f1 100644 --- a/core/fmt/fmt_os.odin +++ b/core/fmt/fmt_os.odin @@ -1,6 +1,6 @@ -//+build !freestanding -//+build !js -//+build !orca +#+build !freestanding +#+build !js +#+build !orca package fmt import "base:runtime" diff --git a/core/image/bmp/bmp_js.odin b/core/image/bmp/bmp_js.odin index d87a7d2d5..fa5d59095 100644 --- a/core/image/bmp/bmp_js.odin +++ b/core/image/bmp/bmp_js.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package core_image_bmp load :: proc{load_from_bytes, load_from_context} diff --git a/core/image/bmp/bmp_os.odin b/core/image/bmp/bmp_os.odin index d20abc685..70a85a784 100644 --- a/core/image/bmp/bmp_os.odin +++ b/core/image/bmp/bmp_os.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package core_image_bmp import "core:os" diff --git a/core/image/general_js.odin b/core/image/general_js.odin index 841d9c200..abf9812c0 100644 --- a/core/image/general_js.odin +++ b/core/image/general_js.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package image load :: proc{ diff --git a/core/image/general_os.odin b/core/image/general_os.odin index e1fe440a4..98eb5bdbe 100644 --- a/core/image/general_os.odin +++ b/core/image/general_os.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package image import "core:os" diff --git a/core/image/netpbm/netpbm.odin b/core/image/netpbm/netpbm.odin index ab3945ad7..a9dc6599a 100644 --- a/core/image/netpbm/netpbm.odin +++ b/core/image/netpbm/netpbm.odin @@ -1,4 +1,4 @@ -//+vet !using-stmt +#+vet !using-stmt package netpbm import "core:bytes" diff --git a/core/image/netpbm/netpbm_js.odin b/core/image/netpbm/netpbm_js.odin index 7db17a05d..7d475cf62 100644 --- a/core/image/netpbm/netpbm_js.odin +++ b/core/image/netpbm/netpbm_js.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package netpbm load :: proc { diff --git a/core/image/netpbm/netpbm_os.odin b/core/image/netpbm/netpbm_os.odin index 609f1ea1f..2cf2439ac 100644 --- a/core/image/netpbm/netpbm_os.odin +++ b/core/image/netpbm/netpbm_os.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package netpbm import "core:os" diff --git a/core/image/png/png.odin b/core/image/png/png.odin index 02aef1087..2d3665e94 100644 --- a/core/image/png/png.odin +++ b/core/image/png/png.odin @@ -8,7 +8,7 @@ */ -//+vet !using-stmt +#+vet !using-stmt package png import "core:compress" diff --git a/core/image/png/png_js.odin b/core/image/png/png_js.odin index 57c27fc64..dd9e74526 100644 --- a/core/image/png/png_js.odin +++ b/core/image/png/png_js.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package png load :: proc{load_from_bytes, load_from_context} diff --git a/core/image/png/png_os.odin b/core/image/png/png_os.odin index cc65e7b42..8e0706206 100644 --- a/core/image/png/png_os.odin +++ b/core/image/png/png_os.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package png import "core:os" diff --git a/core/image/qoi/qoi_js.odin b/core/image/qoi/qoi_js.odin index 2c23cc17a..4a69e98a0 100644 --- a/core/image/qoi/qoi_js.odin +++ b/core/image/qoi/qoi_js.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package qoi save :: proc{save_to_buffer} diff --git a/core/image/qoi/qoi_os.odin b/core/image/qoi/qoi_os.odin index efcec6c52..c85fdd839 100644 --- a/core/image/qoi/qoi_os.odin +++ b/core/image/qoi/qoi_os.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package qoi import "core:os" diff --git a/core/image/tga/tga_js.odin b/core/image/tga/tga_js.odin index d98b241a7..9261be8c6 100644 --- a/core/image/tga/tga_js.odin +++ b/core/image/tga/tga_js.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package tga save :: proc{save_to_buffer} diff --git a/core/image/tga/tga_os.odin b/core/image/tga/tga_os.odin index 12747a684..a78998105 100644 --- a/core/image/tga/tga_os.odin +++ b/core/image/tga/tga_os.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package tga import "core:os" diff --git a/core/log/file_console_logger.odin b/core/log/file_console_logger.odin index f05f7a258..e45f99523 100644 --- a/core/log/file_console_logger.odin +++ b/core/log/file_console_logger.odin @@ -1,5 +1,5 @@ -//+build !freestanding -//+build !orca +#+build !freestanding +#+build !orca package log import "core:encoding/ansi" diff --git a/core/math/big/tune.odin b/core/math/big/tune.odin index 5938dafde..eab36b951 100644 --- a/core/math/big/tune.odin +++ b/core/math/big/tune.odin @@ -7,7 +7,7 @@ The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks. */ -//+build ignore +#+build ignore package math_big import "core:time" diff --git a/core/math/math_basic.odin b/core/math/math_basic.odin index 041efd272..2584df71f 100644 --- a/core/math/math_basic.odin +++ b/core/math/math_basic.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package math import "base:intrinsics" diff --git a/core/math/math_basic_js.odin b/core/math/math_basic_js.odin index 5b9adabcd..2604ebc8b 100644 --- a/core/math/math_basic_js.odin +++ b/core/math/math_basic_js.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package math import "base:intrinsics" diff --git a/core/math/noise/internal.odin b/core/math/noise/internal.odin index bd97bd45c..f75c0ee87 100644 --- a/core/math/noise/internal.odin +++ b/core/math/noise/internal.odin @@ -4,7 +4,7 @@ Ported from https://github.com/KdotJPG/OpenSimplex2. Copyright 2022 Yuki2 (https://github.com/NoahR02) */ -//+private +#+private package math_noise /* diff --git a/core/mem/mutex_allocator.odin b/core/mem/mutex_allocator.odin index 591703eab..6ede219ac 100644 --- a/core/mem/mutex_allocator.odin +++ b/core/mem/mutex_allocator.odin @@ -1,4 +1,4 @@ -//+build !freestanding +#+build !freestanding package mem import "core:sync" diff --git a/core/mem/tracking_allocator.odin b/core/mem/tracking_allocator.odin index 1b57e5fb4..7a95888dc 100644 --- a/core/mem/tracking_allocator.odin +++ b/core/mem/tracking_allocator.odin @@ -1,4 +1,4 @@ -//+build !freestanding +#+build !freestanding package mem import "base:runtime" diff --git a/core/mem/virtual/virtual_linux.odin b/core/mem/virtual/virtual_linux.odin index 0b4532baa..3e0d7668b 100644 --- a/core/mem/virtual/virtual_linux.odin +++ b/core/mem/virtual/virtual_linux.odin @@ -1,5 +1,5 @@ -//+build linux -//+private +#+build linux +#+private package mem_virtual import "core:sys/linux" diff --git a/core/mem/virtual/virtual_other.odin b/core/mem/virtual/virtual_other.odin index 4fcb61b04..a57856975 100644 --- a/core/mem/virtual/virtual_other.odin +++ b/core/mem/virtual/virtual_other.odin @@ -1,10 +1,10 @@ -//+private -//+build !darwin -//+build !freebsd -//+build !openbsd -//+build !netbsd -//+build !linux -//+build !windows +#+private +#+build !darwin +#+build !freebsd +#+build !openbsd +#+build !netbsd +#+build !linux +#+build !windows package mem_virtual _reserve :: proc "contextless" (size: uint) -> (data: []byte, err: Allocator_Error) { diff --git a/core/mem/virtual/virtual_platform.odin b/core/mem/virtual/virtual_platform.odin index c2b505cd2..54c42ce4b 100644 --- a/core/mem/virtual/virtual_platform.odin +++ b/core/mem/virtual/virtual_platform.odin @@ -1,4 +1,4 @@ -//+private +#+private package mem_virtual Platform_Memory_Block :: struct { diff --git a/core/mem/virtual/virtual_posix.odin b/core/mem/virtual/virtual_posix.odin index 035763466..105849774 100644 --- a/core/mem/virtual/virtual_posix.odin +++ b/core/mem/virtual/virtual_posix.odin @@ -1,5 +1,5 @@ -//+build darwin, netbsd, freebsd, openbsd -//+private +#+build darwin, netbsd, freebsd, openbsd +#+private package mem_virtual import "core:sys/posix" diff --git a/core/mem/virtual/virtual_windows.odin b/core/mem/virtual/virtual_windows.odin index ee47a01a8..acd30ae33 100644 --- a/core/mem/virtual/virtual_windows.odin +++ b/core/mem/virtual/virtual_windows.odin @@ -1,5 +1,5 @@ -//+build windows -//+private +#+build windows +#+private package mem_virtual foreign import Kernel32 "system:Kernel32.lib" diff --git a/core/net/addr.odin b/core/net/addr.odin index 1972d8c22..c47c6f55e 100644 --- a/core/net/addr.odin +++ b/core/net/addr.odin @@ -1,4 +1,4 @@ -// +build windows, linux, darwin, freebsd +#+build windows, linux, darwin, freebsd package net /* diff --git a/core/net/common.odin b/core/net/common.odin index ed255356e..263fc770f 100644 --- a/core/net/common.odin +++ b/core/net/common.odin @@ -1,4 +1,4 @@ -// +build windows, linux, darwin, freebsd +#+build windows, linux, darwin, freebsd package net /* diff --git a/core/net/dns.odin b/core/net/dns.odin index e82b54262..ffb97fc5b 100644 --- a/core/net/dns.odin +++ b/core/net/dns.odin @@ -1,4 +1,4 @@ -// +build windows, linux, darwin, freebsd +#+build windows, linux, darwin, freebsd package net /* diff --git a/core/net/dns_unix.odin b/core/net/dns_unix.odin index 0448b8d9e..e4336e410 100644 --- a/core/net/dns_unix.odin +++ b/core/net/dns_unix.odin @@ -1,4 +1,4 @@ -//+build linux, darwin, freebsd +#+build linux, darwin, freebsd package net /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/dns_windows.odin b/core/net/dns_windows.odin index 1b7fe7196..2f3831767 100644 --- a/core/net/dns_windows.odin +++ b/core/net/dns_windows.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package net /* diff --git a/core/net/errors_darwin.odin b/core/net/errors_darwin.odin index f2a0d6262..b75336570 100644 --- a/core/net/errors_darwin.odin +++ b/core/net/errors_darwin.odin @@ -1,5 +1,5 @@ package net -// +build darwin +#+build darwin /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/errors_freebsd.odin b/core/net/errors_freebsd.odin index 4830d1c03..486732a95 100644 --- a/core/net/errors_freebsd.odin +++ b/core/net/errors_freebsd.odin @@ -1,4 +1,4 @@ -//+build freebsd +#+build freebsd package net /* diff --git a/core/net/errors_linux.odin b/core/net/errors_linux.odin index 9047b4020..f53a47d15 100644 --- a/core/net/errors_linux.odin +++ b/core/net/errors_linux.odin @@ -1,5 +1,5 @@ package net -// +build linux +#+build linux /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/errors_windows.odin b/core/net/errors_windows.odin index ae928a05c..c4a880e10 100644 --- a/core/net/errors_windows.odin +++ b/core/net/errors_windows.odin @@ -1,5 +1,5 @@ package net -// +build windows +#+build windows /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/interface.odin b/core/net/interface.odin index 90444fb63..775a812f3 100644 --- a/core/net/interface.odin +++ b/core/net/interface.odin @@ -1,4 +1,4 @@ -// +build windows, linux, darwin, freebsd +#+build windows, linux, darwin, freebsd package net /* diff --git a/core/net/interface_darwin.odin b/core/net/interface_darwin.odin index 7a33682de..6931f5188 100644 --- a/core/net/interface_darwin.odin +++ b/core/net/interface_darwin.odin @@ -1,5 +1,5 @@ package net -//+build darwin +#+build darwin /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/interface_freebsd.odin b/core/net/interface_freebsd.odin index a9a125299..50e2d1a96 100644 --- a/core/net/interface_freebsd.odin +++ b/core/net/interface_freebsd.odin @@ -1,4 +1,4 @@ -//+build freebsd +#+build freebsd package net /* diff --git a/core/net/interface_linux.odin b/core/net/interface_linux.odin index c6df8f0a2..85bbfd43b 100644 --- a/core/net/interface_linux.odin +++ b/core/net/interface_linux.odin @@ -1,5 +1,5 @@ package net -//+build linux +#+build linux /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/interface_windows.odin b/core/net/interface_windows.odin index 67da6d034..02b936b0a 100644 --- a/core/net/interface_windows.odin +++ b/core/net/interface_windows.odin @@ -1,5 +1,5 @@ package net -//+build windows +#+build windows /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/socket.odin b/core/net/socket.odin index e36c67d21..83a9f0168 100644 --- a/core/net/socket.odin +++ b/core/net/socket.odin @@ -1,4 +1,4 @@ -// +build windows, linux, darwin, freebsd +#+build windows, linux, darwin, freebsd package net /* diff --git a/core/net/socket_darwin.odin b/core/net/socket_darwin.odin index a56d36de6..c7b5b2761 100644 --- a/core/net/socket_darwin.odin +++ b/core/net/socket_darwin.odin @@ -1,5 +1,5 @@ package net -// +build darwin +#+build darwin /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/socket_freebsd.odin b/core/net/socket_freebsd.odin index 00da5ec06..8ac69907f 100644 --- a/core/net/socket_freebsd.odin +++ b/core/net/socket_freebsd.odin @@ -1,4 +1,4 @@ -//+build freebsd +#+build freebsd package net /* diff --git a/core/net/socket_linux.odin b/core/net/socket_linux.odin index 52f328814..1800a4a89 100644 --- a/core/net/socket_linux.odin +++ b/core/net/socket_linux.odin @@ -1,5 +1,5 @@ package net -// +build linux +#+build linux /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/socket_windows.odin b/core/net/socket_windows.odin index 8ee75bc3b..d67f5ada1 100644 --- a/core/net/socket_windows.odin +++ b/core/net/socket_windows.odin @@ -1,5 +1,5 @@ package net -// +build windows +#+build windows /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/os/dir_unix.odin b/core/os/dir_unix.odin index b472e89b7..26e865204 100644 --- a/core/os/dir_unix.odin +++ b/core/os/dir_unix.odin @@ -1,4 +1,4 @@ -//+build darwin, linux, netbsd, freebsd, openbsd +#+build darwin, linux, netbsd, freebsd, openbsd package os import "core:strings" diff --git a/core/os/os2/allocators.odin b/core/os/os2/allocators.odin index ddfe230be..7b4f37189 100644 --- a/core/os/os2/allocators.odin +++ b/core/os/os2/allocators.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/dir_linux.odin b/core/os/os2/dir_linux.odin index d4f62e213..6a097e192 100644 --- a/core/os/os2/dir_linux.odin +++ b/core/os/os2/dir_linux.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 Read_Directory_Iterator_Impl :: struct { diff --git a/core/os/os2/dir_posix.odin b/core/os/os2/dir_posix.odin index 75f620d90..14fddde50 100644 --- a/core/os/os2/dir_posix.odin +++ b/core/os/os2/dir_posix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, netbsd, freebsd, openbsd +#+private +#+build darwin, netbsd, freebsd, openbsd package os2 import "core:sys/posix" diff --git a/core/os/os2/dir_windows.odin b/core/os/os2/dir_windows.odin index 1b9675064..09990aeec 100644 --- a/core/os/os2/dir_windows.odin +++ b/core/os/os2/dir_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/env_linux.odin b/core/os/os2/env_linux.odin index 99dd00d90..c248a323c 100644 --- a/core/os/os2/env_linux.odin +++ b/core/os/os2/env_linux.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/env_posix.odin b/core/os/os2/env_posix.odin index 93524fb0c..e2080485d 100644 --- a/core/os/os2/env_posix.odin +++ b/core/os/os2/env_posix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, netbsd, freebsd, openbsd +#+private +#+build darwin, netbsd, freebsd, openbsd package os2 import "base:runtime" diff --git a/core/os/os2/env_windows.odin b/core/os/os2/env_windows.odin index ac30eb1d4..a1e8c969d 100644 --- a/core/os/os2/env_windows.odin +++ b/core/os/os2/env_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import win32 "core:sys/windows" diff --git a/core/os/os2/errors_linux.odin b/core/os/os2/errors_linux.odin index ed55ea15e..09492110d 100644 --- a/core/os/os2/errors_linux.odin +++ b/core/os/os2/errors_linux.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "core:sys/linux" diff --git a/core/os/os2/errors_posix.odin b/core/os/os2/errors_posix.odin index 9e3424a4a..59f0ba5f1 100644 --- a/core/os/os2/errors_posix.odin +++ b/core/os/os2/errors_posix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, netbsd, freebsd, openbsd +#+private +#+build darwin, netbsd, freebsd, openbsd package os2 import "core:sys/posix" diff --git a/core/os/os2/errors_windows.odin b/core/os/os2/errors_windows.odin index 8a9a47ca6..56acd503f 100644 --- a/core/os/os2/errors_windows.odin +++ b/core/os/os2/errors_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/file_linux.odin b/core/os/os2/file_linux.odin index ad6ddbf17..e9ce13447 100644 --- a/core/os/os2/file_linux.odin +++ b/core/os/os2/file_linux.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/file_posix.odin b/core/os/os2/file_posix.odin index dae85d224..b7dc43287 100644 --- a/core/os/os2/file_posix.odin +++ b/core/os/os2/file_posix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, netbsd, freebsd, openbsd +#+private +#+build darwin, netbsd, freebsd, openbsd package os2 import "base:runtime" diff --git a/core/os/os2/file_posix_darwin.odin b/core/os/os2/file_posix_darwin.odin index 056d775e6..920a63a71 100644 --- a/core/os/os2/file_posix_darwin.odin +++ b/core/os/os2/file_posix_darwin.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/file_posix_freebsd.odin b/core/os/os2/file_posix_freebsd.odin index e5007f8fe..05d031930 100644 --- a/core/os/os2/file_posix_freebsd.odin +++ b/core/os/os2/file_posix_freebsd.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/file_posix_netbsd.odin b/core/os/os2/file_posix_netbsd.odin index a9cc77a41..f96c227ba 100644 --- a/core/os/os2/file_posix_netbsd.odin +++ b/core/os/os2/file_posix_netbsd.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/file_posix_other.odin b/core/os/os2/file_posix_other.odin index 929622578..74b6374ec 100644 --- a/core/os/os2/file_posix_other.odin +++ b/core/os/os2/file_posix_other.odin @@ -1,5 +1,5 @@ -//+private -//+build openbsd +#+private +#+build openbsd package os2 import "base:runtime" diff --git a/core/os/os2/file_windows.odin b/core/os/os2/file_windows.odin index 382156420..511935d74 100644 --- a/core/os/os2/file_windows.odin +++ b/core/os/os2/file_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/heap_linux.odin b/core/os/os2/heap_linux.odin index e765c320b..ede5eb2ac 100644 --- a/core/os/os2/heap_linux.odin +++ b/core/os/os2/heap_linux.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "core:sys/linux" diff --git a/core/os/os2/heap_posix.odin b/core/os/os2/heap_posix.odin index fcae267fa..1b52aed75 100644 --- a/core/os/os2/heap_posix.odin +++ b/core/os/os2/heap_posix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, netbsd, freebsd, openbsd +#+private +#+build darwin, netbsd, freebsd, openbsd package os2 import "base:runtime" diff --git a/core/os/os2/heap_windows.odin b/core/os/os2/heap_windows.odin index 4afc016a0..7fd4529a0 100644 --- a/core/os/os2/heap_windows.odin +++ b/core/os/os2/heap_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "core:mem" diff --git a/core/os/os2/internal_util.odin b/core/os/os2/internal_util.odin index 041cd531b..164e1e1be 100644 --- a/core/os/os2/internal_util.odin +++ b/core/os/os2/internal_util.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:intrinsics" diff --git a/core/os/os2/path_linux.odin b/core/os/os2/path_linux.odin index ba2f7235c..7be4121ae 100644 --- a/core/os/os2/path_linux.odin +++ b/core/os/os2/path_linux.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "core:strings" diff --git a/core/os/os2/path_posix.odin b/core/os/os2/path_posix.odin index 0b9a52532..6f358c58d 100644 --- a/core/os/os2/path_posix.odin +++ b/core/os/os2/path_posix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, netbsd, freebsd, openbsd +#+private +#+build darwin, netbsd, freebsd, openbsd package os2 import "base:runtime" diff --git a/core/os/os2/path_windows.odin b/core/os/os2/path_windows.odin index 4aa695ee2..3e92cb6f3 100644 --- a/core/os/os2/path_windows.odin +++ b/core/os/os2/path_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import win32 "core:sys/windows" diff --git a/core/os/os2/pipe_linux.odin b/core/os/os2/pipe_linux.odin index 42315cf4e..ac3382bc3 100644 --- a/core/os/os2/pipe_linux.odin +++ b/core/os/os2/pipe_linux.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "core:sys/linux" diff --git a/core/os/os2/pipe_posix.odin b/core/os/os2/pipe_posix.odin index 13c1f8aec..487e32aea 100644 --- a/core/os/os2/pipe_posix.odin +++ b/core/os/os2/pipe_posix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, netbsd, freebsd, openbsd +#+private +#+build darwin, netbsd, freebsd, openbsd package os2 import "core:sys/posix" diff --git a/core/os/os2/pipe_windows.odin b/core/os/os2/pipe_windows.odin index 59615e306..ee93fb683 100644 --- a/core/os/os2/pipe_windows.odin +++ b/core/os/os2/pipe_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import win32 "core:sys/windows" diff --git a/core/os/os2/process_linux.odin b/core/os/os2/process_linux.odin index b6db46423..ea5ee41b1 100644 --- a/core/os/os2/process_linux.odin +++ b/core/os/os2/process_linux.odin @@ -1,5 +1,5 @@ -//+build linux -//+private file +#+build linux +#+private file package os2 import "base:runtime" diff --git a/core/os/os2/process_posix.odin b/core/os/os2/process_posix.odin index ea4ada81e..5ac6babc1 100644 --- a/core/os/os2/process_posix.odin +++ b/core/os/os2/process_posix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, netbsd, freebsd, openbsd +#+private +#+build darwin, netbsd, freebsd, openbsd package os2 import "base:runtime" diff --git a/core/os/os2/process_posix_darwin.odin b/core/os/os2/process_posix_darwin.odin index 648c4d389..0ea1f643c 100644 --- a/core/os/os2/process_posix_darwin.odin +++ b/core/os/os2/process_posix_darwin.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/process_posix_other.odin b/core/os/os2/process_posix_other.odin index 02f78b9ac..77dbfa7eb 100644 --- a/core/os/os2/process_posix_other.odin +++ b/core/os/os2/process_posix_other.odin @@ -1,5 +1,5 @@ -//+private -//+build netbsd, openbsd, freebsd +#+private +#+build netbsd, openbsd, freebsd package os2 import "base:runtime" diff --git a/core/os/os2/process_windows.odin b/core/os/os2/process_windows.odin index edb321509..0c32373f3 100644 --- a/core/os/os2/process_windows.odin +++ b/core/os/os2/process_windows.odin @@ -1,4 +1,4 @@ -//+private file +#+private file package os2 import "base:runtime" diff --git a/core/os/os2/stat_linux.odin b/core/os/os2/stat_linux.odin index 6ccac1be0..0433c1a61 100644 --- a/core/os/os2/stat_linux.odin +++ b/core/os/os2/stat_linux.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "core:time" diff --git a/core/os/os2/stat_posix.odin b/core/os/os2/stat_posix.odin index a817a862b..88029c1f5 100644 --- a/core/os/os2/stat_posix.odin +++ b/core/os/os2/stat_posix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, netbsd, freebsd, openbsd +#+private +#+build darwin, netbsd, freebsd, openbsd package os2 import "base:runtime" diff --git a/core/os/os2/stat_windows.odin b/core/os/os2/stat_windows.odin index 566417c84..8ed2a6fed 100644 --- a/core/os/os2/stat_windows.odin +++ b/core/os/os2/stat_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/temp_file_linux.odin b/core/os/os2/temp_file_linux.odin index d6f90fbaf..4eacbc54a 100644 --- a/core/os/os2/temp_file_linux.odin +++ b/core/os/os2/temp_file_linux.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os2/temp_file_posix.odin b/core/os/os2/temp_file_posix.odin index 67ec4d3e8..b44ea13a7 100644 --- a/core/os/os2/temp_file_posix.odin +++ b/core/os/os2/temp_file_posix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, netbsd, freebsd, openbsd +#+private +#+build darwin, netbsd, freebsd, openbsd package os2 import "base:runtime" diff --git a/core/os/os2/temp_file_windows.odin b/core/os/os2/temp_file_windows.odin index d888eda52..3e3e1285c 100644 --- a/core/os/os2/temp_file_windows.odin +++ b/core/os/os2/temp_file_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package os2 import "base:runtime" diff --git a/core/os/os_freestanding.odin b/core/os/os_freestanding.odin index c908e3738..c22a6d7d5 100644 --- a/core/os/os_freestanding.odin +++ b/core/os/os_freestanding.odin @@ -1,4 +1,4 @@ -//+build freestanding +#+build freestanding package os #panic("package os does not support a freestanding target") diff --git a/core/os/os_js.odin b/core/os/os_js.odin index eb434c727..5a544c3f7 100644 --- a/core/os/os_js.odin +++ b/core/os/os_js.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package os import "base:runtime" diff --git a/core/os/os_windows.odin b/core/os/os_windows.odin index 6fb0631cd..552508f3b 100644 --- a/core/os/os_windows.odin +++ b/core/os/os_windows.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package os import win32 "core:sys/windows" diff --git a/core/os/stat_unix.odin b/core/os/stat_unix.odin index 8e89bee4f..7f7985e83 100644 --- a/core/os/stat_unix.odin +++ b/core/os/stat_unix.odin @@ -1,4 +1,4 @@ -//+build linux, darwin, freebsd, openbsd, netbsd, haiku +#+build linux, darwin, freebsd, openbsd, netbsd, haiku package os import "core:time" diff --git a/core/path/filepath/path_unix.odin b/core/path/filepath/path_unix.odin index 7137ad844..a18dc739e 100644 --- a/core/path/filepath/path_unix.odin +++ b/core/path/filepath/path_unix.odin @@ -1,4 +1,4 @@ -//+build linux, darwin, freebsd, openbsd, netbsd +#+build linux, darwin, freebsd, openbsd, netbsd package filepath when ODIN_OS == .Darwin { diff --git a/core/prof/spall/spall_linux.odin b/core/prof/spall/spall_linux.odin index b25d2b336..8060af448 100644 --- a/core/prof/spall/spall_linux.odin +++ b/core/prof/spall/spall_linux.odin @@ -1,10 +1,10 @@ -//+private +#+private package spall // Only for types and constants. import "core:os" -// Package is `//+no-instrumentation`, safe to use. +// Package is `#+no-instrumentation`, safe to use. import "core:sys/linux" MAX_RW :: 0x7fffffff diff --git a/core/prof/spall/spall_unix.odin b/core/prof/spall/spall_unix.odin index fc05b8525..455245aad 100644 --- a/core/prof/spall/spall_unix.odin +++ b/core/prof/spall/spall_unix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, freebsd, openbsd, netbsd +#+private +#+build darwin, freebsd, openbsd, netbsd package spall // Only for types. diff --git a/core/prof/spall/spall_windows.odin b/core/prof/spall/spall_windows.odin index c8b044963..11e216b63 100644 --- a/core/prof/spall/spall_windows.odin +++ b/core/prof/spall/spall_windows.odin @@ -1,10 +1,10 @@ -//+private +#+private package spall // Only for types. import "core:os" -// Package is `//+no-instrumentation`, safe to use. +// Package is `#+no-instrumentation`, safe to use. import win32 "core:sys/windows" MAX_RW :: 1<<30 diff --git a/core/simd/x86/abm.odin b/core/simd/x86/abm.odin index 9018a835a..4b07086ce 100644 --- a/core/simd/x86/abm.odin +++ b/core/simd/x86/abm.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 import "base:intrinsics" diff --git a/core/simd/x86/adx.odin b/core/simd/x86/adx.odin index 5750ae627..9c6ae063a 100644 --- a/core/simd/x86/adx.odin +++ b/core/simd/x86/adx.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 @(require_results) diff --git a/core/simd/x86/aes.odin b/core/simd/x86/aes.odin index a2cd2e4d3..338381422 100644 --- a/core/simd/x86/aes.odin +++ b/core/simd/x86/aes.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 @(require_results, enable_target_feature = "aes") diff --git a/core/simd/x86/cmpxchg16b.odin b/core/simd/x86/cmpxchg16b.odin index 1307a9cf2..78ebd182f 100644 --- a/core/simd/x86/cmpxchg16b.odin +++ b/core/simd/x86/cmpxchg16b.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package simd_x86 import "base:intrinsics" diff --git a/core/simd/x86/fxsr.odin b/core/simd/x86/fxsr.odin index a9213fed2..ab8cdca7d 100644 --- a/core/simd/x86/fxsr.odin +++ b/core/simd/x86/fxsr.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 @(enable_target_feature="fxsr") diff --git a/core/simd/x86/pclmulqdq.odin b/core/simd/x86/pclmulqdq.odin index e827bf6b9..14e633c06 100644 --- a/core/simd/x86/pclmulqdq.odin +++ b/core/simd/x86/pclmulqdq.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 @(require_results, enable_target_feature="pclmul") diff --git a/core/simd/x86/rdtsc.odin b/core/simd/x86/rdtsc.odin index 8a8b13c4b..84c762274 100644 --- a/core/simd/x86/rdtsc.odin +++ b/core/simd/x86/rdtsc.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 @(require_results) diff --git a/core/simd/x86/sha.odin b/core/simd/x86/sha.odin index bc58e8504..8caa3a268 100644 --- a/core/simd/x86/sha.odin +++ b/core/simd/x86/sha.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 @(require_results, enable_target_feature="sha") diff --git a/core/simd/x86/sse.odin b/core/simd/x86/sse.odin index 4dac50234..1b4a863b6 100644 --- a/core/simd/x86/sse.odin +++ b/core/simd/x86/sse.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 import "base:intrinsics" diff --git a/core/simd/x86/sse2.odin b/core/simd/x86/sse2.odin index 2e3eb8523..aaddbe6b4 100644 --- a/core/simd/x86/sse2.odin +++ b/core/simd/x86/sse2.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 import "base:intrinsics" diff --git a/core/simd/x86/sse3.odin b/core/simd/x86/sse3.odin index a905a7726..0e074c946 100644 --- a/core/simd/x86/sse3.odin +++ b/core/simd/x86/sse3.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 import "base:intrinsics" diff --git a/core/simd/x86/sse41.odin b/core/simd/x86/sse41.odin index c2c1abc2d..81089ed63 100644 --- a/core/simd/x86/sse41.odin +++ b/core/simd/x86/sse41.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 import "core:simd" diff --git a/core/simd/x86/sse42.odin b/core/simd/x86/sse42.odin index 7a674176b..1a5cb3f50 100644 --- a/core/simd/x86/sse42.odin +++ b/core/simd/x86/sse42.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 import "core:simd" diff --git a/core/simd/x86/ssse3.odin b/core/simd/x86/ssse3.odin index 2026c7f53..07c846e7b 100644 --- a/core/simd/x86/ssse3.odin +++ b/core/simd/x86/ssse3.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 import "base:intrinsics" diff --git a/core/simd/x86/types.odin b/core/simd/x86/types.odin index 06a2cd41e..ea0eff534 100644 --- a/core/simd/x86/types.odin +++ b/core/simd/x86/types.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package simd_x86 import "core:simd" diff --git a/core/slice/sort_private.odin b/core/slice/sort_private.odin index 487b51907..36637c4cd 100644 --- a/core/slice/sort_private.odin +++ b/core/slice/sort_private.odin @@ -1,4 +1,4 @@ -//+private +#+private package slice import "base:intrinsics" diff --git a/core/sync/futex_darwin.odin b/core/sync/futex_darwin.odin index fca9aadfe..5b5f53c20 100644 --- a/core/sync/futex_darwin.odin +++ b/core/sync/futex_darwin.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin +#+private +#+build darwin package sync import "core:c" diff --git a/core/sync/futex_freebsd.odin b/core/sync/futex_freebsd.odin index ac6e2400a..4fbb33ee0 100644 --- a/core/sync/futex_freebsd.odin +++ b/core/sync/futex_freebsd.odin @@ -1,5 +1,5 @@ -//+private -//+build freebsd +#+private +#+build freebsd package sync import "core:c" diff --git a/core/sync/futex_haiku.odin b/core/sync/futex_haiku.odin index 6fe5894a0..21d07b801 100644 --- a/core/sync/futex_haiku.odin +++ b/core/sync/futex_haiku.odin @@ -1,4 +1,4 @@ -//+private +#+private package sync import "core:c" diff --git a/core/sync/futex_linux.odin b/core/sync/futex_linux.odin index fe57c12ed..846a82486 100644 --- a/core/sync/futex_linux.odin +++ b/core/sync/futex_linux.odin @@ -1,5 +1,5 @@ -//+private -//+build linux +#+private +#+build linux package sync import "core:time" diff --git a/core/sync/futex_netbsd.odin b/core/sync/futex_netbsd.odin index d12409f32..b98346434 100644 --- a/core/sync/futex_netbsd.odin +++ b/core/sync/futex_netbsd.odin @@ -1,4 +1,4 @@ -//+private +#+private package sync import "base:intrinsics" diff --git a/core/sync/futex_openbsd.odin b/core/sync/futex_openbsd.odin index 4883a0841..83055b950 100644 --- a/core/sync/futex_openbsd.odin +++ b/core/sync/futex_openbsd.odin @@ -1,5 +1,5 @@ -//+private -//+build openbsd +#+private +#+build openbsd package sync import "core:c" diff --git a/core/sync/futex_wasm.odin b/core/sync/futex_wasm.odin index de88e8198..013c425e8 100644 --- a/core/sync/futex_wasm.odin +++ b/core/sync/futex_wasm.odin @@ -1,5 +1,5 @@ -//+private -//+build wasm32, wasm64p32 +#+private +#+build wasm32, wasm64p32 package sync import "base:intrinsics" diff --git a/core/sync/futex_windows.odin b/core/sync/futex_windows.odin index 6a26baf5b..bb9686a1a 100644 --- a/core/sync/futex_windows.odin +++ b/core/sync/futex_windows.odin @@ -1,5 +1,5 @@ -//+private -//+build windows +#+private +#+build windows package sync import "core:time" diff --git a/core/sync/primitives_darwin.odin b/core/sync/primitives_darwin.odin index 146f69e86..141cea744 100644 --- a/core/sync/primitives_darwin.odin +++ b/core/sync/primitives_darwin.odin @@ -1,5 +1,5 @@ -//+build darwin -//+private +#+build darwin +#+private package sync import "core:c" diff --git a/core/sync/primitives_freebsd.odin b/core/sync/primitives_freebsd.odin index 2d7cbf18d..fe6b11e72 100644 --- a/core/sync/primitives_freebsd.odin +++ b/core/sync/primitives_freebsd.odin @@ -1,5 +1,5 @@ -//+build freebsd -//+private +#+build freebsd +#+private package sync import "core:c" diff --git a/core/sync/primitives_haiku.odin b/core/sync/primitives_haiku.odin index 4b8f6b02d..69d005206 100644 --- a/core/sync/primitives_haiku.odin +++ b/core/sync/primitives_haiku.odin @@ -1,4 +1,4 @@ -//+private +#+private package sync import "core:sys/haiku" diff --git a/core/sync/primitives_internal.odin b/core/sync/primitives_internal.odin index 23483aef5..4478a77d2 100644 --- a/core/sync/primitives_internal.odin +++ b/core/sync/primitives_internal.odin @@ -1,4 +1,4 @@ -//+private +#+private package sync import "core:time" diff --git a/core/sync/primitives_linux.odin b/core/sync/primitives_linux.odin index aa7a8b4b2..bf04f8d99 100644 --- a/core/sync/primitives_linux.odin +++ b/core/sync/primitives_linux.odin @@ -1,5 +1,5 @@ -//+build linux -//+private +#+build linux +#+private package sync import "core:sys/linux" diff --git a/core/sync/primitives_netbsd.odin b/core/sync/primitives_netbsd.odin index 594f2ff5c..66da0745a 100644 --- a/core/sync/primitives_netbsd.odin +++ b/core/sync/primitives_netbsd.odin @@ -1,4 +1,4 @@ -//+private +#+private package sync foreign import libc "system:c" diff --git a/core/sync/primitives_openbsd.odin b/core/sync/primitives_openbsd.odin index ff3ff837f..1f6efd8f7 100644 --- a/core/sync/primitives_openbsd.odin +++ b/core/sync/primitives_openbsd.odin @@ -1,5 +1,5 @@ -//+build openbsd -//+private +#+build openbsd +#+private package sync foreign import libc "system:c" diff --git a/core/sync/primitives_wasm.odin b/core/sync/primitives_wasm.odin index f8d9ab657..8906d96be 100644 --- a/core/sync/primitives_wasm.odin +++ b/core/sync/primitives_wasm.odin @@ -1,5 +1,5 @@ -//+private -//+build wasm32, wasm64p32 +#+private +#+build wasm32, wasm64p32 package sync _current_thread_id :: proc "contextless" () -> int { diff --git a/core/sync/primitives_windows.odin b/core/sync/primitives_windows.odin index 9f5bfc280..744bc248b 100644 --- a/core/sync/primitives_windows.odin +++ b/core/sync/primitives_windows.odin @@ -1,5 +1,5 @@ -//+build windows -//+private +#+build windows +#+private package sync import "core:time" diff --git a/core/sys/darwin/darwin.odin b/core/sys/darwin/darwin.odin index ddd25a76c..d109f5544 100644 --- a/core/sys/darwin/darwin.odin +++ b/core/sys/darwin/darwin.odin @@ -1,4 +1,4 @@ -//+build darwin +#+build darwin package darwin import "core:c" diff --git a/core/sys/haiku/errors.odin b/core/sys/haiku/errors.odin index 023045001..febe647ea 100644 --- a/core/sys/haiku/errors.odin +++ b/core/sys/haiku/errors.odin @@ -1,4 +1,4 @@ -//+build haiku +#+build haiku package sys_haiku import "core:c" diff --git a/core/sys/haiku/find_directory.odin b/core/sys/haiku/find_directory.odin index 103e677d7..758c4dff4 100644 --- a/core/sys/haiku/find_directory.odin +++ b/core/sys/haiku/find_directory.odin @@ -1,4 +1,4 @@ -//+build haiku +#+build haiku package sys_haiku import "core:c" diff --git a/core/sys/haiku/os.odin b/core/sys/haiku/os.odin index 883072c2d..6ab3ef573 100644 --- a/core/sys/haiku/os.odin +++ b/core/sys/haiku/os.odin @@ -1,4 +1,4 @@ -//+build haiku +#+build haiku package sys_haiku import "core:c" diff --git a/core/sys/haiku/types.odin b/core/sys/haiku/types.odin index 0440d5a98..47755b0b7 100644 --- a/core/sys/haiku/types.odin +++ b/core/sys/haiku/types.odin @@ -1,4 +1,4 @@ -//+build haiku +#+build haiku package sys_haiku import "core:c" diff --git a/core/sys/info/cpu_arm.odin b/core/sys/info/cpu_arm.odin index aa4bb368a..960e55a56 100644 --- a/core/sys/info/cpu_arm.odin +++ b/core/sys/info/cpu_arm.odin @@ -1,4 +1,4 @@ -//+build arm32, arm64 +#+build arm32, arm64 package sysinfo import "core:sys/unix" diff --git a/core/sys/info/cpu_intel.odin b/core/sys/info/cpu_intel.odin index 73d4c15e7..d6fa98507 100644 --- a/core/sys/info/cpu_intel.odin +++ b/core/sys/info/cpu_intel.odin @@ -1,4 +1,4 @@ -//+build i386, amd64 +#+build i386, amd64 package sysinfo import "base:intrinsics" diff --git a/core/sys/info/cpu_linux_arm.odin b/core/sys/info/cpu_linux_arm.odin index dcc252971..6408decb7 100644 --- a/core/sys/info/cpu_linux_arm.odin +++ b/core/sys/info/cpu_linux_arm.odin @@ -1,5 +1,5 @@ -//+build arm32, arm64 -//+build linux +#+build arm32, arm64 +#+build linux package sysinfo import "core:sys/linux" diff --git a/core/sys/info/cpu_linux_riscv64.odin b/core/sys/info/cpu_linux_riscv64.odin index 0b64c3725..84f6134d4 100644 --- a/core/sys/info/cpu_linux_riscv64.odin +++ b/core/sys/info/cpu_linux_riscv64.odin @@ -1,5 +1,5 @@ -//+build riscv64 -//+build linux +#+build riscv64 +#+build linux package sysinfo import "base:intrinsics" diff --git a/core/sys/info/platform_bsd.odin b/core/sys/info/platform_bsd.odin index e2273d253..6bb32cd3d 100644 --- a/core/sys/info/platform_bsd.odin +++ b/core/sys/info/platform_bsd.odin @@ -1,4 +1,4 @@ -//+build openbsd, netbsd +#+build openbsd, netbsd package sysinfo import sys "core:sys/unix" diff --git a/core/sys/kqueue/kqueue.odin b/core/sys/kqueue/kqueue.odin index 27d1ecaae..56be1cf7a 100644 --- a/core/sys/kqueue/kqueue.odin +++ b/core/sys/kqueue/kqueue.odin @@ -1,4 +1,4 @@ -//+build darwin, netbsd, openbsd, freebsd +#+build darwin, netbsd, openbsd, freebsd package kqueue when ODIN_OS == .Darwin { diff --git a/core/sys/linux/helpers.odin b/core/sys/linux/helpers.odin index f1abbbf61..aefc1179e 100644 --- a/core/sys/linux/helpers.odin +++ b/core/sys/linux/helpers.odin @@ -1,5 +1,5 @@ -//+build linux -//+no-instrumentation +#+build linux +#+no-instrumentation package linux import "base:intrinsics" diff --git a/core/sys/linux/sys.odin b/core/sys/linux/sys.odin index 5ee07a93d..2caa3ab65 100644 --- a/core/sys/linux/sys.odin +++ b/core/sys/linux/sys.odin @@ -1,4 +1,4 @@ -//+no-instrumentation +#+no-instrumentation package linux import "base:intrinsics" diff --git a/core/sys/linux/syscall_amd64.odin b/core/sys/linux/syscall_amd64.odin index ee4e16280..31c8ed61c 100644 --- a/core/sys/linux/syscall_amd64.odin +++ b/core/sys/linux/syscall_amd64.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package linux // AMD64 uses the new way to define syscalls, i.e. one that diff --git a/core/sys/linux/syscall_arm32.odin b/core/sys/linux/syscall_arm32.odin index 74640a1a3..731ce36a5 100644 --- a/core/sys/linux/syscall_arm32.odin +++ b/core/sys/linux/syscall_arm32.odin @@ -1,4 +1,4 @@ -//+build arm32 +#+build arm32 package linux // This file was taken and transformed from diff --git a/core/sys/linux/syscall_arm64.odin b/core/sys/linux/syscall_arm64.odin index 61b5a31b7..da8eb45da 100644 --- a/core/sys/linux/syscall_arm64.odin +++ b/core/sys/linux/syscall_arm64.odin @@ -1,4 +1,4 @@ -//+build arm64 +#+build arm64 package linux // Syscalls for arm64 are defined using the new way, i.e. differently from diff --git a/core/sys/linux/syscall_i386.odin b/core/sys/linux/syscall_i386.odin index 4609fc99c..affdff02c 100644 --- a/core/sys/linux/syscall_i386.odin +++ b/core/sys/linux/syscall_i386.odin @@ -1,4 +1,4 @@ -//+build i386 +#+build i386 package linux // The numbers are taken from diff --git a/core/sys/linux/syscall_riscv64.odin b/core/sys/linux/syscall_riscv64.odin index d2fd0c2ff..17845c5ed 100644 --- a/core/sys/linux/syscall_riscv64.odin +++ b/core/sys/linux/syscall_riscv64.odin @@ -1,4 +1,4 @@ -//+build riscv64 +#+build riscv64 package linux // https://github.com/riscv-collab/riscv-gnu-toolchain/blob/master/linux-headers/include/asm-generic/unistd.h diff --git a/core/sys/linux/wrappers.odin b/core/sys/linux/wrappers.odin index 7a30c3bde..4f6118c80 100644 --- a/core/sys/linux/wrappers.odin +++ b/core/sys/linux/wrappers.odin @@ -1,4 +1,4 @@ -//+build linux +#+build linux package linux /// Low 8 bits of the exit code diff --git a/core/sys/unix/pthread_darwin.odin b/core/sys/unix/pthread_darwin.odin index 378fa9309..eb2cc4c9f 100644 --- a/core/sys/unix/pthread_darwin.odin +++ b/core/sys/unix/pthread_darwin.odin @@ -1,4 +1,4 @@ -//+build darwin +#+build darwin package unix import "core:c" diff --git a/core/sys/unix/pthread_freebsd.odin b/core/sys/unix/pthread_freebsd.odin index 5f4dac289..38fe7db55 100644 --- a/core/sys/unix/pthread_freebsd.odin +++ b/core/sys/unix/pthread_freebsd.odin @@ -1,4 +1,4 @@ -//+build freebsd +#+build freebsd package unix import "core:c" diff --git a/core/sys/unix/pthread_linux.odin b/core/sys/unix/pthread_linux.odin index f4ded7464..d67add24b 100644 --- a/core/sys/unix/pthread_linux.odin +++ b/core/sys/unix/pthread_linux.odin @@ -1,4 +1,4 @@ -//+build linux +#+build linux package unix import "core:c" diff --git a/core/sys/unix/pthread_openbsd.odin b/core/sys/unix/pthread_openbsd.odin index 855e7d99c..2c6d9e598 100644 --- a/core/sys/unix/pthread_openbsd.odin +++ b/core/sys/unix/pthread_openbsd.odin @@ -1,4 +1,4 @@ -//+build openbsd +#+build openbsd package unix import "core:c" diff --git a/core/sys/unix/pthread_unix.odin b/core/sys/unix/pthread_unix.odin index 26a21e629..43c4866ed 100644 --- a/core/sys/unix/pthread_unix.odin +++ b/core/sys/unix/pthread_unix.odin @@ -1,4 +1,4 @@ -//+build linux, darwin, freebsd, openbsd, netbsd, haiku +#+build linux, darwin, freebsd, openbsd, netbsd, haiku package unix foreign import "system:pthread" diff --git a/core/sys/unix/sysctl_darwin.odin b/core/sys/unix/sysctl_darwin.odin index 92222bdfe..32dd720b0 100644 --- a/core/sys/unix/sysctl_darwin.odin +++ b/core/sys/unix/sysctl_darwin.odin @@ -1,4 +1,4 @@ -//+build darwin +#+build darwin package unix import "base:intrinsics" diff --git a/core/sys/unix/sysctl_freebsd.odin b/core/sys/unix/sysctl_freebsd.odin index 8ca40ef1b..f5fee6c6c 100644 --- a/core/sys/unix/sysctl_freebsd.odin +++ b/core/sys/unix/sysctl_freebsd.odin @@ -1,4 +1,4 @@ -//+build freebsd +#+build freebsd package unix import "base:intrinsics" diff --git a/core/sys/unix/sysctl_openbsd.odin b/core/sys/unix/sysctl_openbsd.odin index b93e8f9bd..49c9b6336 100644 --- a/core/sys/unix/sysctl_openbsd.odin +++ b/core/sys/unix/sysctl_openbsd.odin @@ -1,4 +1,4 @@ -//+build openbsd +#+build openbsd package unix import "core:c" diff --git a/core/sys/valgrind/callgrind.odin b/core/sys/valgrind/callgrind.odin index b1ba8c6e9..5cd58753a 100644 --- a/core/sys/valgrind/callgrind.odin +++ b/core/sys/valgrind/callgrind.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package sys_valgrind import "base:intrinsics" diff --git a/core/sys/valgrind/helgrind.odin b/core/sys/valgrind/helgrind.odin index 2f0114522..3f5e7a531 100644 --- a/core/sys/valgrind/helgrind.odin +++ b/core/sys/valgrind/helgrind.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package sys_valgrind import "base:intrinsics" diff --git a/core/sys/valgrind/memcheck.odin b/core/sys/valgrind/memcheck.odin index dfbe4c3be..bc77444be 100644 --- a/core/sys/valgrind/memcheck.odin +++ b/core/sys/valgrind/memcheck.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package sys_valgrind import "base:intrinsics" diff --git a/core/sys/valgrind/valgrind.odin b/core/sys/valgrind/valgrind.odin index d0c46af53..b5c71664f 100644 --- a/core/sys/valgrind/valgrind.odin +++ b/core/sys/valgrind/valgrind.odin @@ -1,4 +1,4 @@ -//+build amd64 +#+build amd64 package sys_valgrind import "base:intrinsics" diff --git a/core/sys/wasm/wasi/wasi_api.odin b/core/sys/wasm/wasi/wasi_api.odin index 38d95e754..8d50f1690 100644 --- a/core/sys/wasm/wasi/wasi_api.odin +++ b/core/sys/wasm/wasi/wasi_api.odin @@ -1,4 +1,4 @@ -//+build wasm32 +#+build wasm32 package sys_wasi foreign import wasi "wasi_snapshot_preview1" diff --git a/core/sys/windows/advapi32.odin b/core/sys/windows/advapi32.odin index 1e34f1fd6..f834511d4 100644 --- a/core/sys/windows/advapi32.odin +++ b/core/sys/windows/advapi32.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import advapi32 "system:Advapi32.lib" diff --git a/core/sys/windows/bcrypt.odin b/core/sys/windows/bcrypt.odin index d891aa92b..f15f1e305 100644 --- a/core/sys/windows/bcrypt.odin +++ b/core/sys/windows/bcrypt.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import bcrypt "system:Bcrypt.lib" diff --git a/core/sys/windows/bluetooth.odin b/core/sys/windows/bluetooth.odin index 7bfb7ea96..86c66b9a1 100644 --- a/core/sys/windows/bluetooth.odin +++ b/core/sys/windows/bluetooth.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import "system:bthprops.lib" diff --git a/core/sys/windows/codepage.odin b/core/sys/windows/codepage.odin index 90040f1ee..527289f03 100644 --- a/core/sys/windows/codepage.odin +++ b/core/sys/windows/codepage.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows // https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers diff --git a/core/sys/windows/comctl32.odin b/core/sys/windows/comctl32.odin index 9c4404a9d..477800413 100644 --- a/core/sys/windows/comctl32.odin +++ b/core/sys/windows/comctl32.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import "system:Comctl32.lib" diff --git a/core/sys/windows/comdlg32.odin b/core/sys/windows/comdlg32.odin index 30d9b169c..a9800b47a 100644 --- a/core/sys/windows/comdlg32.odin +++ b/core/sys/windows/comdlg32.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import "system:Comdlg32.lib" diff --git a/core/sys/windows/dbghelp.odin b/core/sys/windows/dbghelp.odin index cb5458248..336992b4a 100644 --- a/core/sys/windows/dbghelp.odin +++ b/core/sys/windows/dbghelp.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import "system:Dbghelp.lib" diff --git a/core/sys/windows/dnsapi.odin b/core/sys/windows/dnsapi.odin index dd2d1acee..4fd9f7a19 100644 --- a/core/sys/windows/dnsapi.odin +++ b/core/sys/windows/dnsapi.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import "system:Dnsapi.lib" diff --git a/core/sys/windows/dwmapi.odin b/core/sys/windows/dwmapi.odin index d0ffc6b46..11a46f53a 100644 --- a/core/sys/windows/dwmapi.odin +++ b/core/sys/windows/dwmapi.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import dwmapi "system:Dwmapi.lib" diff --git a/core/sys/windows/gdi32.odin b/core/sys/windows/gdi32.odin index 5cbafddba..1d7a93d85 100644 --- a/core/sys/windows/gdi32.odin +++ b/core/sys/windows/gdi32.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows import "core:math/fixed" diff --git a/core/sys/windows/hidpi.odin b/core/sys/windows/hidpi.odin index bea03694e..5e9787527 100644 --- a/core/sys/windows/hidpi.odin +++ b/core/sys/windows/hidpi.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows import "core:c" diff --git a/core/sys/windows/hidusage.odin b/core/sys/windows/hidusage.odin index a32aa7b9f..eb2a85f2e 100644 --- a/core/sys/windows/hidusage.odin +++ b/core/sys/windows/hidusage.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows USAGE :: distinct USHORT diff --git a/core/sys/windows/ip_helper.odin b/core/sys/windows/ip_helper.odin index 4c2534c10..7a6e545ac 100644 --- a/core/sys/windows/ip_helper.odin +++ b/core/sys/windows/ip_helper.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import "system:iphlpapi.lib" diff --git a/core/sys/windows/kernel32.odin b/core/sys/windows/kernel32.odin index 81db67185..2771581e6 100644 --- a/core/sys/windows/kernel32.odin +++ b/core/sys/windows/kernel32.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import kernel32 "system:Kernel32.lib" diff --git a/core/sys/windows/key_codes.odin b/core/sys/windows/key_codes.odin index 284b0e437..0991ca4b3 100644 --- a/core/sys/windows/key_codes.odin +++ b/core/sys/windows/key_codes.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows // https://docs.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input diff --git a/core/sys/windows/known_folders.odin b/core/sys/windows/known_folders.odin index 439d65faf..cbaf5eeeb 100644 --- a/core/sys/windows/known_folders.odin +++ b/core/sys/windows/known_folders.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows FOLDERID_NetworkFolder :: GUID {0xD20BEEC4, 0x5CA8, 0x4905, {0xAE, 0x3B, 0xBF, 0x25, 0x1E, 0xA0, 0x9B, 0x53}} diff --git a/core/sys/windows/netapi32.odin b/core/sys/windows/netapi32.odin index d9f75c623..9442193ca 100644 --- a/core/sys/windows/netapi32.odin +++ b/core/sys/windows/netapi32.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import netapi32 "system:Netapi32.lib" diff --git a/core/sys/windows/ntdll.odin b/core/sys/windows/ntdll.odin index 23444ff34..747130749 100644 --- a/core/sys/windows/ntdll.odin +++ b/core/sys/windows/ntdll.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import ntdll_lib "system:ntdll.lib" diff --git a/core/sys/windows/shcore.odin b/core/sys/windows/shcore.odin index 54f67989e..08a76ebe6 100644 --- a/core/sys/windows/shcore.odin +++ b/core/sys/windows/shcore.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows diff --git a/core/sys/windows/shell32.odin b/core/sys/windows/shell32.odin index 7340ae4d4..54cee718c 100644 --- a/core/sys/windows/shell32.odin +++ b/core/sys/windows/shell32.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import shell32 "system:Shell32.lib" diff --git a/core/sys/windows/shlwapi.odin b/core/sys/windows/shlwapi.odin index bf9d2d1e8..095fff304 100644 --- a/core/sys/windows/shlwapi.odin +++ b/core/sys/windows/shlwapi.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import shlwapi "system:shlwapi.lib" diff --git a/core/sys/windows/synchronization.odin b/core/sys/windows/synchronization.odin index 79efaab34..bcaeb3f5f 100644 --- a/core/sys/windows/synchronization.odin +++ b/core/sys/windows/synchronization.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import Synchronization "system:Synchronization.lib" diff --git a/core/sys/windows/system_params.odin b/core/sys/windows/system_params.odin index e94d777bf..e463feb7e 100644 --- a/core/sys/windows/system_params.odin +++ b/core/sys/windows/system_params.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows // Parameter for SystemParametersInfo. diff --git a/core/sys/windows/tlhelp.odin b/core/sys/windows/tlhelp.odin index 45d5a3ff9..006c9c330 100644 --- a/core/sys/windows/tlhelp.odin +++ b/core/sys/windows/tlhelp.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package sys_windows foreign import kernel32 "system:Kernel32.lib" diff --git a/core/sys/windows/user32.odin b/core/sys/windows/user32.odin index e13dcd55f..514592e7b 100644 --- a/core/sys/windows/user32.odin +++ b/core/sys/windows/user32.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows import "base:intrinsics" diff --git a/core/sys/windows/userenv.odin b/core/sys/windows/userenv.odin index a31e363e1..2a2209d2c 100644 --- a/core/sys/windows/userenv.odin +++ b/core/sys/windows/userenv.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import userenv "system:Userenv.lib" diff --git a/core/sys/windows/util.odin b/core/sys/windows/util.odin index 929df1765..b3eb800bc 100644 --- a/core/sys/windows/util.odin +++ b/core/sys/windows/util.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows import "base:runtime" diff --git a/core/sys/windows/ux_theme.odin b/core/sys/windows/ux_theme.odin index 7af399361..527abd62f 100644 --- a/core/sys/windows/ux_theme.odin +++ b/core/sys/windows/ux_theme.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import uxtheme "system:UxTheme.lib" diff --git a/core/sys/windows/wgl.odin b/core/sys/windows/wgl.odin index d0d96d90b..8fea55c3d 100644 --- a/core/sys/windows/wgl.odin +++ b/core/sys/windows/wgl.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows import "core:c" diff --git a/core/sys/windows/wglext.odin b/core/sys/windows/wglext.odin index 0c4b51d65..4c76b39ec 100644 --- a/core/sys/windows/wglext.odin +++ b/core/sys/windows/wglext.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows // WGL_ARB_buffer_region diff --git a/core/sys/windows/window_messages.odin b/core/sys/windows/window_messages.odin index 888c5ccf9..d69771bdf 100644 --- a/core/sys/windows/window_messages.odin +++ b/core/sys/windows/window_messages.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows WM_NULL :: 0x0000 diff --git a/core/sys/windows/winerror.odin b/core/sys/windows/winerror.odin index d3df3b815..b3b470619 100644 --- a/core/sys/windows/winerror.odin +++ b/core/sys/windows/winerror.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows // https://learn.microsoft.com/en-us/windows/win32/api/winerror/ diff --git a/core/sys/windows/winmm.odin b/core/sys/windows/winmm.odin index a1786c27a..3c7ec80e7 100644 --- a/core/sys/windows/winmm.odin +++ b/core/sys/windows/winmm.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import winmm "system:Winmm.lib" diff --git a/core/sys/windows/winnls.odin b/core/sys/windows/winnls.odin index 292d2fad2..ffb2638d5 100644 --- a/core/sys/windows/winnls.odin +++ b/core/sys/windows/winnls.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows LCTYPE :: distinct DWORD diff --git a/core/sys/windows/winver.odin b/core/sys/windows/winver.odin index 091d53d3a..47751dab7 100644 --- a/core/sys/windows/winver.odin +++ b/core/sys/windows/winver.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows foreign import version "system:version.lib" diff --git a/core/sys/windows/wow64_apiset.odin b/core/sys/windows/wow64_apiset.odin index 28558e9ca..3d29b786e 100644 --- a/core/sys/windows/wow64_apiset.odin +++ b/core/sys/windows/wow64_apiset.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package sys_windows foreign import kernel32 "system:Kernel32.lib" diff --git a/core/sys/windows/ws2_32.odin b/core/sys/windows/ws2_32.odin index e9bf8abc9..5b2952495 100644 --- a/core/sys/windows/ws2_32.odin +++ b/core/sys/windows/ws2_32.odin @@ -1,4 +1,4 @@ -// +build windows +#+build windows package sys_windows // Define flags to be used with the WSAAsyncSelect() call. diff --git a/core/testing/events.odin b/core/testing/events.odin index c9c4b0271..1a47e2d68 100644 --- a/core/testing/events.odin +++ b/core/testing/events.odin @@ -1,4 +1,4 @@ -//+private +#+private package testing /* diff --git a/core/testing/logging.odin b/core/testing/logging.odin index 1c3fc4603..041489dab 100644 --- a/core/testing/logging.odin +++ b/core/testing/logging.odin @@ -1,4 +1,4 @@ -//+private +#+private package testing /* diff --git a/core/testing/reporting.odin b/core/testing/reporting.odin index 81f1d0646..6752cd79b 100644 --- a/core/testing/reporting.odin +++ b/core/testing/reporting.odin @@ -1,4 +1,4 @@ -//+private +#+private package testing /* diff --git a/core/testing/runner.odin b/core/testing/runner.odin index 386ba8cb5..683db9d15 100644 --- a/core/testing/runner.odin +++ b/core/testing/runner.odin @@ -1,4 +1,4 @@ -//+private +#+private package testing /* diff --git a/core/testing/signal_handler.odin b/core/testing/signal_handler.odin index 047ea0b3a..2f1f7c89a 100644 --- a/core/testing/signal_handler.odin +++ b/core/testing/signal_handler.odin @@ -1,4 +1,4 @@ -//+private +#+private package testing /* diff --git a/core/testing/signal_handler_libc.odin b/core/testing/signal_handler_libc.odin index 27d1a0735..b665b047c 100644 --- a/core/testing/signal_handler_libc.odin +++ b/core/testing/signal_handler_libc.odin @@ -1,5 +1,5 @@ -//+private -//+build windows, linux, darwin, freebsd, openbsd, netbsd, haiku +#+private +#+build windows, linux, darwin, freebsd, openbsd, netbsd, haiku package testing /* diff --git a/core/testing/signal_handler_other.odin b/core/testing/signal_handler_other.odin index d6d494fa4..81f575495 100644 --- a/core/testing/signal_handler_other.odin +++ b/core/testing/signal_handler_other.odin @@ -1,11 +1,11 @@ -//+private -//+build !windows -//+build !linux -//+build !darwin -//+build !freebsd -//+build !openbsd -//+build !netbsd -//+build !haiku +#+private +#+build !windows +#+build !linux +#+build !darwin +#+build !freebsd +#+build !openbsd +#+build !netbsd +#+build !haiku package testing /* diff --git a/core/thread/thread_other.odin b/core/thread/thread_other.odin index 34bbfda08..dde2a8e48 100644 --- a/core/thread/thread_other.odin +++ b/core/thread/thread_other.odin @@ -1,4 +1,4 @@ -//+build js, wasi, orca +#+build js, wasi, orca package thread import "base:intrinsics" diff --git a/core/thread/thread_unix.odin b/core/thread/thread_unix.odin index ddc47244c..2e196c3e6 100644 --- a/core/thread/thread_unix.odin +++ b/core/thread/thread_unix.odin @@ -1,5 +1,5 @@ -// +build linux, darwin, freebsd, openbsd, netbsd, haiku -// +private +#+build linux, darwin, freebsd, openbsd, netbsd, haiku +#+private package thread import "base:runtime" diff --git a/core/thread/thread_windows.odin b/core/thread/thread_windows.odin index 50a4e5fbc..300673191 100644 --- a/core/thread/thread_windows.odin +++ b/core/thread/thread_windows.odin @@ -1,5 +1,5 @@ -//+build windows -//+private +#+build windows +#+private package thread import "base:intrinsics" diff --git a/core/time/datetime/internal.odin b/core/time/datetime/internal.odin index e7129548e..3477a47f3 100644 --- a/core/time/datetime/internal.odin +++ b/core/time/datetime/internal.odin @@ -1,4 +1,4 @@ -//+private +#+private package datetime // Internal helper functions for calendrical conversions diff --git a/core/time/time_essence.odin b/core/time/time_essence.odin index b7bc616d8..89883f0b9 100644 --- a/core/time/time_essence.odin +++ b/core/time/time_essence.odin @@ -1,4 +1,4 @@ -//+private +#+private package time import "core:sys/es" diff --git a/core/time/time_js.odin b/core/time/time_js.odin index c5090df90..9175fbfe9 100644 --- a/core/time/time_js.odin +++ b/core/time/time_js.odin @@ -1,5 +1,5 @@ -//+private -//+build js +#+private +#+build js package time foreign import "odin_env" diff --git a/core/time/time_orca.odin b/core/time/time_orca.odin index b2598fd6e..f529790a5 100644 --- a/core/time/time_orca.odin +++ b/core/time/time_orca.odin @@ -1,5 +1,5 @@ -//+private -//+build orca +#+private +#+build orca package time import "base:intrinsics" diff --git a/core/time/time_other.odin b/core/time/time_other.odin index 164d23f25..d89bcbd42 100644 --- a/core/time/time_other.odin +++ b/core/time/time_other.odin @@ -1,14 +1,14 @@ -//+private -//+build !essence -//+build !js -//+build !linux -//+build !openbsd -//+build !freebsd -//+build !netbsd -//+build !darwin -//+build !wasi -//+build !windows -//+build !orca +#+private +#+build !essence +#+build !js +#+build !linux +#+build !openbsd +#+build !freebsd +#+build !netbsd +#+build !darwin +#+build !wasi +#+build !windows +#+build !orca package time _IS_SUPPORTED :: false diff --git a/core/time/time_unix.odin b/core/time/time_unix.odin index 0d7a43aba..61c4e91d3 100644 --- a/core/time/time_unix.odin +++ b/core/time/time_unix.odin @@ -1,5 +1,5 @@ -//+private -//+build darwin, freebsd, openbsd, netbsd +#+private +#+build darwin, freebsd, openbsd, netbsd package time import "core:sys/posix" diff --git a/core/time/time_wasi.odin b/core/time/time_wasi.odin index 88bebe2e3..c16c40cce 100644 --- a/core/time/time_wasi.odin +++ b/core/time/time_wasi.odin @@ -1,5 +1,5 @@ -//+private -//+build wasi +#+private +#+build wasi package time import "base:intrinsics" diff --git a/core/time/time_windows.odin b/core/time/time_windows.odin index 378b914b0..553ea6d4e 100644 --- a/core/time/time_windows.odin +++ b/core/time/time_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package time import win32 "core:sys/windows" diff --git a/core/time/tsc_darwin.odin b/core/time/tsc_darwin.odin index 841c0b692..3726cff49 100644 --- a/core/time/tsc_darwin.odin +++ b/core/time/tsc_darwin.odin @@ -1,4 +1,4 @@ -//+private +#+private package time import "core:sys/unix" diff --git a/core/time/tsc_freebsd.odin b/core/time/tsc_freebsd.odin index f4d6ccc3a..dabcb69cb 100644 --- a/core/time/tsc_freebsd.odin +++ b/core/time/tsc_freebsd.odin @@ -1,5 +1,5 @@ -//+private -//+build freebsd +#+private +#+build freebsd package time import "core:c" diff --git a/core/time/tsc_linux.odin b/core/time/tsc_linux.odin index 77a79fe52..a83634414 100644 --- a/core/time/tsc_linux.odin +++ b/core/time/tsc_linux.odin @@ -1,5 +1,5 @@ -//+private -//+build linux +#+private +#+build linux package time import linux "core:sys/linux" diff --git a/examples/all/all_experimental.odin b/examples/all/all_experimental.odin index cd60c269c..1d4eb4bb9 100644 --- a/examples/all/all_experimental.odin +++ b/examples/all/all_experimental.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package all import c_tokenizer "core:c/frontend/tokenizer" diff --git a/examples/all/all_linux.odin b/examples/all/all_linux.odin index 18bba951c..ca51d6562 100644 --- a/examples/all/all_linux.odin +++ b/examples/all/all_linux.odin @@ -1,4 +1,4 @@ -//+build linux +#+build linux package all import linux "core:sys/linux" diff --git a/examples/all/all_posix.odin b/examples/all/all_posix.odin index 819dd6dd3..76fac0b87 100644 --- a/examples/all/all_posix.odin +++ b/examples/all/all_posix.odin @@ -1,4 +1,4 @@ -//+build darwin, openbsd, freebsd, netbsd +#+build darwin, openbsd, freebsd, netbsd package all import posix "core:sys/posix" diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin index d66d1ceb0..4b761f0e2 100644 --- a/examples/demo/demo.odin +++ b/examples/demo/demo.odin @@ -1,4 +1,4 @@ -//+vet !using-stmt !using-param +#+vet !using-stmt !using-param package main import "core:fmt" diff --git a/tests/core/net/test_core_net.odin b/tests/core/net/test_core_net.odin index 8a9272882..a6e299bcc 100644 --- a/tests/core/net/test_core_net.odin +++ b/tests/core/net/test_core_net.odin @@ -10,8 +10,8 @@ A test suite for `core:net` */ -//+build !netbsd -//+build !openbsd +#+build !netbsd +#+build !openbsd package test_core_net import "core:testing" diff --git a/tests/core/net/test_core_net_freebsd.odin b/tests/core/net/test_core_net_freebsd.odin index 61e801f2b..39e364e80 100644 --- a/tests/core/net/test_core_net_freebsd.odin +++ b/tests/core/net/test_core_net_freebsd.odin @@ -10,7 +10,7 @@ A test suite for `core:net` */ -//+build freebsd +#+build freebsd package test_core_net import "core:net" diff --git a/tests/core/odin/test_file_tags.odin b/tests/core/odin/test_file_tags.odin index 4af1afc75..dc004dfe3 100644 --- a/tests/core/odin/test_file_tags.odin +++ b/tests/core/odin/test_file_tags.odin @@ -34,8 +34,8 @@ package main }, }, {// [2] src = ` -//+build linux, darwin, freebsd, openbsd, netbsd, haiku -//+build arm32, arm64 +#+build linux, darwin, freebsd, openbsd, netbsd, haiku +#+build arm32, arm64 package main `, tags = { @@ -57,10 +57,10 @@ package main }, }, {// [3] src = ` -// +private -//+lazy -// +no-instrumentation -//+ignore +#+private +#+lazy +#+no-instrumentation +#+ignore // some other comment package main `, @@ -75,8 +75,8 @@ package main }, }, {// [4] src = ` -//+build-project-name foo !bar, baz -//+build js wasm32, js wasm64p32 +#+build-project-name foo !bar, baz +#+build js wasm32, js wasm64p32 package main `, tags = { diff --git a/tests/core/sys/posix/posix.odin b/tests/core/sys/posix/posix.odin index fa30d1601..760ddc1fb 100644 --- a/tests/core/sys/posix/posix.odin +++ b/tests/core/sys/posix/posix.odin @@ -1,4 +1,4 @@ -//+build darwin, freebsd, openbsd, netbsd +#+build darwin, freebsd, openbsd, netbsd package tests_core_posix import "base:runtime" diff --git a/tests/core/sys/posix/structs.odin b/tests/core/sys/posix/structs.odin index bdb1c24e3..0234e41c0 100644 --- a/tests/core/sys/posix/structs.odin +++ b/tests/core/sys/posix/structs.odin @@ -1,4 +1,4 @@ -//+build darwin, freebsd, openbsd, netbsd +#+build darwin, freebsd, openbsd, netbsd package tests_core_posix import "core:log" diff --git a/tests/core/sys/windows/test_clipboard.odin b/tests/core/sys/windows/test_clipboard.odin index 67fa6e4a2..dc482f2f8 100644 --- a/tests/core/sys/windows/test_clipboard.odin +++ b/tests/core/sys/windows/test_clipboard.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package test_core_sys_windows import "core:testing" diff --git a/tests/core/sys/windows/test_kernel32.odin b/tests/core/sys/windows/test_kernel32.odin index 81331fc9f..f6a88c769 100644 --- a/tests/core/sys/windows/test_kernel32.odin +++ b/tests/core/sys/windows/test_kernel32.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package test_core_sys_windows import "base:intrinsics" diff --git a/tests/core/sys/windows/test_ole32.odin b/tests/core/sys/windows/test_ole32.odin index 30bf5bc80..8be231e1f 100644 --- a/tests/core/sys/windows/test_ole32.odin +++ b/tests/core/sys/windows/test_ole32.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package test_core_sys_windows import "base:intrinsics" diff --git a/tests/core/sys/windows/test_user32.odin b/tests/core/sys/windows/test_user32.odin index 0778fdf41..2fe849a6b 100644 --- a/tests/core/sys/windows/test_user32.odin +++ b/tests/core/sys/windows/test_user32.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package test_core_sys_windows import "core:testing" diff --git a/tests/core/sys/windows/test_windows.odin b/tests/core/sys/windows/test_windows.odin index 724b1b7af..cab36af36 100644 --- a/tests/core/sys/windows/test_windows.odin +++ b/tests/core/sys/windows/test_windows.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package test_core_sys_windows import "base:intrinsics" diff --git a/tests/core/sys/windows/test_windows_generated.odin b/tests/core/sys/windows/test_windows_generated.odin index 13d09f4e1..3d8184a8b 100644 --- a/tests/core/sys/windows/test_windows_generated.odin +++ b/tests/core/sys/windows/test_windows_generated.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package test_core_sys_windows // generated by win32gen import "core:testing" diff --git a/tests/core/sys/windows/test_winerror.odin b/tests/core/sys/windows/test_winerror.odin index adbdb7ce1..baabae52b 100644 --- a/tests/core/sys/windows/test_winerror.odin +++ b/tests/core/sys/windows/test_winerror.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package test_core_sys_windows import "core:testing" diff --git a/tests/vendor/glfw/test_vendor_glfw.odin b/tests/vendor/glfw/test_vendor_glfw.odin index 8a7fb0d0a..c1a75f1a8 100644 --- a/tests/vendor/glfw/test_vendor_glfw.odin +++ b/tests/vendor/glfw/test_vendor_glfw.odin @@ -1,4 +1,4 @@ -//+build darwin, windows +#+build darwin, windows package test_vendor_glfw import "core:testing" diff --git a/tests/vendor/lua/5.4/test_vendor_lua.5.4.odin b/tests/vendor/lua/5.4/test_vendor_lua.5.4.odin index e331200ea..e5edca540 100644 --- a/tests/vendor/lua/5.4/test_vendor_lua.5.4.odin +++ b/tests/vendor/lua/5.4/test_vendor_lua.5.4.odin @@ -1,4 +1,4 @@ -//+build windows, linux, darwin +#+build windows, linux, darwin package test_vendor_lua_54 import "core:testing" diff --git a/vendor/ENet/unix.odin b/vendor/ENet/unix.odin index 1cbda5974..210e64394 100644 --- a/vendor/ENet/unix.odin +++ b/vendor/ENet/unix.odin @@ -1,4 +1,4 @@ -//+build linux, darwin, freebsd, openbsd, netbsd +#+build linux, darwin, freebsd, openbsd, netbsd package ENet // When we implement the appropriate bindings for Unix, the section separated diff --git a/vendor/ENet/win32.odin b/vendor/ENet/win32.odin index 0a1997ff9..f5a1c8985 100644 --- a/vendor/ENet/win32.odin +++ b/vendor/ENet/win32.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package ENet // When we implement the appropriate bindings for Windows, the section separated diff --git a/vendor/commonmark/doc.odin b/vendor/commonmark/doc.odin index 736048e56..ef788fb8f 100644 --- a/vendor/commonmark/doc.odin +++ b/vendor/commonmark/doc.odin @@ -1,4 +1,4 @@ -//+build ignore +#+build ignore /* Bindings against CMark (https://github.com/commonmark/cmark) diff --git a/vendor/directx/dxc/dxcdef_unix.odin b/vendor/directx/dxc/dxcdef_unix.odin index 530d03ff0..9f8afc0e8 100644 --- a/vendor/directx/dxc/dxcdef_unix.odin +++ b/vendor/directx/dxc/dxcdef_unix.odin @@ -1,4 +1,4 @@ -//+build linux, darwin, freebsd, openbsd, netbsd +#+build linux, darwin, freebsd, openbsd, netbsd package directx_dxc import "core:c" diff --git a/vendor/directx/dxc/dxcdef_windows.odin b/vendor/directx/dxc/dxcdef_windows.odin index 16e6f6566..45b2f9558 100644 --- a/vendor/directx/dxc/dxcdef_windows.odin +++ b/vendor/directx/dxc/dxcdef_windows.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package directx_dxc import win32 "core:sys/windows" import dxgi "vendor:directx/dxgi" diff --git a/vendor/egl/egl.odin b/vendor/egl/egl.odin index e455a3d42..985d58457 100644 --- a/vendor/egl/egl.odin +++ b/vendor/egl/egl.odin @@ -1,4 +1,4 @@ -//+build linux +#+build linux package egl NativeDisplayType :: distinct rawptr diff --git a/vendor/fontstash/fontstash.odin b/vendor/fontstash/fontstash.odin index 2c692db06..8563277b1 100644 --- a/vendor/fontstash/fontstash.odin +++ b/vendor/fontstash/fontstash.odin @@ -1,4 +1,4 @@ -//+vet !using-param +#+vet !using-param package fontstash import "base:runtime" diff --git a/vendor/fontstash/fontstash_os.odin b/vendor/fontstash/fontstash_os.odin index 6182573bd..ed453926f 100644 --- a/vendor/fontstash/fontstash_os.odin +++ b/vendor/fontstash/fontstash_os.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package fontstash import "core:log" diff --git a/vendor/fontstash/fontstash_other.odin b/vendor/fontstash/fontstash_other.odin index 1c2ca3f28..edb76d9db 100644 --- a/vendor/fontstash/fontstash_other.odin +++ b/vendor/fontstash/fontstash_other.odin @@ -1,4 +1,4 @@ -//+build js +#+build js package fontstash AddFontPath :: proc( diff --git a/vendor/glfw/native_darwin.odin b/vendor/glfw/native_darwin.odin index b5191a913..61b2a9cb1 100644 --- a/vendor/glfw/native_darwin.odin +++ b/vendor/glfw/native_darwin.odin @@ -1,4 +1,4 @@ -//+build darwin +#+build darwin package glfw diff --git a/vendor/glfw/native_linux.odin b/vendor/glfw/native_linux.odin index acae8a27e..e1aebbbf7 100644 --- a/vendor/glfw/native_linux.odin +++ b/vendor/glfw/native_linux.odin @@ -1,4 +1,4 @@ -//+build linux +#+build linux package glfw diff --git a/vendor/glfw/native_windows.odin b/vendor/glfw/native_windows.odin index ce0dbf66f..66ed04dd7 100644 --- a/vendor/glfw/native_windows.odin +++ b/vendor/glfw/native_windows.odin @@ -1,4 +1,4 @@ -//+build windows +#+build windows package glfw diff --git a/vendor/miniaudio/common_unix.odin b/vendor/miniaudio/common_unix.odin index 89699a30d..8afcc0b5a 100644 --- a/vendor/miniaudio/common_unix.odin +++ b/vendor/miniaudio/common_unix.odin @@ -1,4 +1,4 @@ -//+build !windows +#+build !windows package miniaudio import "core:sys/unix" diff --git a/vendor/nanovg/gl/gl.odin b/vendor/nanovg/gl/gl.odin index 48998bda5..5af7ed4bc 100644 --- a/vendor/nanovg/gl/gl.odin +++ b/vendor/nanovg/gl/gl.odin @@ -1,4 +1,4 @@ -//+build windows, linux, darwin +#+build windows, linux, darwin package nanovg_gl import "core:log" diff --git a/vendor/nanovg/nanovg.odin b/vendor/nanovg/nanovg.odin index 15611cfef..540ca47cf 100644 --- a/vendor/nanovg/nanovg.odin +++ b/vendor/nanovg/nanovg.odin @@ -1,4 +1,4 @@ -//+build windows, linux, darwin +#+build windows, linux, darwin package nanovg // TODO rename structs to old nanovg style! diff --git a/vendor/stb/truetype/stb_truetype_wasm.odin b/vendor/stb/truetype/stb_truetype_wasm.odin index 472419ccb..0b5ff24bd 100644 --- a/vendor/stb/truetype/stb_truetype_wasm.odin +++ b/vendor/stb/truetype/stb_truetype_wasm.odin @@ -1,4 +1,4 @@ -//+build wasm32, wasm64p32 +#+build wasm32, wasm64p32 package stb_truetype import "base:builtin" diff --git a/vendor/wasm/js/dom.odin b/vendor/wasm/js/dom.odin index 3a8bd0ac4..e19be3078 100644 --- a/vendor/wasm/js/dom.odin +++ b/vendor/wasm/js/dom.odin @@ -1,4 +1,4 @@ -//+build js wasm32, js wasm64p32 +#+build js wasm32, js wasm64p32 package wasm_js_interface foreign import dom_lib "odin_dom" diff --git a/vendor/wasm/js/dom_all_targets.odin b/vendor/wasm/js/dom_all_targets.odin index ef629b347..171deed2f 100644 --- a/vendor/wasm/js/dom_all_targets.odin +++ b/vendor/wasm/js/dom_all_targets.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package wasm_js_interface import "base:runtime" diff --git a/vendor/wasm/js/events.odin b/vendor/wasm/js/events.odin index 4e786e2be..77a8085f4 100644 --- a/vendor/wasm/js/events.odin +++ b/vendor/wasm/js/events.odin @@ -1,4 +1,4 @@ -//+build js wasm32, js wasm64p32 +#+build js wasm32, js wasm64p32 package wasm_js_interface foreign import dom_lib "odin_dom" diff --git a/vendor/wasm/js/events_all_targets.odin b/vendor/wasm/js/events_all_targets.odin index 19a004250..ccf39015d 100644 --- a/vendor/wasm/js/events_all_targets.odin +++ b/vendor/wasm/js/events_all_targets.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package wasm_js_interface diff --git a/vendor/wasm/js/general.odin b/vendor/wasm/js/general.odin index 513c60a6f..4ed2ae298 100644 --- a/vendor/wasm/js/general.odin +++ b/vendor/wasm/js/general.odin @@ -1,4 +1,4 @@ -//+build js wasm32, js wasm64p32 +#+build js wasm32, js wasm64p32 package wasm_js_interface foreign import "odin_env" diff --git a/vendor/wasm/js/memory_all_targets.odin b/vendor/wasm/js/memory_all_targets.odin index e1de6a696..e80d13c0b 100644 --- a/vendor/wasm/js/memory_all_targets.odin +++ b/vendor/wasm/js/memory_all_targets.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package wasm_js_interface import "core:mem" diff --git a/vendor/wasm/js/memory_js.odin b/vendor/wasm/js/memory_js.odin index c513cc4a1..8232cd0c9 100644 --- a/vendor/wasm/js/memory_js.odin +++ b/vendor/wasm/js/memory_js.odin @@ -1,4 +1,4 @@ -//+build js wasm32, js wasm64p32 +#+build js wasm32, js wasm64p32 package wasm_js_interface import "core:mem" diff --git a/vendor/wgpu/examples/glfw/os_glfw.odin b/vendor/wgpu/examples/glfw/os_glfw.odin index 2b1817fa5..211b1ce97 100644 --- a/vendor/wgpu/examples/glfw/os_glfw.odin +++ b/vendor/wgpu/examples/glfw/os_glfw.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package vendor_wgpu_example_triangle import "core:time" diff --git a/vendor/wgpu/examples/sdl2/os_sdl2.odin b/vendor/wgpu/examples/sdl2/os_sdl2.odin index 0e6c5b57a..6ed70452f 100644 --- a/vendor/wgpu/examples/sdl2/os_sdl2.odin +++ b/vendor/wgpu/examples/sdl2/os_sdl2.odin @@ -1,4 +1,4 @@ -//+build !js +#+build !js package vendor_wgpu_example_triangle import "core:c" diff --git a/vendor/wgpu/glfwglue/glue.odin b/vendor/wgpu/glfwglue/glue.odin index 83c497543..0da7d72b8 100644 --- a/vendor/wgpu/glfwglue/glue.odin +++ b/vendor/wgpu/glfwglue/glue.odin @@ -1,6 +1,6 @@ -//+build !linux -//+build !windows -//+build !darwin +#+build !linux +#+build !windows +#+build !darwin package wgpu_glfw_glue #panic("package wgpu/glfwglue is not supported on the current target") diff --git a/vendor/wgpu/sdl2glue/glue.odin b/vendor/wgpu/sdl2glue/glue.odin index 9da9a0738..726569f4f 100644 --- a/vendor/wgpu/sdl2glue/glue.odin +++ b/vendor/wgpu/sdl2glue/glue.odin @@ -1,6 +1,6 @@ -//+build !linux -//+build !windows -//+build !darwin +#+build !linux +#+build !windows +#+build !darwin package wgpu_sdl2_glue #panic("package wgpu/sdl2glue is not supported on the current target") diff --git a/vendor/x11/xlib/xlib_const.odin b/vendor/x11/xlib/xlib_const.odin index 0466df76d..27af6a2d8 100644 --- a/vendor/x11/xlib/xlib_const.odin +++ b/vendor/x11/xlib/xlib_const.odin @@ -1,4 +1,4 @@ -//+build linux, freebsd, openbsd +#+build linux, freebsd, openbsd package xlib /* ---- X11/extensions/XKB.h ---------------------------------------------------------*/ diff --git a/vendor/x11/xlib/xlib_keysym.odin b/vendor/x11/xlib/xlib_keysym.odin index acb16c530..61284c723 100644 --- a/vendor/x11/xlib/xlib_keysym.odin +++ b/vendor/x11/xlib/xlib_keysym.odin @@ -1,4 +1,4 @@ -//+build linux, freebsd, openbsd +#+build linux, freebsd, openbsd package xlib KeySym :: enum u32 { diff --git a/vendor/x11/xlib/xlib_procs.odin b/vendor/x11/xlib/xlib_procs.odin index b5365e73d..2d35ab179 100644 --- a/vendor/x11/xlib/xlib_procs.odin +++ b/vendor/x11/xlib/xlib_procs.odin @@ -1,4 +1,4 @@ -//+build linux, openbsd, freebsd +#+build linux, openbsd, freebsd package xlib foreign import xlib "system:X11" diff --git a/vendor/x11/xlib/xlib_types.odin b/vendor/x11/xlib/xlib_types.odin index 5344d9aae..a73b8e8b8 100644 --- a/vendor/x11/xlib/xlib_types.odin +++ b/vendor/x11/xlib/xlib_types.odin @@ -1,4 +1,4 @@ -//+build linux, freebsd, openbsd +#+build linux, freebsd, openbsd package xlib // Since this is a unix-only library we make a few simplifying assumptions From 3d7b92426081cd9f3197b13f7384a52dbac5379a Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Sat, 14 Sep 2024 18:41:05 +0200 Subject: [PATCH 12/13] Fix a few incorrectly placed build tags. --- core/net/errors_darwin.odin | 2 +- core/net/errors_linux.odin | 2 +- core/net/errors_windows.odin | 2 +- core/net/interface_darwin.odin | 2 +- core/net/interface_linux.odin | 2 +- core/net/interface_windows.odin | 2 +- core/net/socket_darwin.odin | 2 +- core/net/socket_linux.odin | 2 +- core/net/socket_windows.odin | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/net/errors_darwin.odin b/core/net/errors_darwin.odin index b75336570..2905b44bc 100644 --- a/core/net/errors_darwin.odin +++ b/core/net/errors_darwin.odin @@ -1,5 +1,5 @@ -package net #+build darwin +package net /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/errors_linux.odin b/core/net/errors_linux.odin index f53a47d15..3cd51e6fd 100644 --- a/core/net/errors_linux.odin +++ b/core/net/errors_linux.odin @@ -1,5 +1,5 @@ -package net #+build linux +package net /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/errors_windows.odin b/core/net/errors_windows.odin index c4a880e10..f41bcf888 100644 --- a/core/net/errors_windows.odin +++ b/core/net/errors_windows.odin @@ -1,5 +1,5 @@ -package net #+build windows +package net /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/interface_darwin.odin b/core/net/interface_darwin.odin index 6931f5188..4921bc3fe 100644 --- a/core/net/interface_darwin.odin +++ b/core/net/interface_darwin.odin @@ -1,5 +1,5 @@ -package net #+build darwin +package net /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/interface_linux.odin b/core/net/interface_linux.odin index 85bbfd43b..28724735b 100644 --- a/core/net/interface_linux.odin +++ b/core/net/interface_linux.odin @@ -1,5 +1,5 @@ -package net #+build linux +package net /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/interface_windows.odin b/core/net/interface_windows.odin index 02b936b0a..a6eb72846 100644 --- a/core/net/interface_windows.odin +++ b/core/net/interface_windows.odin @@ -1,5 +1,5 @@ -package net #+build windows +package net /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/socket_darwin.odin b/core/net/socket_darwin.odin index c7b5b2761..544b345ec 100644 --- a/core/net/socket_darwin.odin +++ b/core/net/socket_darwin.odin @@ -1,5 +1,5 @@ -package net #+build darwin +package net /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/socket_linux.odin b/core/net/socket_linux.odin index 1800a4a89..27d3359b5 100644 --- a/core/net/socket_linux.odin +++ b/core/net/socket_linux.odin @@ -1,5 +1,5 @@ -package net #+build linux +package net /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/net/socket_windows.odin b/core/net/socket_windows.odin index d67f5ada1..65c26b8a8 100644 --- a/core/net/socket_windows.odin +++ b/core/net/socket_windows.odin @@ -1,5 +1,5 @@ -package net #+build windows +package net /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. From 29fedc1808c347774971666ecc90b44e1900dc90 Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Tue, 17 Sep 2024 19:39:48 +0200 Subject: [PATCH 13/13] Changed some recently added //+ usages to #+ and also fixed some //+ usages in some code generators. --- core/testing/runner_windows.odin | 2 +- src/parser.cpp | 2 +- tests/core/sys/windows/win32gen/win32gen.cpp | 2 +- tests/documentation/documentation_tester.odin | 2 +- vendor/box2d/box2d_wasm.odin | 2 +- vendor/cgltf/cgltf_wasm.odin | 2 +- vendor/stb/image/stb_image_wasm.odin | 2 +- vendor/stb/rect_pack/stb_rect_pack_wasm.odin | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/testing/runner_windows.odin b/core/testing/runner_windows.odin index fa233ff84..401804c71 100644 --- a/core/testing/runner_windows.odin +++ b/core/testing/runner_windows.odin @@ -1,4 +1,4 @@ -//+private +#+private package testing import win32 "core:sys/windows" diff --git a/src/parser.cpp b/src/parser.cpp index 242671af0..520a23c5a 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -4967,7 +4967,7 @@ gb_internal Ast *parse_import_decl(AstFile *f, ImportDeclKind kind) { } if (f->in_when_statement) { - syntax_error(import_name, "Cannot use 'import' within a 'when' statement. Prefer using the file suffixes (e.g. foo_windows.odin) or '//+build' tags"); + syntax_error(import_name, "Cannot use 'import' within a 'when' statement. Prefer using the file suffixes (e.g. foo_windows.odin) or '#+build' tags"); } if (kind != ImportDecl_Standard) { diff --git a/tests/core/sys/windows/win32gen/win32gen.cpp b/tests/core/sys/windows/win32gen/win32gen.cpp index 731173aa6..57a094cd5 100644 --- a/tests/core/sys/windows/win32gen/win32gen.cpp +++ b/tests/core/sys/windows/win32gen/win32gen.cpp @@ -902,7 +902,7 @@ static void verify_error_helpers(ofstream& out) { } static void test_core_sys_windows(ofstream& out) { - out << "//+build windows" << endl + out << "#+build windows" << endl << "package " << __func__ << " // generated by " << path(__FILE__).filename().replace_extension("").string() << endl << endl diff --git a/tests/documentation/documentation_tester.odin b/tests/documentation/documentation_tester.odin index ce1849e1c..7b125d4e4 100644 --- a/tests/documentation/documentation_tester.odin +++ b/tests/documentation/documentation_tester.odin @@ -264,7 +264,7 @@ write_test_suite :: proc(example_tests: []Example_Test) { test_runner := strings.builder_make() strings.write_string(&test_runner, -`//+private +`#+private package documentation_verification import "core:os" diff --git a/vendor/box2d/box2d_wasm.odin b/vendor/box2d/box2d_wasm.odin index eab369a0d..0fcaf753f 100644 --- a/vendor/box2d/box2d_wasm.odin +++ b/vendor/box2d/box2d_wasm.odin @@ -1,4 +1,4 @@ -//+build wasm32, wasm64p32 +#+build wasm32, wasm64p32 package vendor_box2d @(require) import _ "vendor:libc" diff --git a/vendor/cgltf/cgltf_wasm.odin b/vendor/cgltf/cgltf_wasm.odin index f2da86a2c..fb612b2ac 100644 --- a/vendor/cgltf/cgltf_wasm.odin +++ b/vendor/cgltf/cgltf_wasm.odin @@ -1,4 +1,4 @@ -//+build wasm32, wasm64p32 +#+build wasm32, wasm64p32 package cgltf @(require) import _ "vendor:libc" diff --git a/vendor/stb/image/stb_image_wasm.odin b/vendor/stb/image/stb_image_wasm.odin index 77bb44f02..f43012383 100644 --- a/vendor/stb/image/stb_image_wasm.odin +++ b/vendor/stb/image/stb_image_wasm.odin @@ -1,4 +1,4 @@ -//+build wasm32, wasm64p32 +#+build wasm32, wasm64p32 package stb_image @(require) import _ "vendor:libc" diff --git a/vendor/stb/rect_pack/stb_rect_pack_wasm.odin b/vendor/stb/rect_pack/stb_rect_pack_wasm.odin index fb75552ec..c4e2e5160 100644 --- a/vendor/stb/rect_pack/stb_rect_pack_wasm.odin +++ b/vendor/stb/rect_pack/stb_rect_pack_wasm.odin @@ -1,4 +1,4 @@ -//+build wasm32, wasm64p32 +#+build wasm32, wasm64p32 package stb_rect_pack @(require) import _ "vendor:libc"