Commit Graph

4194 Commits

Author SHA1 Message Date
gingerBill
c5bab58180 Merge pull request #3076 from xb-bx/mprotect-fix-for-linux-and-darwin
virtual.protect returns inverted result on linux and darwin platforms
2024-01-17 16:46:39 +00:00
gingerBill
12e53f2336 Fix imports to be case sensitive correct 2024-01-17 16:26:18 +00:00
gingerBill
7b89174a26 Remove //+build windows tag 2024-01-17 15:57:37 +00:00
FourteenBrush
05e27fa92d Fix typo in bytes.scrub 2024-01-17 13:37:06 +01:00
gingerBill
7ee7f4b064 Merge pull request #3077 from laytan/add-libc-to-stream
c/libc: add `to_stream` proc
2024-01-16 18:09:44 +00:00
Kostas Tsiligkiris
3f6f00d8e5 [DOC] Fix documentation formatting in site
The comments that were added automatically in odin site, contained
tabs, so the first line of a two line comment was properly rendered in
the site, but the second line of the comment (because it included tabs
in the beginning of the line) was rendered as preformattted text. I
think that the proposed changes will fix this problem in the
documentation site.

An example of the problematic rendering of documentation is
https://pkg.odin-lang.org/core/compress/#COMPRESS_OUTPUT_ALLOCATE_MAX
2024-01-14 13:22:18 +02:00
Jon Lipstate
880a18f124 fix shift direction 2024-01-12 22:28:38 -08:00
gingerBill
5d94887e76 Merge pull request #3083 from Lperlind/master
Fix linalg shadowing error
2024-01-13 00:05:14 +00:00
Jeroen van Rijn
2990747cf8 Reindent and align and f ix Ventura kernel+version swap. 2024-01-10 18:26:14 +01:00
Platin21
62c30795e6 Fixed indentation 2024-01-10 17:27:31 +01:00
Platin21
120ef168bf Added macOS versions for a lot of revisions 2024-01-10 16:42:25 +01:00
Lucas Perlind
67d5b97ff9 Fix linalg shadowing error 2024-01-09 10:24:12 +11:00
Jeroen van Rijn
656e62d724 Add peek to priority queue. 2024-01-08 19:33:30 +01:00
Laytan Laats
ce8801c37f c/libc: add to_stream proc
Adds the `to_stream` procedure to `core:c/libc` to improve usability of
the core collection when you have to use libc.
2024-01-08 19:20:06 +01:00
xb-bx
c6c710465a fix 2024-01-08 19:54:39 +02:00
Franz Höltermann
873b7f8588 Fixed type of temporary slice in sort_by_indices_overwrite 2024-01-08 17:11:06 +01:00
Jeroen van Rijn
7d3dfb1046 Merge pull request #3006 from hwchen/hwchen/last_index_any
fix strings.last_index_any for single char
2024-01-08 15:57:36 +01:00
gingerBill
f4782157d3 Implement instrumentation pass 2024-01-07 21:34:44 +00:00
Yawning Angel
8d7c37e384 core/simd/x86: Use the none calling convention for intrinsics
The LLVM intrinsics that live under `llvm.x86` are not actual functions,
so trying to invoke them as such using the platform's native C
calling convention causes incorrect types to be emitted in the IR.

Thanks to laytanl for assistance in testing.
2024-01-07 20:04:40 +09:00
Yawning Angel
9235e82451 core/simd/x86: Correct a target feature name 2024-01-07 20:04:40 +09:00
Laytan Laats
85b71708dd dynlib: add last_error procedure 2024-01-06 02:08:11 +01:00
Jeroen van Rijn
649b5fa528 Add bool return to dynlib.initialize_symbols. 2024-01-06 02:04:09 +01:00
Jeroen van Rijn
d6a89d667d Add dynlib.initialize_symbols (#3071)
```
package example

import "core:dynlib"
import "core:fmt"

Symbols :: struct {
	// `foo_` is prefixed, so we look for the symbol `foo_add`.
	add: proc "c" (int, int) -> int,
	// We use the tag here to override the symbol to look for, namely `bar_sub`.
	sub: proc "c" (int, int) -> int `dynlib:"bar_sub"`,

	// Exported global (if exporting an i32, the type must be ^i32 because the symbol is a pointer to the export.)
	// If it's not a pointer or procedure type, we'll skip the struct field.
	hellope: ^i32,

	// Handle to free library.
	// We can have more than one of these so we can match symbols for more than one DLL with one struct.
	_my_lib_handle: dynlib.Library,
}

main :: proc() {
	sym: Symbols

	// Load symbols from `lib.dll` into Symbols struct.
	// Each struct field is prefixed with `foo_` before lookup in the DLL's symbol table.
	// The library's Handle (to unload) will be stored in `sym._my_lib_handle`. This way you can load multiple DLLs in one struct.
	count := dynlib.initialize_symbols(&sym, "lib.dll", "foo_", "_my_lib_handle")
	defer dynlib.unload_library(sym._my_lib_handle)
	fmt.printf("%v symbols loaded from lib.dll (%p).\n", count, sym._my_lib_handle)

	if count > 0 {
		fmt.println("42 + 42 =", sym.add(42, 42))
		fmt.println("84 - 13 =", sym.sub(84, 13))
		fmt.println("hellope =", sym.hellope^)
	}
}
```
2024-01-06 01:31:27 +01:00
gingerBill
b408ec6bac Remove distinct from the specific types 2024-01-05 14:48:39 +00:00
gingerBill
3bf7b416e7 Fix builtin.quaternion generation 2024-01-05 14:36:58 +00:00
gingerBill
0b83e3dae5 Enforce naming the parameters with builtin.quaternion to reduce confusion 2024-01-05 14:29:14 +00:00
Jeroen van Rijn
b59c80d6fd Merge pull request #3068 from laytan/json-unmarshal-union
encoding/json: try to unmarshal into union variants
2024-01-03 19:13:36 +01:00
Laytan Laats
8c10f4cdde encoding/json: try to unmarshal into union variants 2024-01-03 19:02:30 +01:00
Laytan Laats
8a7c2ea9d0 darwin: actually honor no-crt by not linking with -lSystem -lm 2024-01-02 21:44:51 +01:00
Jeroen van Rijn
4efef08c94 Update core:encoding to Unicode 15.1 table. 2024-01-02 18:03:32 +01:00
gingerBill
87c835268a Merge pull request #2917 from flysand7/sys-linux-additions
[sys/linux]: Fixes and additions
2024-01-02 14:23:40 +00:00
gingerBill
76eef47491 Merge pull request #3054 from igordreher/win_error
[core:sys/windows] add System Error Codes enum
2024-01-02 14:16:36 +00:00
Alex Ragalie
b47736260a remove duplication 2023-12-31 21:57:39 +01:00
Jeroen van Rijn
89084befb0 Remove unnecessary []byte -> []byte conversion. 2023-12-30 21:59:33 +01:00
Igor Dreher
120b1101fb [core:sys/windows] add System Error Codes enum
Copied error values from https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
and subsequent pages to an enum
2023-12-29 11:06:50 -03:00
Laytan Laats
1fa2af213d fix typo in assign_at_elems 2023-12-28 17:10:08 +01:00
Jeroen van Rijn
e52cc73d50 Fix generic_float.odin 2023-12-21 22:37:26 +01:00
gingerBill
464a675adc Merge branch 'master' of https://github.com/odin-lang/Odin 2023-12-21 17:05:31 +00:00
gingerBill
55f3e99f63 Fix %g in fmt, and make %v default to %g for floats 2023-12-21 17:05:24 +00:00
Laytan Laats
46250168d6 use stack buffer for log allocator to avoid logging it's own allocations 2023-12-19 23:26:23 +01:00
gingerBill
829e4cc67e Fix assign_at_elems to match the same logic as assign_at_elem_string 2023-12-18 22:22:08 +00:00
Walther Chen
031b0cc534 fix strings.last_index_any for single char 2023-12-18 11:55:45 -05:00
Laytan
baa5ea9258 fix not passing arg everywhere 2023-12-18 16:41:55 +01:00
Laytan
9a490e4e0d fix big alignment 2023-12-18 16:38:51 +01:00
Laytan Laats
252de70b0f fix same problem in virtual arena 2023-12-18 15:41:36 +01:00
Laytan Laats
4ae021cd4c add other failing test and fix them 2023-12-18 15:17:27 +01:00
Yawning Angel
29c80c238d core: Fixed build constraints
Multiple constraints on the same line are combined with logical OR,
while combining multiple negated constraints needs to be done with
logical AND (each constraint on a separate line).
2023-12-17 23:02:46 +09:00
Laytan Laats
58ff3dd1ed log allocator: add option to switch between bytes and human format 2023-12-16 01:27:38 +01:00
Laytan Laats
cf8c9a6be4 log allocator: fix the formatting for query info/features and errors 2023-12-16 00:55:59 +01:00
Laytan Laats
ea709451e8 log allocator: use %m to format size 2023-12-15 23:43:35 +01:00