Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/odin-lang/Odin
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerBill committed Sep 19, 2023
2 parents 3505c1d + 150a72f commit ecde06e
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 141 deletions.
12 changes: 6 additions & 6 deletions core/encoding/json/marshal.odin
Original file line number Diff line number Diff line change
Expand Up @@ -404,19 +404,19 @@ opt_write_key :: proc(w: io.Writer, opt: ^Marshal_Options, name: string) -> (err
switch opt.spec {
case .JSON, .JSON5:
io.write_quoted_string(w, name) or_return
io.write_string(w, ": ") or_return
io.write_string(w, ": " if opt.pretty else ":") or_return

case .MJSON:
if opt.mjson_keys_use_quotes {
io.write_quoted_string(w, name) or_return
} else {
io.write_string(w, name) or_return
}

if opt.mjson_keys_use_equal_sign {
io.write_string(w, " = ") or_return
io.write_string(w, " = " if opt.pretty else "=") or_return
} else {
io.write_string(w, ": ") or_return
io.write_string(w, ": " if opt.pretty else ":") or_return
}
}

Expand Down Expand Up @@ -446,7 +446,7 @@ opt_write_iteration :: proc(w: io.Writer, opt: ^Marshal_Options, iteration: int)
switch opt.spec {
case .JSON, .JSON5:
if iteration > 0 {
io.write_string(w, ", ") or_return
io.write_byte(w, ',') or_return

if opt.pretty {
io.write_byte(w, '\n') or_return
Expand All @@ -462,7 +462,7 @@ opt_write_iteration :: proc(w: io.Writer, opt: ^Marshal_Options, iteration: int)
io.write_byte(w, '\n') or_return
} else {
// comma separation necessary for non pretty output!
io.write_string(w, ", ") or_return
io.write_byte(w, ',') or_return
}
}

Expand Down
15 changes: 15 additions & 0 deletions core/sys/windows/kernel32.odin
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,21 @@ foreign kernel32 {
SetThreadPriority :: proc(thread: HANDLE, priority: c_int) -> BOOL ---
GetExitCodeThread :: proc(thread: HANDLE, exit_code: ^DWORD) -> BOOL ---
TerminateThread :: proc(thread: HANDLE, exit_code: DWORD) -> BOOL ---
SuspendThread :: proc(hThread: HANDLE) -> DWORD ---

GetProcessAffinityMask :: proc(
hProcess: HANDLE,
lpProcessAffinityMask: PDWORD_PTR,
lpSystemAffinityMask: PDWORD_PTR,
) -> BOOL ---
SetProcessAffinityMask :: proc(
hProcess: HANDLE,
dwProcessAffinityMask: DWORD_PTR,
) -> BOOL ---
SetThreadAffinityMask :: proc(
hThread: HANDLE,
dwThreadAffinityMask: DWORD_PTR,
) -> DWORD_PTR ---

CreateSemaphoreW :: proc(attributes: LPSECURITY_ATTRIBUTES, initial_count, maximum_count: LONG, name: LPCWSTR) -> HANDLE ---
ReleaseSemaphore :: proc(semaphore: HANDLE, release_count: LONG, previous_count: ^LONG) -> BOOL ---
Expand Down
5 changes: 5 additions & 0 deletions vendor/directx/d3d11/d3d11.odin
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ GUID :: dxgi.GUID
IID :: dxgi.IID
SIZE_T :: dxgi.SIZE_T
BOOL :: dxgi.BOOL
UINT :: dxgi.UINT

RECT :: dxgi.RECT
SIZE :: dxgi.SIZE
Expand Down Expand Up @@ -5146,3 +5147,7 @@ MESSAGE_ID :: enum u32 {
TRACKED_WORKLOAD_DISJOINT_FAILURE,
D3D11_5_MESSAGES_END,
}

CalcSubresource :: #force_inline proc "contextless" (MipSlice: UINT, ArraySlice: UINT, MipLevels: UINT) -> UINT {
return MipSlice + ArraySlice * MipLevels
}
Loading

0 comments on commit ecde06e

Please sign in to comment.