Commit Graph

6758 Commits

Author SHA1 Message Date
Laytan Laats
b7fd51a251 add MacOS 14.4.1 to sys/info and odin report 2024-03-28 19:39:18 +01:00
FrancisTheCat
29e4e85152 Merge branch 'odin-lang:master' into master 2024-03-27 16:43:02 +01:00
Franz Höltermann
a422aba578 Json: improved unmarshalling of using _: T fields.
`using _: T` fields will now have their members unmarshalled to their
parent types reflecting the new behaviour of json.marshall.

Example:
```go
A :: struct {
    using _: B,
}

B :: struct {
    field: string,
}

data := `{"field": "Hello World"}`

a: A
json.unmarshal_string(data, &a)
```
2024-03-27 15:46:44 +01:00
gingerBill
b378eb2df3 Fix free bug not using the correct allocator 2024-03-27 12:54:52 +00:00
gingerBill
6422c090f2 Make hash procedures contextless where possible 2024-03-27 12:54:37 +00:00
gingerBill
3bc7c51325 Merge pull request #3283 from laytan/darwin-new-wait-on-address-api
darwin: use new wait on address API if possible
2024-03-27 11:20:32 +00:00
Arseniy Poroshin
77a0e50298 fix comments in core:container/queue. 2024-03-26 22:39:43 +00:00
Franz Höltermann
92a5666c1c Json: fields on structs like 'using _: T' will now have T's fields
marshalled directly into the parent type without an '"_":{ ... }'.
This seems like desirable behavior to me, since you can't access the
fields with 'Parent_Type._.field' either.
2024-03-26 20:22:51 +01:00
blob1807
8eed65ad4c Update time.odin 2024-03-26 11:20:05 +10:00
blob1807
bc0a2b8d39 Update time.odin 2024-03-26 11:17:44 +10:00
blob1807
a405c72d4d Updated windows time period call
Updated win32.time_begin_period to windows.timeBeginPeriod
Added a note about calling windows.timeEndPeriod once you don't need accurate_sleep, as per MS's docs https://learn.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod#remarks
2024-03-26 11:13:27 +10:00
flysand7
c843002d07 [core/os2]: Move .Broken_Pipe to General_Error enum 2024-03-25 23:35:01 +11:00
gingerBill
670fc70f1f Remove private attributes for #3227 2024-03-24 13:46:26 +00:00
gingerBill
398af659e5 Fix #3323 2024-03-24 13:33:30 +00:00
flysand7
0f944bc0a1 [core/os2]: Reading from unsized files 2024-03-24 10:52:48 +11:00
gingerBill
6d7afd3fa9 Update format version 2024-03-21 11:59:45 +00:00
gingerBill
006ea11c56 Update doc-format for #by_ptr and #no_broadcast parameters 2024-03-21 11:58:32 +00:00
gingerBill
29e5f94c2a Add #no_broadcast procedure parameter to disallow automatic array programming broadcasting on procedure arguments 2024-03-21 11:52:48 +00:00
Jeroen van Rijn
8f0d74c08d Merge pull request #3292 from Kelimion/rfc3339
Add WiP datetime package and tests.
2024-03-20 23:23:27 +01:00
Jeroen van Rijn
fda283c55e More better validation. 2024-03-20 23:09:09 +01:00
Jeroen van Rijn
ed5fd15f6e Ensmallen Date struct. 2024-03-20 18:13:29 +01:00
Jeroen van Rijn
89ca15014c Ensmallen Time struct. 2024-03-20 18:09:07 +01:00
Jeroen van Rijn
9c144dd24f Change Ordinal from int to i64 2024-03-20 17:56:22 +01:00
gingerBill
56004c56fc Merge pull request #3295 from kavalee/parser-newline-fix
Fixed issue #3264 regarding `core:odin/parser` compound literal not allowing a newline
2024-03-20 10:09:55 +00:00
Laytan Laats
d0b3b18e26 update macOS releases for core:sys/info and odin report 2024-03-20 00:14:01 +01:00
gingerBill
a750fc0ba6 Add #row_major matrix[R, C]T
As well as `#column_major matrix[R, C]T` as an alias for just `matrix[R, C]T`.
This is because some libraries require a row_major internal layout but still want to be used with row or major oriented vectors.
2024-03-19 21:05:23 +00:00
Beau McCartney
43e8da2e06 shm_open: comment with notes abt permissions 2024-03-19 09:36:49 -06:00
Aaron Kavaler
096b4f5454 fixed issue #3264 regarding core:odin/parser not allowing a newline at the end of a compound literal 2024-03-18 20:33:02 -07:00
Laytan Laats
dd92d3054d add ODIN_ prefix to the new constant 2024-03-18 17:22:58 +01:00
Jeroen van Rijn
72c15d7699 Add WiP datetime package and tests.
A new package `core:time/datetime` has been added which can represent moments much further in the past and future than `core:time`.
It is based on *the* reference work on the subject, Calendrical Calculations Ultimate Edition, Reingold & Dershowitz.

More procedures will be added to it in the future, to for example calculate the 3rd Thursday in March to figure out holidays.
The package has been tested for more than a year and can handle dates 25 quadrillion years into the past and future with 64-bit day ordinals, or 5 million with 32-bit ones.

This also fixes a longstanding bug where converting between YYYY-MM:DD hh:mm:ss and `time.Time` and back could result in a mismatch.

RFC 3339 timestamps can now also be parsed using the `core:time` package.
2024-03-18 16:47:16 +01:00
Beau McCartney
1758bd683e sys_shm_open: fchmod the returned descriptor to get correct perms
this doesn't happen by default
2024-03-16 12:13:00 -06:00
Laytan Laats
9c455b2213 darwin: use new wait on address API if possible 2024-03-15 21:43:16 +01:00
Eric Johnson
4b7f32c287 Update mem doc example formatting 2024-03-15 12:26:01 -07:00
Beau McCartney
24f9e16dfd sys_open() calls _sys_open_mode() to get a permission flags integer
_sys_open_mode() does exactly what sys_open() was originally doing
inline, I simply factored it into a separate function so that other
wrappers could call it (similar to _sys_permission_mode())
2024-03-15 08:32:25 -06:00
Beau McCartney
56a29685b4 darwin: sys_shm_open() helper
wraps syscall_shm_open() in the same way that sys_open() wraps
syscall_open()
2024-03-15 08:27:27 -06:00
Beau McCartney
cf949e541f helper function to convert Open_Flags bitset to a u32
- analagous to _sys_permission_mode()
- uses the already-existing conversion logic in sys_open()
2024-03-15 08:26:25 -06:00
Beau McCartney
44167800ad darwin: syscall wrappers for shm_open() and shm_unlink() 2024-03-15 08:26:03 -06:00
gingerBill
04f0fbf23a Merge pull request #3272 from iansimonson/add_getrusage_darwin
Add getrusage syscall for mac/darwin
2024-03-14 19:45:25 +00:00
Ian Simonson
835effdef1 Use c.long rather than int 2024-03-14 09:36:57 -07:00
Ian Simonson
c7bec2962e Fix __darwin_suseconds_t definition
__darwin_suseconds_t is defined as long which on macos
64 bit systems is equivalent to 8 bytes. It is equivalent
to Odin int type _not_ i32
2024-03-14 07:21:26 -07:00
Aaron Kavaler
ac634acd4b fixed slice.unique and slice.unique_proc 2024-03-13 19:19:31 -07:00
Ian Simonson
34c4389d75 No need for timeval definition
It already existed so lets just use that rather than
redeclaring it
2024-03-13 14:58:56 -07:00
Ian Simonson
8917a7ef88 Make RUsage more inline with macos man page
Swap to tabs to adhere to the Odin Core library standard
and also rename the rusage fields to match the actual
definitions from the macos bsd man pages
2024-03-13 14:51:17 -07:00
Ian Simonson
d7b1901b16 Fix syscall_munmap in darwin
this was using the .mmap syscall number when it should be
using the .munmap syscall number
2024-03-13 10:39:50 -07:00
gingerBill
97d6bf6d8f Merge branch 'master' of https://github.com/odin-lang/Odin 2024-03-13 16:30:28 +00:00
gingerBill
271f84ab5b Expect stream as a field directly on os2.File 2024-03-13 16:30:22 +00:00
Chris
55141bdbb1 Make Mutex_Allocator use Ada_Case 2024-03-13 15:29:02 +00:00
Ian Simonson
26d107ce64 Add getrusage syscall for mac/darwin
The syscall number existed but the wrapper for calling it
did not. Also adds the RUsage struct to receive the data.

Naming is kept the same as in sys/linux
2024-03-13 08:07:12 -07:00
Ed Yu
dd74a57c44 Expose internal invmod and int_exponent_mod with more consistent naming 2024-03-12 11:01:09 -07:00
olesya-wo
51a4d97f03 type conversion fix 2024-03-12 18:25:54 +03:00