Commit Graph

137 Commits

Author SHA1 Message Date
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
KTRosenberg
673879d1d2 added note about pthread_yield 2020-01-02 16:44:30 -05:00
KTRosenberg
d017b5de9d replaced pthread_yield with ssched_yield, fixed semaphore post:q 2020-01-02 16:25:48 -05:00
gingerBill
3bd00fd6b7 Add thread.Pool with example in demo.odin; Update linalg to support handness changes for projection matrices 2020-01-02 15:07:12 +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
nakst
22e982c8fb New Essence OS layer; cross-compiling improvements 2019-09-02 16:46:50 +01: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
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
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
Jeroen van Rijn
d852b0c948 Add win32.get_cwd to return the current working directory 2019-03-09 11:08:50 +01:00
gingerBill
9b4b20e8b1 package dynlib 2019-03-03 12:08:26 +00:00
gingerBill
79b585ada8 Add minor additions to mem, sync, and sys/win32 2019-02-21 21:45:33 +00:00
Jeroen van Rijn
be1a3488a4 Initial support for GetVersionExA 2019-01-18 13:37:40 +01:00
gingerBill
51da3e469b Add win32 cursor stuff 2019-01-05 11:16:14 +00:00
gingerBill
0546b5c218 Add sys/win32/comdlg32.odin 2019-01-02 20:51:48 +00:00
gingerBill
61a3e50d1b Reorganize sys/win32 2019-01-02 19:17:27 +00:00
gingerBill
c1ec45dc0a Update sys/win32; Add Menu stuff 2019-01-01 20:18:48 +00:00
gingerBill
ff6ec860b3 Fix typo 2018-12-08 11:06:32 +00:00
dimenus
f288614eaf style fixes & PR changes 2018-12-06 11:44:59 -06:00
dimenus
9761d54c24 added win32 vk codes 2018-12-05 14:37:47 -06:00
dimenus
3794914478 fixed typo in 'GetMonitorInfoA' & added additional window styles 2018-12-05 11:13:43 -06:00
gingerBill
0858ae2024 Add utf8_to_ucs2 for package win32 so that the wide procedures can used by default 2018-08-30 10:59:46 +01:00
gingerBill
e9e7ce2606 Allow .allocator for dynamic arrays; Add mem.Pool 2018-06-12 19:10:14 +01:00
gingerBill
12b870ba66 Use const & for Array<AstNode *> parameters 2018-06-03 10:30:31 +01:00
gingerBill
c067b90403 Add basic package support (no IR support yet) 2018-05-26 23:12:55 +01:00
gingerBill
5b6770f3d2 Parse directories to be packages 2018-05-21 20:47:52 +01:00
Mikkel Hjortshoej
2de62910fc Added more function to windows.odin 2018-04-13 22:38:58 +02:00
gingerBill
9da05dd4cb Update core library with cstring 2018-02-28 11:44:41 +00:00
Mikkel Hjortshoej
ffec1c77f2 Added terminate_thread to thread.odin 2018-02-25 14:56:50 +01:00
Brendan Punsky
60a54f404b Auto stash before merge of "master" and "origin/master" 2018-02-22 20:11:17 -05:00
Mikkel Hjortshoej
4c06b44315 Merge branch 'master' of github.com:odin-lang/odin 2018-02-07 21:23:28 +01:00
Mikkel Hjortshoej
678b58e0b1 Added widechar versions of functions, plus cursor functions 2018-02-07 21:17:59 +01:00
gingerBill
92780e2683 distinct keyword for type declarations 2018-02-05 22:46:30 +00:00
Mikkel Hjortshoej
1160fd4331 functions, structs and constants related to getting file notifications 2018-02-03 21:56:15 +01:00
Mikkel Hjortshoej
4e7867fcc1 More file handling functions 2018-01-25 00:00:34 +01:00
Mikkel Hjortshoej
4c3e65791e added stuff to windows.odin 2018-01-24 07:26:29 +01:00
gingerBill
4b14d608f4 Update sys/windows.odin to use Bool :: b32; rather than i32 2018-01-17 14:02:19 +00:00
gingerBill
30530d058c Remove struct #ordered 2017-12-17 14:53:40 +00:00