67 Commits

Author SHA1 Message Date
gingerBill
97739da85a Remove core:sys/win32 2022-05-12 14:33:03 +01:00
gingerBill
eef44b11f3 Make the utf16 conversion procedures in core:sys/windows safer by checking for memory leaks 2022-05-12 13:17:58 +01:00
Jeroen van Rijn
85e6efdf16 Ctrl-C handler on Windows. 2022-05-08 10:39:03 +02:00
gingerBill
96ab17ecfc Begin mocking os2 for windows out more 2022-05-05 18:01:44 +01:00
Lucas Perlind
34187424b8 Add unregister_class_a and unregister_class_w for windows bindings 2022-03-18 19:35:36 +11:00
Tail Wag Games
78eb388110 Adding capture procedures to user32
Adding `GetCapture`, `SetCapture` and `ReleaseCapture` functions - https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setcapture
2022-02-17 00:58:38 -06:00
Josh Engler
15594706c9 Additional win32 bindings. 2021-10-05 19:09:20 -04:00
gingerBill
ceebd7b23c Correct context.allocator usage 2021-09-19 11:59:31 +01:00
gingerBill
344abf2cb2 Make core and vendor adhere to -vet, -strict-style, and -disallow-do 2021-09-11 16:40:19 +01:00
gingerBill
e5fbf45c42 Add vendor:raylib (core only) 2021-09-08 18:04:05 +01:00
gingerBill
720884e0f1 Strip even more semicolons if followed by a } or ) on the same line 2021-08-31 23:47:57 +01:00
gingerBill
251da264ed Remove unneeded semicolons from the core library 2021-08-31 22:21:13 +01:00
Jeroen van Rijn
5dfff51a40 Allow core:sys/windows to build on Windows only 2021-07-15 12:13:57 +02:00
Jeroen van Rijn
038337fd07 Port core:sys/win32 tests to test runner. 2021-05-02 00:10:00 +02:00
gingerBill
a60d22fefd Make trailing comma usage consistent 2021-03-13 21:18:07 +00:00
gingerBill
b727b6438b Minimize unneeded casts 2021-03-03 14:31:17 +00:00
gingerBill
aa93305015 Replace usage of inline proc with #force_inline proc in the core library 2021-02-23 16:14:47 +00:00
gingerBill
efdee0dafb Remove bit_field type from Odin (keyword and dead runtime code still exists) 2021-02-19 11:31:14 +00:00
gingerBill
f50ea36c70 Fix miscorrect type usage 2021-02-04 14:24:42 +00:00
gingerBill
de9b6e3f6e Correct sys/win32 to match sys/windows 2021-02-04 13:50:48 +00:00
Dan Bechard
58f768cb4f Update kernel32.odin
Fix typo in CreateProcessA/W mappings (https://github.com/odin-lang/Odin/issues/785)
2020-11-20 15:39:08 -08:00
gingerBill
c4067372dd Fix double declaration 2020-07-10 22:28:48 +01:00
gingerBill
f65fa0e4a6 Merge pull request #339 from dotbmp/master
"core:path" Path library and "core:strings" `split` Utilities
2020-07-10 08:25:24 +01:00
gingerBill
6bd05ef5d7 Begin migration from sys/win32 to sys/windows 2020-06-26 19:11:34 +01:00
vassvik
9cccb20f49 Add some tests to test utf16_to_utf8 and wstring_to_utf8 2020-06-13 18:04:19 +02:00
vassvik
0056cdffa7 Reworked win32.utf16_to_utf8 and win32.wstring_to_utf8 to scan for zeros from the start of the string instead of from the end.
This is useful to correctly convert strings from a buffer possibly containing multiple multiple substrings.

The resulting utf8 string is not null terminated, even if the backing memory might be null terminated.
2020-06-13 15:19:41 +02:00
vassvik
bbbf7168f1 Add wstring_to_utf8 to sys/win32 2020-06-12 21:06:21 +02:00
vassvik
c15ed44f82 Fix off by one bug introduced in the previous commit. 2020-06-12 18:19:46 +02:00
gingerBill
58466a6f3b Add extra NUL termination check for string length in win32 general string convertors 2020-06-12 15:01:43 +01:00
gingerBill
117ade0700 Fix errors in package win32 2020-04-30 17:48:35 +01:00
Joe
c83592629d Fixed duplicated WHITENESS value in BLACKNESS constant 2020-03-29 18:10:10 -04:00
Joe
2e3706e447 -Win32-
New
- Constants: WHITENESS & BLACKNESS, and WM_PAINT
- Methods: pat_blt, register_class_a, register_class_w, message_box_a, message_box_w, begin_paint, and end_paint
- Structs: Wnd_Class_A, Wnd_Class_W, Paint_Struct
Modified
- WM_INPUT : Capitalized alphabetical values for consistency with other values
2020-03-29 17:06:09 -04:00
gingerBill
2ce1f4ba9f Revert os_windows.odin behaviour 2020-03-12 23:37:24 +00:00
Tetralux
1181d7cf90 Fix os.read / os.read_entire_file
- DWORDs are NOT i32
- os.read didn't correctly read as much as it could
2020-03-12 22:31:00 +00:00
Tetralux
66d1656367 Add os.get_current_directory / os.set_current_directory 2020-01-20 14:28:31 +00:00
gingerBill
9db81498d8 Make the string type elements "immutable", akin to char const * in C
Allows for extra security and optimization benefits
2019-12-01 14:10:59 +00:00
Tetralux
99121d6ff2 Implement core:thread and core:sync on Unix using pthreads
Also do some cleanup and refactoring of the thread, sync and time APIs.

- remove 'semaphore_release' because 'post' and 'wait' is easier to understand

- change 'semaphore_wait' to '*_wait_for' to match Condition

- pthreads can be given a stack, but doing so requires the user to set up the guard
  pages manually. BE WARNED. The alignment requirements of the stack are also
  platform-dependant; it may need to be page size aligned on some systems.
  Unclear which systems, however. See 'os.get_page_size', and 'mem.make_aligned'.
  HOWEVER: I was unable to get custom stacks with guard pages working reliably,
  so while you can do it, the API does not support it.

- add 'os.get_page_size', 'mem.make_aligned', and 'mem.new_aligned'.

- removed thread return values because windows and linux are not consistent; windows returns 'i32'
  and pthreads return 'void*'; besides which, if you really wanted to communicate how the
  thread exited, you probably wouldn't do it with the thread's exit code.

- fixed 'thread.is_done' on Windows; it didn't report true immediately after calling 'thread.join'.

- moved time related stuff out of 'core:os' to 'core:time'.

- add 'mem.align_backward'

- fixed default allocator alignment
  The heap on Windows, and calloc on Linux, both have no facility to request alignment.
  It's a bit of hack, but the heap_allocator now overallocates; `size + alignment` bytes,
  and aligns things to at least 2.
  It does both of these things to ensure that there is at least two bytes before the payload,
  which it uses to store how much padding it needed to insert in order to fulfil the alignment
  requested.

- make conditions more sane by matching the Windows behaviour.
  The fact that they were signalled now lingers until a thread tries to wait,
  causing them to just pass by uninterrupted, without sleeping or locking the
  underlying mutex, as it would otherwise need to do.
  This means that a thread no longer has to be waiting in order to be signalled, which
  avoids timing bugs that causes deadlocks that are hard to debug and fix.
  See the comment on the `sync.Condition.flag` field.

- add thread priority: `thread.create(worker_proc, .High)`
2019-12-01 00:46:23 +00:00
gingerBill
2c5c8192f8 Fix parsing for procedure literals expression statements; improve assert performance; other minor fixes 2019-07-28 22:58:56 +01:00
gingerBill
f25818e923 Make procedure parameters just named values rather than copied variables 2019-07-15 21:18:37 +01:00
Jeroen van Rijn
155b138aa4 call_external_process cleanup 2019-04-05 13:18:50 +02:00
Jeroen van Rijn
a730b04bf1 Add helpers to launch process and open website. 2019-04-05 13:02:49 +02:00
gingerBill
b1684fe455 @(private) for foreign blocks; Improve foreign signature similarity rules 2019-03-24 11:58:26 +00:00
Brendan Punsky
e3d1d1d85c Merge branch 'master' into master 2019-03-18 17:22:57 -04:00
gingerBill
1eaa47ebae Fix using import behaviour - #352 2019-03-17 13:03:39 +00:00
gingerBill
dbcd49acfc Add -pdb-name for custom names of PDBs 2019-03-14 23:26:32 +00:00
Brendan Punsky
e398c074db Fix typo 2019-03-13 18:37:01 -04:00
Brendan Punsky
eadb66c9ef Merge branch 'master' into master 2019-03-13 16:45:46 -04:00
Brendan Punsky
9d7e1c17cc Update kernel32.odin
Add Win32 path functions
2019-03-13 16:44:11 -04:00
Jeroen van Rijn
4f24f1172e Stylistic improvements to new comdlg helpers. 2019-03-09 13:48:48 +01:00
Jeroen van Rijn
090937f8af Add convenience functions for open + save dialogs. 2019-03-09 12:45:17 +01:00