authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-11-01 01:06:00+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-11-02 10:44:18+01:00
log5a6cc552e362fccfd29570a2473573748f86c424
treeb449ff4335cac9a9d3611046a0819ae4be34cb23
parent82e82b6267f314e76b1030310032f2c0ff5caa93
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.windows: Fix some incorrect callconv specifiers.

Closes #21869.

2 files changed, 17 insertions(+), 17 deletions(-)

lib/std/Thread.zig+3-3
...@@ -589,7 +589,7 @@ const WindowsThreadImpl = struct {...@@ -589,7 +589,7 @@ const WindowsThreadImpl = struct {
589 fn_args: Args,589 fn_args: Args,
590 thread: ThreadCompletion,590 thread: ThreadCompletion,
591591
592 fn entryFn(raw_ptr: windows.PVOID) callconv(.C) windows.DWORD {592 fn entryFn(raw_ptr: windows.PVOID) callconv(.winapi) windows.DWORD {
593 const self: *@This() = @ptrCast(@alignCast(raw_ptr));593 const self: *@This() = @ptrCast(@alignCast(raw_ptr));
594 defer switch (self.thread.completion.swap(.completed, .seq_cst)) {594 defer switch (self.thread.completion.swap(.completed, .seq_cst)) {
595 .running => {},595 .running => {},
...@@ -749,7 +749,7 @@ const PosixThreadImpl = struct {...@@ -749,7 +749,7 @@ const PosixThreadImpl = struct {
749 const allocator = std.heap.c_allocator;749 const allocator = std.heap.c_allocator;
750750
751 const Instance = struct {751 const Instance = struct {
752 fn entryFn(raw_arg: ?*anyopaque) callconv(.C) ?*anyopaque {752 fn entryFn(raw_arg: ?*anyopaque) callconv(.c) ?*anyopaque {
753 const args_ptr: *Args = @ptrCast(@alignCast(raw_arg));753 const args_ptr: *Args = @ptrCast(@alignCast(raw_arg));
754 defer allocator.destroy(args_ptr);754 defer allocator.destroy(args_ptr);
755 return callFn(f, args_ptr.*);755 return callFn(f, args_ptr.*);
...@@ -1363,7 +1363,7 @@ const LinuxThreadImpl = struct {...@@ -1363,7 +1363,7 @@ const LinuxThreadImpl = struct {
1363 fn_args: Args,1363 fn_args: Args,
1364 thread: ThreadCompletion,1364 thread: ThreadCompletion,
13651365
1366 fn entryFn(raw_arg: usize) callconv(.C) u8 {1366 fn entryFn(raw_arg: usize) callconv(.c) u8 {
1367 const self = @as(*@This(), @ptrFromInt(raw_arg));1367 const self = @as(*@This(), @ptrFromInt(raw_arg));
1368 defer switch (self.thread.completion.swap(.completed, .seq_cst)) {1368 defer switch (self.thread.completion.swap(.completed, .seq_cst)) {
1369 .running => {},1369 .running => {},
lib/std/os/windows.zig+14-14
...@@ -2101,8 +2101,8 @@ pub fn UnlockFile(...@@ -2101,8 +2101,8 @@ pub fn UnlockFile(
21012101
2102/// This is a workaround for the C backend until zig has the ability to put2102/// This is a workaround for the C backend until zig has the ability to put
2103/// C code in inline assembly.2103/// C code in inline assembly.
2104extern fn zig_x86_windows_teb() callconv(.C) *anyopaque;2104extern fn zig_x86_windows_teb() callconv(.c) *anyopaque;
2105extern fn zig_x86_64_windows_teb() callconv(.C) *anyopaque;2105extern fn zig_x86_64_windows_teb() callconv(.c) *anyopaque;
21062106
2107pub fn teb() *TEB {2107pub fn teb() *TEB {
2108 return switch (native_arch) {2108 return switch (native_arch) {
...@@ -3567,7 +3567,7 @@ pub const MEM_RESERVE_PLACEHOLDERS = 0x2;...@@ -3567,7 +3567,7 @@ pub const MEM_RESERVE_PLACEHOLDERS = 0x2;
3567pub const MEM_DECOMMIT = 0x4000;3567pub const MEM_DECOMMIT = 0x4000;
3568pub const MEM_RELEASE = 0x8000;3568pub const MEM_RELEASE = 0x8000;
35693569
3570pub const PTHREAD_START_ROUTINE = *const fn (LPVOID) callconv(.C) DWORD;3570pub const PTHREAD_START_ROUTINE = *const fn (LPVOID) callconv(.winapi) DWORD;
3571pub const LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE;3571pub const LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE;
35723572
3573pub const WIN32_FIND_DATAW = extern struct {3573pub const WIN32_FIND_DATAW = extern struct {
...@@ -3745,7 +3745,7 @@ pub const IMAGE_TLS_DIRECTORY = extern struct {...@@ -3745,7 +3745,7 @@ pub const IMAGE_TLS_DIRECTORY = extern struct {
3745pub const IMAGE_TLS_DIRECTORY64 = IMAGE_TLS_DIRECTORY;3745pub const IMAGE_TLS_DIRECTORY64 = IMAGE_TLS_DIRECTORY;
3746pub const IMAGE_TLS_DIRECTORY32 = IMAGE_TLS_DIRECTORY;3746pub const IMAGE_TLS_DIRECTORY32 = IMAGE_TLS_DIRECTORY;
37473747
3748pub const PIMAGE_TLS_CALLBACK = ?*const fn (PVOID, DWORD, PVOID) callconv(.C) void;3748pub const PIMAGE_TLS_CALLBACK = ?*const fn (PVOID, DWORD, PVOID) callconv(.winapi) void;
37493749
3750pub const PROV_RSA_FULL = 1;3750pub const PROV_RSA_FULL = 1;
37513751
...@@ -3843,7 +3843,7 @@ pub const RTL_QUERY_REGISTRY_ROUTINE = ?*const fn (...@@ -3843,7 +3843,7 @@ pub const RTL_QUERY_REGISTRY_ROUTINE = ?*const fn (
3843 ULONG,3843 ULONG,
3844 ?*anyopaque,3844 ?*anyopaque,
3845 ?*anyopaque,3845 ?*anyopaque,
3846) callconv(WINAPI) NTSTATUS;3846) callconv(.winapi) NTSTATUS;
38473847
3848/// Path is a full path3848/// Path is a full path
3849pub const RTL_REGISTRY_ABSOLUTE = 0;3849pub const RTL_REGISTRY_ABSOLUTE = 0;
...@@ -3940,7 +3940,7 @@ pub const FILE_ACTION_MODIFIED = 0x00000003;...@@ -3940,7 +3940,7 @@ pub const FILE_ACTION_MODIFIED = 0x00000003;
3940pub const FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;3940pub const FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;
3941pub const FILE_ACTION_RENAMED_NEW_NAME = 0x00000005;3941pub const FILE_ACTION_RENAMED_NEW_NAME = 0x00000005;
39423942
3943pub const LPOVERLAPPED_COMPLETION_ROUTINE = ?*const fn (DWORD, DWORD, *OVERLAPPED) callconv(.C) void;3943pub const LPOVERLAPPED_COMPLETION_ROUTINE = ?*const fn (DWORD, DWORD, *OVERLAPPED) callconv(.winapi) void;
39443944
3945pub const FileNotifyChangeFilter = packed struct(DWORD) {3945pub const FileNotifyChangeFilter = packed struct(DWORD) {
3946 file_name: bool = false,3946 file_name: bool = false,
...@@ -4003,7 +4003,7 @@ pub const RTL_CRITICAL_SECTION = extern struct {...@@ -4003,7 +4003,7 @@ pub const RTL_CRITICAL_SECTION = extern struct {
4003pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION;4003pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION;
4004pub const INIT_ONCE = RTL_RUN_ONCE;4004pub const INIT_ONCE = RTL_RUN_ONCE;
4005pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE_INIT;4005pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE_INIT;
4006pub const INIT_ONCE_FN = *const fn (InitOnce: *INIT_ONCE, Parameter: ?*anyopaque, Context: ?*anyopaque) callconv(.C) BOOL;4006pub const INIT_ONCE_FN = *const fn (InitOnce: *INIT_ONCE, Parameter: ?*anyopaque, Context: ?*anyopaque) callconv(.winapi) BOOL;
40074007
4008pub const RTL_RUN_ONCE = extern struct {4008pub const RTL_RUN_ONCE = extern struct {
4009 Ptr: ?*anyopaque,4009 Ptr: ?*anyopaque,
...@@ -4467,7 +4467,7 @@ pub const EXCEPTION_POINTERS = extern struct {...@@ -4467,7 +4467,7 @@ pub const EXCEPTION_POINTERS = extern struct {
4467 ContextRecord: *CONTEXT,4467 ContextRecord: *CONTEXT,
4468};4468};
44694469
4470pub const VECTORED_EXCEPTION_HANDLER = *const fn (ExceptionInfo: *EXCEPTION_POINTERS) callconv(WINAPI) c_long;4470pub const VECTORED_EXCEPTION_HANDLER = *const fn (ExceptionInfo: *EXCEPTION_POINTERS) callconv(.winapi) c_long;
44714471
4472pub const EXCEPTION_DISPOSITION = i32;4472pub const EXCEPTION_DISPOSITION = i32;
4473pub const EXCEPTION_ROUTINE = *const fn (4473pub const EXCEPTION_ROUTINE = *const fn (
...@@ -4475,7 +4475,7 @@ pub const EXCEPTION_ROUTINE = *const fn (...@@ -4475,7 +4475,7 @@ pub const EXCEPTION_ROUTINE = *const fn (
4475 EstablisherFrame: PVOID,4475 EstablisherFrame: PVOID,
4476 ContextRecord: *(Self.CONTEXT),4476 ContextRecord: *(Self.CONTEXT),
4477 DispatcherContext: PVOID,4477 DispatcherContext: PVOID,
4478) callconv(WINAPI) EXCEPTION_DISPOSITION;4478) callconv(.winapi) EXCEPTION_DISPOSITION;
44794479
4480pub const UNWIND_HISTORY_TABLE_SIZE = 12;4480pub const UNWIND_HISTORY_TABLE_SIZE = 12;
4481pub const UNWIND_HISTORY_TABLE_ENTRY = extern struct {4481pub const UNWIND_HISTORY_TABLE_ENTRY = extern struct {
...@@ -4851,7 +4851,7 @@ pub const RTL_DRIVE_LETTER_CURDIR = extern struct {...@@ -4851,7 +4851,7 @@ pub const RTL_DRIVE_LETTER_CURDIR = extern struct {
4851 DosPath: UNICODE_STRING,4851 DosPath: UNICODE_STRING,
4852};4852};
48534853
4854pub const PPS_POST_PROCESS_INIT_ROUTINE = ?*const fn () callconv(.C) void;4854pub const PPS_POST_PROCESS_INIT_ROUTINE = ?*const fn () callconv(.winapi) void;
48554855
4856pub const FILE_DIRECTORY_INFORMATION = extern struct {4856pub const FILE_DIRECTORY_INFORMATION = extern struct {
4857 NextEntryOffset: ULONG,4857 NextEntryOffset: ULONG,
...@@ -4905,7 +4905,7 @@ pub fn FileInformationIterator(comptime FileInformationType: type) type {...@@ -4905,7 +4905,7 @@ pub fn FileInformationIterator(comptime FileInformationType: type) type {
4905 };4905 };
4906}4906}
49074907
4908pub const IO_APC_ROUTINE = *const fn (PVOID, *IO_STATUS_BLOCK, ULONG) callconv(.C) void;4908pub const IO_APC_ROUTINE = *const fn (PVOID, *IO_STATUS_BLOCK, ULONG) callconv(.winapi) void;
49094909
4910pub const CURDIR = extern struct {4910pub const CURDIR = extern struct {
4911 DosPath: UNICODE_STRING,4911 DosPath: UNICODE_STRING,
...@@ -5009,8 +5009,8 @@ pub const ENUM_PAGE_FILE_INFORMATION = extern struct {...@@ -5009,8 +5009,8 @@ pub const ENUM_PAGE_FILE_INFORMATION = extern struct {
5009 PeakUsage: SIZE_T,5009 PeakUsage: SIZE_T,
5010};5010};
50115011
5012pub const PENUM_PAGE_FILE_CALLBACKW = ?*const fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCWSTR) callconv(.C) BOOL;5012pub const PENUM_PAGE_FILE_CALLBACKW = ?*const fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCWSTR) callconv(.winapi) BOOL;
5013pub const PENUM_PAGE_FILE_CALLBACKA = ?*const fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.C) BOOL;5013pub const PENUM_PAGE_FILE_CALLBACKA = ?*const fn (?LPVOID, *ENUM_PAGE_FILE_INFORMATION, LPCSTR) callconv(.winapi) BOOL;
50145014
5015pub const PSAPI_WS_WATCH_INFORMATION_EX = extern struct {5015pub const PSAPI_WS_WATCH_INFORMATION_EX = extern struct {
5016 BasicInfo: PSAPI_WS_WATCH_INFORMATION,5016 BasicInfo: PSAPI_WS_WATCH_INFORMATION,
...@@ -5122,7 +5122,7 @@ pub const CTRL_CLOSE_EVENT: DWORD = 2;...@@ -5122,7 +5122,7 @@ pub const CTRL_CLOSE_EVENT: DWORD = 2;
5122pub const CTRL_LOGOFF_EVENT: DWORD = 5;5122pub const CTRL_LOGOFF_EVENT: DWORD = 5;
5123pub const CTRL_SHUTDOWN_EVENT: DWORD = 6;5123pub const CTRL_SHUTDOWN_EVENT: DWORD = 6;
51245124
5125pub const HANDLER_ROUTINE = *const fn (dwCtrlType: DWORD) callconv(WINAPI) BOOL;5125pub const HANDLER_ROUTINE = *const fn (dwCtrlType: DWORD) callconv(.winapi) BOOL;
51265126
5127/// Processor feature enumeration.5127/// Processor feature enumeration.
5128pub const PF = enum(DWORD) {5128pub const PF = enum(DWORD) {