diff --git a/base/intrinsics/intrinsics.odin b/base/intrinsics/intrinsics.odin index 3cf99bbd2b0..744a899c0ab 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 90e049b0cfa..a5a3a4d8c15 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 5dfd37f99d6..e2223d5d684 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 99cd8201de3..52bb0e07219 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 1e2dcc21ac4..8eb4cc7d157 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 9e719bcd0b6..be032a20720 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 8a7ad1a4797..507dbf3181e 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 60af9e76126..d4590d2dde8 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 a0bda9d40f7..59811a525ee 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 46ce51166d9..5d198484b56 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 1bf29e78501..907899d7c69 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 08ca4aa553e..f975f61b83d 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 f8dafac3d29..0d1ec7a03e5 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 d35753604af..f1d12c808ff 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 146e647fbd3..d7b7371a752 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 b6f5930abdf..876d7d44b04 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 b85d7adea7d..aa562050c72 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 6da569aeefc..b966193caf5 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 497978a760e..4f4903d4764 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 d3e12410c27..58bed808d18 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 9f2e9befcb0..8da1564c6cc 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 ea495f5fa64..81d2cfb5dbd 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 10422cf07ff..99c314228aa 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 6bafaa48984..574f3dd06ef 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 2dc9e81dfef..be8a7d7d349 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 1796bb0935c..52669cb3568 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 d61e71b3a8d..4320dd59bcf 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 911dffbd548..bdf0d306692 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 10f2d75fe0a..ccb02a947ce 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 039d6cb96e9..ce673b42b98 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 1c9e815ad99..415758b24bf 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 b2ff36a0c82..f1d44a25fde 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 ffd8ed6428c..4cb5ab3b2e5 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 3557b1aae52..0c9ec6edc80 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 39ea2dc8d0f..0f1fa614316 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 641b7293386..78a6fcaaf13 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 46fb881b3d3..ef578f5c0a4 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 dc723184a25..8ef377cef98 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 ca8bd7817d3..8ee96720ec4 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 de1461e9653..c9868e33881 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 bfc724c12af..698cfee9c8c 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 8adaadb2d32..f467d730d15 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 b41abe3b28b..6c41a1a756f 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 1fe6de90b6f..4d98d2ee495 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 e129aff743b..28912b57fe4 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 be3997ef113..12ddb876f63 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 7a769b17cf5..4e49f45b085 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 4c1db5d0bf1..1c559ca5598 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 0044898d5f7..e1286186b62 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 b71cf9fe756..afd05331c73 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 503e64f2ba0..6929e9be7dd 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 acf218eb57d..ce90fbfe76c 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 9de0d43be7a..a481061f19a 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 d87a7d2d5a6..fa5d590958c 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 d20abc68579..70a85a78452 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 841d9c2003a..abf9812c039 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 e1fe440a4e5..98eb5bdbe87 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 ab3945ad7ce..a9dc6599a47 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 7db17a05d6c..7d475cf62e7 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 609f1ea1fea..2cf2439acc2 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 02aef1087d0..2d3665e9482 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 57c27fc6488..dd9e74526f4 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 cc65e7b42d4..8e0706206f3 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 2c23cc17aed..4a69e98a01a 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 efcec6c528e..c85fdd839ab 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 d98b241a772..9261be8c692 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 12747a68460..a789981051f 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 f05f7a2589a..e45f99523d6 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 5938dafde16..eab36b9511f 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 041efd27200..2584df71f26 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 5b9adabcd3e..2604ebc8bf5 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 bd97bd45c6b..f75c0ee87f9 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 d2c527fdb39..b8062bca1b8 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 e436fcb6dc2..5da38e62f6a 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 0b4532baa70..3e0d7668bfd 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 4fcb61b0401..a5785697570 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 c2b505cd20d..54c42ce4b74 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 035763466b6..1058497748d 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 ee47a01a838..acd30ae33e0 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 1972d8c229f..c47c6f55e37 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 ed255356e13..263fc770fb3 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 e82b5426265..ffb97fc5b42 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 0448b8d9e94..e4336e41003 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 1b7fe719623..2f3831767d2 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 f2a0d626253..2905b44bc3c 100644 --- a/core/net/errors_darwin.odin +++ b/core/net/errors_darwin.odin @@ -1,5 +1,5 @@ +#+build darwin package net -// +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 4830d1c03c6..486732a950e 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 9047b4020f4..3cd51e6fd5e 100644 --- a/core/net/errors_linux.odin +++ b/core/net/errors_linux.odin @@ -1,5 +1,5 @@ +#+build linux package net -// +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 ae928a05c13..f41bcf88804 100644 --- a/core/net/errors_windows.odin +++ b/core/net/errors_windows.odin @@ -1,5 +1,5 @@ +#+build windows package net -// +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 90444fb635a..775a812f3d9 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 7a33682deeb..4921bc3fe23 100644 --- a/core/net/interface_darwin.odin +++ b/core/net/interface_darwin.odin @@ -1,5 +1,5 @@ +#+build darwin package net -//+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 a9a12529988..50e2d1a96e9 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 c6df8f0a2e7..28724735b32 100644 --- a/core/net/interface_linux.odin +++ b/core/net/interface_linux.odin @@ -1,5 +1,5 @@ +#+build linux package net -//+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 67da6d034d5..a6eb7284642 100644 --- a/core/net/interface_windows.odin +++ b/core/net/interface_windows.odin @@ -1,5 +1,5 @@ +#+build windows package net -//+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 e36c67d21d5..83a9f016819 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 a56d36de630..544b345ec35 100644 --- a/core/net/socket_darwin.odin +++ b/core/net/socket_darwin.odin @@ -1,5 +1,5 @@ +#+build darwin package net -// +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 00da5ec0634..8ac69907fd9 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 52f328814e9..27d3359b52c 100644 --- a/core/net/socket_linux.odin +++ b/core/net/socket_linux.odin @@ -1,5 +1,5 @@ +#+build linux package net -// +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 8ee75bc3b24..65c26b8a8e9 100644 --- a/core/net/socket_windows.odin +++ b/core/net/socket_windows.odin @@ -1,5 +1,5 @@ +#+build windows package net -// +build windows /* Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures. diff --git a/core/odin/ast/ast.odin b/core/odin/ast/ast.odin index 9088da0eaee..d67eb31f347 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 b12c3b5fd6a..e2a07f8fb86 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 5f455c749e1..d4e532ec7df 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 6f42c17db73..d42766bdef5 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 + 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 p.file.pkg_token.kind != .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 cd895384130..48d08f12792 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 62170aa10e9..c3a30581cac 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 diff --git a/core/os/dir_unix.odin b/core/os/dir_unix.odin index b472e89b700..26e86520459 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 296be98a6eb..a205cae48bc 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 d4f62e213c6..6a097e1922d 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 75f620d9046..14fddde50a8 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 1b9675064b3..09990aeecee 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 99dd00d90b0..c248a323c55 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 93524fb0c0c..e2080485ddc 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 ac30eb1d4ac..a1e8c969d3f 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 ed55ea15e01..09492110d38 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 9e3424a4a56..59f0ba5f151 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 8a9a47ca661..56acd503fe0 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 ad6ddbf172c..e9ce1344739 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 dae85d224ea..b7dc43287cb 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 056d775e696..920a63a711f 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 e5007f8fe8c..05d03193014 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 a9cc77a4118..f96c227bab8 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 92962257878..74b6374ecc1 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 382156420f4..511935d7437 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 e765c320b9c..ede5eb2acc4 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 fcae267fa3c..1b52aed755c 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 4afc016a04a..7fd4529a099 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 041cd531bbd..164e1e1bea7 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 ba2f7235c92..7be4121aea4 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 0b9a52532a9..6f358c58deb 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 4aa695ee27d..3e92cb6f306 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 42315cf4eef..ac3382bc315 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 13c1f8aeca8..487e32aea25 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 59615e306cb..ee93fb6834d 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 b6db46423ac..ea5ee41b172 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 ea4ada81e35..5ac6babc1ef 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 648c4d3890d..0ea1f643c3c 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 02f78b9ac0f..77dbfa7ebbe 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 edb321509b4..0c32373f33f 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 6ccac1be0e6..0433c1a61f7 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 a817a862b64..88029c1f5c3 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 566417c8467..8ed2a6fed8e 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 d6f90fbafff..4eacbc54a0c 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 67ec4d3e8d2..b44ea13a7e8 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 d888eda5235..3e3e1285ccb 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 c908e373892..c22a6d7d573 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 02821c3e352..8bf1d988b95 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 6fb0631cdd2..552508f3bcd 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 8e89bee4f25..7f7985e8385 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 7137ad844ff..a18dc739ee2 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 b25d2b336cf..8060af448b5 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 fc05b85256c..455245aad18 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 c8b044963b0..11e216b63af 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 9018a835a0a..4b07086ceaa 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 5750ae6272d..9c6ae063a5e 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 a2cd2e4d3a9..338381422e7 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 1307a9cf2ee..78ebd182f11 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 a9213fed276..ab8cdca7dbe 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 e827bf6b9b0..14e633c063c 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 8a8b13c4b02..84c76227426 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 bc58e85047b..8caa3a26894 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 4dac5023458..1b4a863b62d 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 2e3eb852394..aaddbe6b448 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 a905a77264f..0e074c94691 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 c2c1abc2d06..81089ed63fa 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 7a674176bc9..1a5cb3f504e 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 2026c7f537d..07c846e7b46 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 06a2cd41e4d..ea0eff534e6 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 487b51907ff..36637c4cda5 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 87b7b96e687..10ff7bfbb2c 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 82021a71a09..e3f95b1467b 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 6fe5894a02b..21d07b80109 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 4d9101b9ff7..52143880b7b 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 f81a126757b..e49b25b02d3 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 1ffe4a9a562..7d3cc8578e1 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 27532587c5b..0f9659a02b0 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 6a26baf5bef..bb9686a1a7d 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 146f69e866e..141cea7449f 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 2d7cbf18d6b..fe6b11e72cd 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 4b8f6b02da7..69d005206c6 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 23483aef525..4478a77d210 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 aa7a8b4b272..bf04f8d99dd 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 594f2ff5c2a..66da0745ae2 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 ff3ff837fbe..1f6efd8f753 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 f8d9ab657ee..8906d96beab 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 9f5bfc28051..744bc248b0b 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 ddd25a76c80..d109f55444c 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 02304500151..febe647ea62 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 103e677d787..758c4dff405 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 883072c2d89..6ab3ef5734c 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 0440d5a98c7..47755b0b748 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 aa4bb368acc..960e55a561f 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 73d4c15e714..d6fa9850728 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 dcc252971ac..6408decb798 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 0b64c372548..84f6134d45c 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 e2273d253cc..6bb32cd3d90 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 27d1ecaae21..56be1cf7a8e 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 f1abbbf61b0..aefc1179e6a 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 05b40c06a5b..c5894d78bd9 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 ee4e1628004..31c8ed61cbb 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 74640a1a3b8..731ce36a564 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 61b5a31b77b..da8eb45da51 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 4609fc99ca1..affdff02ce1 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 d2fd0c2ff48..17845c5edd0 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 7a30c3bde61..4f6118c80b8 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 378fa9309fd..eb2cc4c9f09 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 5f4dac28942..38fe7db553d 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 f4ded746421..d67add24b9b 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 855e7d99c72..2c6d9e598ba 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 26a21e62995..43c4866ed0d 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 92222bdfe0e..32dd720b004 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 8ca40ef1bca..f5fee6c6c49 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 b93e8f9bd46..49c9b633697 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 b1ba8c6e971..5cd58753a26 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 2f0114522bc..3f5e7a53193 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 dfbe4c3be43..bc77444be9b 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 d0c46af53e7..b5c71664f77 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 38d95e7545d..8d50f16901a 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 1e34f1fd6ba..f834511d4eb 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 d891aa92bdc..f15f1e30550 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 7bfb7ea96df..86c66b9a112 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 90040f1ee29..527289f034e 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 9c4404a9d2d..477800413c4 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 30d9b169ccc..a9800b47a26 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 cb5458248ff..336992b4a6c 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 dd2d1acee18..4fd9f7a1963 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 d0ffc6b46e9..11a46f53af3 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 5cbafddbaa6..1d7a93d8582 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 bea03694eb0..5e9787527ac 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 a32aa7b9f0d..eb2a85f2e76 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 4c2534c102c..7a6e545ac2d 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 81db6718531..2771581e611 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 284b0e43746..0991ca4b3fb 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 439d65faf50..cbaf5eeebb7 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 d9f75c623a4..9442193cadc 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 23444ff34eb..747130749ad 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 54f67989eac..08a76ebe603 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 7340ae4d4e7..54cee718c72 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 bf9d2d1e8e9..095fff304e0 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 79efaab343f..bcaeb3f5f32 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 e94d777bfa6..e463feb7e12 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 45d5a3ff9e7..006c9c330d4 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 e13dcd55f0d..514592e7b88 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 a31e363e1a5..2a2209d2cb1 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 929df176542..b3eb800bcdb 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 7af39936188..527abd62f8f 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 d0d96d90b52..8fea55c3dd6 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 0c4b51d652f..4c76b39ec5a 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 888c5ccf91e..d69771bdf62 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 d3df3b81517..b3b47061936 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 a1786c27a10..3c7ec80e75a 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 292d2fad2a3..ffb2638d580 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 091d53d3ad3..47751dab70e 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 28558e9cae5..3d29b786e1f 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 e9bf8abc95d..5b295249596 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 c9c4b0271e0..1a47e2d6822 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 1c3fc4603a4..041489daba9 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 81f1d06469e..6752cd79b2f 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 10d5dca5c01..6b9d610eddb 100644 --- a/core/testing/runner.odin +++ b/core/testing/runner.odin @@ -1,4 +1,4 @@ -//+private +#+private package testing /* diff --git a/core/testing/runner_windows.odin b/core/testing/runner_windows.odin index fa233ff849d..401804c7176 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/core/testing/signal_handler.odin b/core/testing/signal_handler.odin index 047ea0b3a8e..2f1f7c89a74 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 e2d17059534..7442c100ce8 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 d6d494fa481..81f575495b5 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 34bbfda08c1..dde2a8e4891 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 3d3b419b096..9576a3040b3 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 22c3eae6589..cc73a2d6a30 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 e7129548eb5..3477a47f33f 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 b7bc616d876..89883f0b909 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 c5090df90c7..9175fbfe9e1 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 b2598fd6e49..f529790a54c 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 164d23f25ba..d89bcbd42ac 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 0d7a43aba25..61c4e91d385 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 88bebe2e361..c16c40ccedb 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 378b914b0f0..553ea6d4e7a 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 841c0b6925e..3726cff49dc 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 f4d6ccc3ab6..dabcb69cbd9 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 77a79fe520d..a83634414fc 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 cd60c269c04..1d4eb4bb91f 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 18bba951c2b..ca51d656234 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 819dd6dd3bf..76fac0b871d 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 d66d1ceb01d..4b761f0e247 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/src/parser.cpp b/src/parser.cpp index 56bea8131bd..520a23c5a02 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) { @@ -5355,6 +5355,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 @@ -6086,7 +6092,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)); @@ -6099,6 +6105,10 @@ gb_internal bool parse_build_tag(Token token_for_pos, String s) { 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)); if (p.len == 0) break; @@ -6124,7 +6134,18 @@ gb_internal bool parse_build_tag(Token token_for_pos, String s) { 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) { + this_kind_os_seen = true; + GB_ASSERT(arch == TargetArch_Invalid); if (is_notted) { this_kind_correct = this_kind_correct && (os != build_context.metrics.os); @@ -6132,6 +6153,8 @@ gb_internal bool parse_build_tag(Token token_for_pos, String s) { 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 { @@ -6171,7 +6194,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)); @@ -6276,7 +6299,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) { @@ -6320,6 +6343,48 @@ gb_internal bool parse_build_project_directory_tag(Token token_for_pos, String s return any_correct; } +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; + } + } 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; @@ -6338,9 +6403,34 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { CommentGroup *docs = f->lead_comment; + Array tags = array_make(temporary_allocator()); + 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) { + 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 (!first_invalid_token_set) { + first_invalid_token_set = true; + first_invalid_token = f->curr_token; + } + + advance_token(f); + } + } + 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 = 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 // so in practice is should be "fine" if (f->pkg && f->pkg->name != "") { @@ -6349,18 +6439,16 @@ 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 (first_invalid_token_set) { + syntax_error(first_invalid_token, "Expected only comments or lines starting with '#+' before the package declaration"); + return false; + } + f->package_token = expect_token(f, Token_package); 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) { @@ -6374,53 +6462,40 @@ 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("//"))) { + // 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) { + GB_ASSERT(tok.kind == Token_Comment); + String str = tok.string; + + if (!string_starts_with(str, str_lit("//"))) { + continue; + } + 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)) { - 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"))) { + 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; - } 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 (parse_file_tag(lt, tok, f) == false) { + return false; + } + } + } } Ast *pd = ast_package_decl(f, f->package_token, package_name, docs, f->line_comment); diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 4425bee2985..53f6135d036 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 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') { + break; + } + if (t->curr_rune == '/') { + break; + } + advance_to_next_rune(t); + } } break; case '/': diff --git a/tests/core/net/test_core_net.odin b/tests/core/net/test_core_net.odin index 8a927288243..a6e299bcc55 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 61e801f2b45..39e364e80ac 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 4af1afc75c5..dc004dfe3b4 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 fa30d16015d..760ddc1fb46 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 a4e9c8d9024..de95116340a 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 67fa6e4a239..dc482f2f8a5 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 81331fc9f03..f6a88c76989 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 30bf5bc806e..8be231e1f94 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 0778fdf4159..2fe849a6bbc 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 724b1b7aff8..cab36af36df 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 13d09f4e1f3..3d8184a8bee 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 adbdb7ce14b..baabae52b5d 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/core/sys/windows/win32gen/win32gen.cpp b/tests/core/sys/windows/win32gen/win32gen.cpp index 731173aa6ff..57a094cd5d9 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 ce1849e1cbf..7b125d4e499 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/tests/vendor/glfw/test_vendor_glfw.odin b/tests/vendor/glfw/test_vendor_glfw.odin index 8a7fb0d0acc..c1a75f1a8e4 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 e331200ea93..e5edca540b2 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 1cbda5974a2..210e6439449 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 0a1997ff91b..f5a1c89852e 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/box2d/box2d_wasm.odin b/vendor/box2d/box2d_wasm.odin index eab369a0de6..0fcaf753ff2 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 f2da86a2cd7..fb612b2ace9 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/commonmark/doc.odin b/vendor/commonmark/doc.odin index 736048e56e1..ef788fb8fd3 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 530d03ff0cc..9f8afc0e8bb 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 16e6f6566a9..45b2f9558fd 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 e455a3d42cf..985d5845720 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 2c692db064b..8563277b10e 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 6182573bd65..ed453926f9b 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 1c2ca3f28b4..edb76d9db07 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 b5191a91365..61b2a9cb19f 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 acae8a27e20..e1aebbbf76c 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 ce0dbf66f5d..66ed04dd762 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 89699a30da0..8afcc0b5a51 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 48998bda50e..5af7ed4bcd6 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 15611cfef78..540ca47cf7c 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/image/stb_image_wasm.odin b/vendor/stb/image/stb_image_wasm.odin index 77bb44f0294..f4301238329 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 fb75552ecf9..c4e2e516005 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" diff --git a/vendor/stb/truetype/stb_truetype_wasm.odin b/vendor/stb/truetype/stb_truetype_wasm.odin index d15f29f1838..f3623908657 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 @(require) import _ "vendor:libc" diff --git a/vendor/wasm/js/dom.odin b/vendor/wasm/js/dom.odin index 3a8bd0ac4c1..e19be3078da 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 ef629b34727..171deed2f82 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 4e786e2bed1..77a8085f4c2 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 19a004250a7..ccf39015dc0 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 513c60a6f02..4ed2ae298b2 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 e1de6a696c5..e80d13c0b83 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 c513cc4a133..8232cd0c90f 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 2b1817fa5f6..211b1ce97d5 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 0e6c5b57a2a..6ed70452f60 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 83c49754390..0da7d72b872 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 9da9a073864..726569f4ffd 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 0466df76dc6..27af6a2d8cf 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 acb16c530eb..61284c7233d 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 b5365e73d0d..2d35ab179c0 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 5344d9aaec6..a73b8e8b8fb 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