authorgravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2018-11-27 01:39:37-06:00
committergravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2019-01-11 09:56:35-06:00
log93851270526e71407b4225a23daa66214a4010f9
tree3e2997207144c14d96c25b36a23240182b6efc58
parentbb31695fbfbf7c808dc3fd8c3cfc0b654ed15e5e

changed pointer types


2 files changed, 6 insertions(+), 5 deletions(-)

std/mutex.zig+4-3
......@@ -82,9 +82,9 @@ pub const Mutex = switch(builtin.os) {
8282 };
8383 }
8484
85 extern fn initCriticalSection(InitOnce: *windows.PINIT_ONCE, Parameter: ?windows.PVOID, Context: ?*windows.PVOID) windows.BOOL {
85 extern fn initCriticalSection(InitOnce: *windows.PINIT_ONCE, Parameter: ?windows.PVOID, Context: ?windows.PVOID) windows.BOOL {
8686 if (Context) |ctx| {
87 var mutex = @ptrCast(*?windows.CRITICAL_SECTION, ctx);
87 var mutex = @ptrCast(*?windows.CRITICAL_SECTION, @alignCast(8, ctx));
8888 if (mutex.* == null) {
8989 var lock: windows.CRITICAL_SECTION = undefined;
9090 windows.InitializeCriticalSection(&lock);
......@@ -105,7 +105,8 @@ pub const Mutex = switch(builtin.os) {
105105 if (self.lock) |*lock| {
106106 windows.EnterCriticalSection(lock);
107107 } else {
108 if (windows.InitOnceExecuteOnce(&self.init_once, initCriticalSection, null, @ptrCast(?*windows.PVOID, self)) == windows.TRUE) {
108 var mutex = @ptrCast(?windows.PVOID, self);
109 if (windows.InitOnceExecuteOnce(&self.init_once, initCriticalSection, null, mutex) == windows.TRUE) {
109110 windows.EnterCriticalSection(&self.lock.?);
110111 } else {
111112 @panic("unable to initialize Mutex");
std/os/windows/kernel32.zig+2-2
......@@ -254,9 +254,9 @@ pub const RTL_CRITICAL_SECTION = extern struct {
254254
255255pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION;
256256
257pub extern "kernel32" stdcallcc fn InitOnceExecuteOnce(InitOnce: *PINIT_ONCE, InitFn: PINIT_ONCE_FN, Context: ?PVOID, Parameter: ?*LPVOID) BOOL;
257pub extern "kernel32" stdcallcc fn InitOnceExecuteOnce(InitOnce: *PINIT_ONCE, InitFn: PINIT_ONCE_FN, Context: ?PVOID, Parameter: ?LPVOID) BOOL;
258258
259pub const PINIT_ONCE_FN = ?extern fn(InitOnce: *PINIT_ONCE, Parameter: ?PVOID, Context: ?*PVOID) BOOL;
259pub const PINIT_ONCE_FN = ?extern fn(InitOnce: *PINIT_ONCE, Parameter: ?PVOID, Context: ?PVOID) BOOL;
260260
261261pub const RTL_RUN_ONCE = extern struct {
262262 Ptr: PVOID,