Commit Graph

13168 Commits

Author SHA1 Message Date
gingerBill 97be7feb99 Add list of C identifier suggestions (types and keywords) 2024-03-18 17:32:26 +00:00
gingerBill 00344e1323 Add check to people trying to foreign import C files. 2024-03-18 16:56:01 +00:00
Laytan Laats dd92d3054d add ODIN_ prefix to the new constant 2024-03-18 17:22:58 +01:00
Jeroen van Rijn 07ef969546 Fix test label. 2024-03-18 17:05:40 +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
gingerBill 009b6f44e3 Add loads of checks for common mistakes for C programmer 2024-03-18 15:18:10 +00:00
gingerBill ebd3065aa2 Add error message for C programmers which do Foo{.x = 123} rather than Foo{x = 123} 2024-03-18 14:17:13 +00:00
gingerBill 6cb74b63ec Fix #3286 2024-03-18 12:39:34 +00:00
gingerBill effc71ca43 Fix case: bug with by-ref unions 2024-03-18 12:20:53 +00:00
gingerBill 43d695a990 Fix for x in y where y is an "optional ok" value, but ignores #optional_allocator_error values 2024-03-18 11:21:06 +00:00
gingerBill 19eb2a8890 Fix #3282 2024-03-16 22:24:34 +00:00
gingerBill 3875fb08e8 Fix #3284 2024-03-16 22:12:17 +00: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
gingerBill 51d6a254cf Merge pull request #3277 from kavalee/slice-unique-fixes
fixed slice.unique and slice.unique_proc
2024-03-14 19:40:18 +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
gingerBill 45d5066029 Merge pull request #3274 from iansimonson/darwin_munmap_syscall_fix
Fix syscall_munmap in darwin
2024-03-13 20:17:31 +00:00
gingerBill b47eeac414 Merge pull request #3275 from Chickenkeeper/bit-set-error-message-fix
Improve bit_set error message
2024-03-13 20:17:06 +00:00
Chris 5cc936245c Improve bit_set error message 2024-03-13 19:50:41 +00:00
gingerBill e68d3c8bbc Merge pull request #3143 from Pariatech/cgltf-linux-build
Adding linux & darwin makefile for cgltf
2024-03-13 17:47:18 +00: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
gingerBill 75b60fdb12 Merge pull request #3273 from Chickenkeeper/mutex-allocator-fix
Make Mutex_Allocator use Ada_Case
2024-03-13 15:45:52 +00:00
Chris 55141bdbb1 Make Mutex_Allocator use Ada_Case 2024-03-13 15:29:02 +00:00
gingerBill 5f2496226f Change return to panic 2024-03-13 15:17:21 +00:00
gingerBill dee66b8451 Fix typo due to deletion 2024-03-13 15:14:31 +00:00
gingerBill 4aec2de7bd Merge branch 'master' of https://github.com/odin-lang/Odin 2024-03-13 15:12:19 +00:00
gingerBill ac10f504e4 Add infinite loop check and early out in map_insert_hash_dynamic 2024-03-13 15:12:14 +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
gingerBill d62c92f5a9 Merge pull request #3267 from harold-b/copy-dirent-path
Retain copies of `dirent->name` for .odin files when using `read_directory`
2024-03-13 12:23:28 +00:00
gingerBill 5c1646a6b3 Merge pull request #3271 from rick-masters/too_many_poly_args
Fix check for too many arguments to a polymorphic record type
2024-03-13 12:23:19 +00:00
Pariatech b539bb2693 Update vendor/cgltf/src/Makefile
missing darwin folder

Co-authored-by: Laytan <laytanlaats@hotmail.com>
2024-03-13 07:37:42 -04:00
rick-masters 7bc962b852 Fix variable used to index polymorphic parameter. 2024-03-12 23:58:20 +00:00
rick-masters f7ec628cb2 Fix check for too many arguments to a polymorphic record type. 2024-03-12 23:57:13 +00:00
Jeroen van Rijn 23f3898b4e Merge pull request #3270 from edyu/master
Expose internal invmod and int_exponent_mod with more consistent naming
2024-03-12 19:06:10 +01: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
olesya-wo d979129a50 Naming and type changes 2024-03-12 16:32:17 +03:00
gingerBill d6353daf91 Merge branch 'master' of https://github.com/odin-lang/Odin 2024-03-12 12:11:53 +00:00