diff options
| author | NicknEma <62065135+NicknEma@users.noreply.github.com> | 2024-11-04 10:24:27 +0100 |
|---|---|---|
| committer | flysand7 <thebumboni@gmail.com> | 2024-12-01 11:54:52 +1100 |
| commit | 1b7a32f76c8a0424b6011f8a2d74486a937e2ca6 (patch) | |
| tree | 256679e296e8ed748c144c5c7da67a7becd7556d /core | |
| parent | 1a13322cd76571896a4116c5a4df20b93e1782a4 (diff) | |
Mark procs as "contextless" in winerror.odin
So that they can be called from places like the windproc and stuff.
Diffstat (limited to 'core')
| -rw-r--r-- | core/sys/windows/winerror.odin | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/sys/windows/winerror.odin b/core/sys/windows/winerror.odin index b3b470619..61a7d9d86 100644 --- a/core/sys/windows/winerror.odin +++ b/core/sys/windows/winerror.odin @@ -251,26 +251,26 @@ SEVERITY :: enum DWORD { // Generic test for success on any status value (non-negative numbers indicate success). SUCCEEDED :: #force_inline proc "contextless" (#any_int result: int) -> bool { return result >= S_OK } // and the inverse -FAILED :: #force_inline proc(#any_int result: int) -> bool { return result < S_OK } +FAILED :: #force_inline proc "contextless" (#any_int result: int) -> bool { return result < S_OK } // Generic test for error on any status value. -IS_ERROR :: #force_inline proc(#any_int status: int) -> bool { return u32(status) >> 31 == u32(SEVERITY.ERROR) } +IS_ERROR :: #force_inline proc "contextless" (#any_int status: int) -> bool { return u32(status) >> 31 == u32(SEVERITY.ERROR) } // Return the code -HRESULT_CODE :: #force_inline proc(#any_int hr: int) -> int { return int(u32(hr) & 0xFFFF) } +HRESULT_CODE :: #force_inline proc "contextless" (#any_int hr: int) -> int { return int(u32(hr) & 0xFFFF) } // Return the facility -HRESULT_FACILITY :: #force_inline proc(#any_int hr: int) -> FACILITY { return FACILITY((u32(hr) >> 16) & 0x1FFF) } +HRESULT_FACILITY :: #force_inline proc "contextless" (#any_int hr: int) -> FACILITY { return FACILITY((u32(hr) >> 16) & 0x1FFF) } // Return the severity -HRESULT_SEVERITY :: #force_inline proc(#any_int hr: int) -> SEVERITY { return SEVERITY((u32(hr) >> 31) & 0x1) } +HRESULT_SEVERITY :: #force_inline proc "contextless" (#any_int hr: int) -> SEVERITY { return SEVERITY((u32(hr) >> 31) & 0x1) } // Create an HRESULT value from component pieces -MAKE_HRESULT :: #force_inline proc(#any_int sev: int, #any_int fac: int, #any_int code: int) -> HRESULT { +MAKE_HRESULT :: #force_inline proc "contextless" (#any_int sev: int, #any_int fac: int, #any_int code: int) -> HRESULT { return HRESULT((uint(sev)<<31) | (uint(fac)<<16) | (uint(code))) } -DECODE_HRESULT :: #force_inline proc(#any_int hr: int) -> (SEVERITY, FACILITY, int) { +DECODE_HRESULT :: #force_inline proc "contextless" (#any_int hr: int) -> (SEVERITY, FACILITY, int) { return HRESULT_SEVERITY(hr), HRESULT_FACILITY(hr), HRESULT_CODE(hr) } |