| author | |
| committer | |
| log | 9f9f215305389c08a21730859982b68bf2681932 |
| tree | bbb7ca8488e55f6fa329ae30ae04e6cf7dfe4f06 |
| parent | 8468b544e8769b774e2e5988a58c51d991df999a |
| signature |
zig fmt now replaces c_void with anyopaque to make updating
code easy.78 files changed, 597 insertions(+), 557 deletions(-)
doc/docgen.zig+4-4| ... | @@ -853,10 +853,10 @@ fn termColor(allocator: Allocator, input: []const u8) ![]u8 { | ... | @@ -853,10 +853,10 @@ fn termColor(allocator: Allocator, input: []const u8) ![]u8 { |
| 853 | } | 853 | } |
| 854 | 854 | ||
| 855 | const builtin_types = [_][]const u8{ | 855 | const builtin_types = [_][]const u8{ |
| 856 | "f16", "f32", "f64", "f128", "c_longdouble", "c_short", | 856 | "f16", "f32", "f64", "f128", "c_longdouble", "c_short", |
| 857 | "c_ushort", "c_int", "c_uint", "c_long", "c_ulong", "c_longlong", | 857 | "c_ushort", "c_int", "c_uint", "c_long", "c_ulong", "c_longlong", |
| 858 | "c_ulonglong", "c_char", "c_void", "void", "bool", "isize", | 858 | "c_ulonglong", "c_char", "anyopaque", "void", "bool", "isize", |
| 859 | "usize", "noreturn", "type", "anyerror", "comptime_int", "comptime_float", | 859 | "usize", "noreturn", "type", "anyerror", "comptime_int", "comptime_float", |
| 860 | }; | 860 | }; |
| 861 | 861 | ||
| 862 | fn isType(name: []const u8) bool { | 862 | fn isType(name: []const u8) bool { |
doc/langref.html.in+5-5| ... | @@ -720,11 +720,6 @@ pub fn main() void { | ... | @@ -720,11 +720,6 @@ pub fn main() void { |
| 720 | <td><code class="c">long double</code></td> | 720 | <td><code class="c">long double</code></td> |
| 721 | <td>for ABI compatibility with C</td> | 721 | <td>for ABI compatibility with C</td> |
| 722 | </tr> | 722 | </tr> |
| 723 | <tr> | ||
| 724 | <th scope="row">{#syntax#}c_void{#endsyntax#}</th> | ||
| 725 | <td><code class="c">void</code></td> | ||
| 726 | <td>for ABI compatibility with C</td> | ||
| 727 | </tr> | ||
| 728 | 723 | ||
| 729 | <tr> | 724 | <tr> |
| 730 | <th scope="row">{#syntax#}f16{#endsyntax#}</th> | 725 | <th scope="row">{#syntax#}f16{#endsyntax#}</th> |
| ... | @@ -751,6 +746,11 @@ pub fn main() void { | ... | @@ -751,6 +746,11 @@ pub fn main() void { |
| 751 | <td><code class="c">bool</code></td> | 746 | <td><code class="c">bool</code></td> |
| 752 | <td>{#syntax#}true{#endsyntax#} or {#syntax#}false{#endsyntax#}</td> | 747 | <td>{#syntax#}true{#endsyntax#} or {#syntax#}false{#endsyntax#}</td> |
| 753 | </tr> | 748 | </tr> |
| 749 | <tr> | ||
| 750 | <th scope="row">{#syntax#}anyopaque{#endsyntax#}</th> | ||
| 751 | <td><code class="c">void</code></td> | ||
| 752 | <td>Used for type-erased pointers.</td> | ||
| 753 | </tr> | ||
| 754 | <tr> | 754 | <tr> |
| 755 | <th scope="row">{#syntax#}void{#endsyntax#}</th> | 755 | <th scope="row">{#syntax#}void{#endsyntax#}</th> |
| 756 | <td>(none)</td> | 756 | <td>(none)</td> |
lib/std/Thread.zig+4-4| ... | @@ -344,7 +344,7 @@ const Completion = Atomic(enum(u8) { | ... | @@ -344,7 +344,7 @@ const Completion = Atomic(enum(u8) { |
| 344 | fn callFn(comptime f: anytype, args: anytype) switch (Impl) { | 344 | fn callFn(comptime f: anytype, args: anytype) switch (Impl) { |
| 345 | WindowsThreadImpl => std.os.windows.DWORD, | 345 | WindowsThreadImpl => std.os.windows.DWORD, |
| 346 | LinuxThreadImpl => u8, | 346 | LinuxThreadImpl => u8, |
| 347 | PosixThreadImpl => ?*c_void, | 347 | PosixThreadImpl => ?*anyopaque, |
| 348 | else => unreachable, | 348 | else => unreachable, |
| 349 | } { | 349 | } { |
| 350 | const default_value = if (Impl == PosixThreadImpl) null else 0; | 350 | const default_value = if (Impl == PosixThreadImpl) null else 0; |
| ... | @@ -499,7 +499,7 @@ const WindowsThreadImpl = struct { | ... | @@ -499,7 +499,7 @@ const WindowsThreadImpl = struct { |
| 499 | null, | 499 | null, |
| 500 | stack_size, | 500 | stack_size, |
| 501 | Instance.entryFn, | 501 | Instance.entryFn, |
| 502 | @ptrCast(*c_void, instance), | 502 | @ptrCast(*anyopaque, instance), |
| 503 | 0, | 503 | 0, |
| 504 | null, | 504 | null, |
| 505 | ) orelse { | 505 | ) orelse { |
| ... | @@ -621,7 +621,7 @@ const PosixThreadImpl = struct { | ... | @@ -621,7 +621,7 @@ const PosixThreadImpl = struct { |
| 621 | const allocator = std.heap.c_allocator; | 621 | const allocator = std.heap.c_allocator; |
| 622 | 622 | ||
| 623 | const Instance = struct { | 623 | const Instance = struct { |
| 624 | fn entryFn(raw_arg: ?*c_void) callconv(.C) ?*c_void { | 624 | fn entryFn(raw_arg: ?*anyopaque) callconv(.C) ?*anyopaque { |
| 625 | // @alignCast() below doesn't support zero-sized-types (ZST) | 625 | // @alignCast() below doesn't support zero-sized-types (ZST) |
| 626 | if (@sizeOf(Args) < 1) { | 626 | if (@sizeOf(Args) < 1) { |
| 627 | return callFn(f, @as(Args, undefined)); | 627 | return callFn(f, @as(Args, undefined)); |
| ... | @@ -651,7 +651,7 @@ const PosixThreadImpl = struct { | ... | @@ -651,7 +651,7 @@ const PosixThreadImpl = struct { |
| 651 | &handle, | 651 | &handle, |
| 652 | &attr, | 652 | &attr, |
| 653 | Instance.entryFn, | 653 | Instance.entryFn, |
| 654 | if (@sizeOf(Args) > 1) @ptrCast(*c_void, args_ptr) else undefined, | 654 | if (@sizeOf(Args) > 1) @ptrCast(*anyopaque, args_ptr) else undefined, |
| 655 | )) { | 655 | )) { |
| 656 | .SUCCESS => return Impl{ .handle = handle }, | 656 | .SUCCESS => return Impl{ .handle = handle }, |
| 657 | .AGAIN => return error.SystemResources, | 657 | .AGAIN => return error.SystemResources, |
lib/std/Thread/Futex.zig+5-5| ... | @@ -107,8 +107,8 @@ const WindowsFutex = struct { | ... | @@ -107,8 +107,8 @@ const WindowsFutex = struct { |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | switch (windows.ntdll.RtlWaitOnAddress( | 109 | switch (windows.ntdll.RtlWaitOnAddress( |
| 110 | @ptrCast(?*const c_void, ptr), | 110 | @ptrCast(?*const anyopaque, ptr), |
| 111 | @ptrCast(?*const c_void, &expect), | 111 | @ptrCast(?*const anyopaque, &expect), |
| 112 | @sizeOf(@TypeOf(expect)), | 112 | @sizeOf(@TypeOf(expect)), |
| 113 | timeout_ptr, | 113 | timeout_ptr, |
| 114 | )) { | 114 | )) { |
| ... | @@ -119,7 +119,7 @@ const WindowsFutex = struct { | ... | @@ -119,7 +119,7 @@ const WindowsFutex = struct { |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | fn wake(ptr: *const Atomic(u32), num_waiters: u32) void { | 121 | fn wake(ptr: *const Atomic(u32), num_waiters: u32) void { |
| 122 | const address = @ptrCast(?*const c_void, ptr); | 122 | const address = @ptrCast(?*const anyopaque, ptr); |
| 123 | switch (num_waiters) { | 123 | switch (num_waiters) { |
| 124 | 1 => windows.ntdll.RtlWakeAddressSingle(address), | 124 | 1 => windows.ntdll.RtlWakeAddressSingle(address), |
| 125 | else => windows.ntdll.RtlWakeAddressAll(address), | 125 | else => windows.ntdll.RtlWakeAddressAll(address), |
| ... | @@ -189,7 +189,7 @@ const DarwinFutex = struct { | ... | @@ -189,7 +189,7 @@ const DarwinFutex = struct { |
| 189 | assert(timeout_value != 0); | 189 | assert(timeout_value != 0); |
| 190 | timeout_ns = timeout_value; | 190 | timeout_ns = timeout_value; |
| 191 | } | 191 | } |
| 192 | const addr = @ptrCast(*const c_void, ptr); | 192 | const addr = @ptrCast(*const anyopaque, ptr); |
| 193 | const flags = darwin.UL_COMPARE_AND_WAIT | darwin.ULF_NO_ERRNO; | 193 | const flags = darwin.UL_COMPARE_AND_WAIT | darwin.ULF_NO_ERRNO; |
| 194 | // If we're using `__ulock_wait` and `timeout` is too big to fit inside a `u32` count of | 194 | // If we're using `__ulock_wait` and `timeout` is too big to fit inside a `u32` count of |
| 195 | // micro-seconds (around 70min), we'll request a shorter timeout. This is fine (users | 195 | // micro-seconds (around 70min), we'll request a shorter timeout. This is fine (users |
| ... | @@ -228,7 +228,7 @@ const DarwinFutex = struct { | ... | @@ -228,7 +228,7 @@ const DarwinFutex = struct { |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | while (true) { | 230 | while (true) { |
| 231 | const addr = @ptrCast(*const c_void, ptr); | 231 | const addr = @ptrCast(*const anyopaque, ptr); |
| 232 | const status = darwin.__ulock_wake(flags, addr, 0); | 232 | const status = darwin.__ulock_wake(flags, addr, 0); |
| 233 | 233 | ||
| 234 | if (status >= 0) return; | 234 | if (status >= 0) return; |
lib/std/Thread/StaticResetEvent.zig+2-2| ... | @@ -229,7 +229,7 @@ pub const AtomicEvent = struct { | ... | @@ -229,7 +229,7 @@ pub const AtomicEvent = struct { |
| 229 | pub const WindowsFutex = struct { | 229 | pub const WindowsFutex = struct { |
| 230 | pub fn wake(waiters: *u32, wake_count: u32) void { | 230 | pub fn wake(waiters: *u32, wake_count: u32) void { |
| 231 | const handle = getEventHandle() orelse return SpinFutex.wake(waiters, wake_count); | 231 | const handle = getEventHandle() orelse return SpinFutex.wake(waiters, wake_count); |
| 232 | const key = @ptrCast(*const c_void, waiters); | 232 | const key = @ptrCast(*const anyopaque, waiters); |
| 233 | 233 | ||
| 234 | var waiting = wake_count; | 234 | var waiting = wake_count; |
| 235 | while (waiting != 0) : (waiting -= 1) { | 235 | while (waiting != 0) : (waiting -= 1) { |
| ... | @@ -240,7 +240,7 @@ pub const AtomicEvent = struct { | ... | @@ -240,7 +240,7 @@ pub const AtomicEvent = struct { |
| 240 | 240 | ||
| 241 | pub fn wait(waiters: *u32, timeout: ?u64) !void { | 241 | pub fn wait(waiters: *u32, timeout: ?u64) !void { |
| 242 | const handle = getEventHandle() orelse return SpinFutex.wait(waiters, timeout); | 242 | const handle = getEventHandle() orelse return SpinFutex.wait(waiters, timeout); |
| 243 | const key = @ptrCast(*const c_void, waiters); | 243 | const key = @ptrCast(*const anyopaque, waiters); |
| 244 | 244 | ||
| 245 | // NT uses timeouts in units of 100ns with negative value being relative | 245 | // NT uses timeouts in units of 100ns with negative value being relative |
| 246 | var timeout_ptr: ?*windows.LARGE_INTEGER = null; | 246 | var timeout_ptr: ?*windows.LARGE_INTEGER = null; |
lib/std/c.zig+28-28| ... | @@ -121,9 +121,9 @@ pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) i | ... | @@ -121,9 +121,9 @@ pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) i |
| 121 | pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: c.off_t) isize; | 121 | pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: c.off_t) isize; |
| 122 | pub extern "c" fn write(fd: c.fd_t, buf: [*]const u8, nbyte: usize) isize; | 122 | pub extern "c" fn write(fd: c.fd_t, buf: [*]const u8, nbyte: usize) isize; |
| 123 | pub extern "c" fn pwrite(fd: c.fd_t, buf: [*]const u8, nbyte: usize, offset: c.off_t) isize; | 123 | pub extern "c" fn pwrite(fd: c.fd_t, buf: [*]const u8, nbyte: usize, offset: c.off_t) isize; |
| 124 | pub extern "c" fn mmap(addr: ?*align(page_size) c_void, len: usize, prot: c_uint, flags: c_uint, fd: c.fd_t, offset: c.off_t) *c_void; | 124 | pub extern "c" fn mmap(addr: ?*align(page_size) anyopaque, len: usize, prot: c_uint, flags: c_uint, fd: c.fd_t, offset: c.off_t) *anyopaque; |
| 125 | pub extern "c" fn munmap(addr: *align(page_size) const c_void, len: usize) c_int; | 125 | pub extern "c" fn munmap(addr: *align(page_size) const anyopaque, len: usize) c_int; |
| 126 | pub extern "c" fn mprotect(addr: *align(page_size) c_void, len: usize, prot: c_uint) c_int; | 126 | pub extern "c" fn mprotect(addr: *align(page_size) anyopaque, len: usize, prot: c_uint) c_int; |
| 127 | pub extern "c" fn link(oldpath: [*:0]const u8, newpath: [*:0]const u8, flags: c_int) c_int; | 127 | pub extern "c" fn link(oldpath: [*:0]const u8, newpath: [*:0]const u8, flags: c_int) c_int; |
| 128 | pub extern "c" fn linkat(oldfd: c.fd_t, oldpath: [*:0]const u8, newfd: c.fd_t, newpath: [*:0]const u8, flags: c_int) c_int; | 128 | pub extern "c" fn linkat(oldfd: c.fd_t, oldpath: [*:0]const u8, newfd: c.fd_t, newpath: [*:0]const u8, flags: c_int) c_int; |
| 129 | pub extern "c" fn unlink(path: [*:0]const u8) c_int; | 129 | pub extern "c" fn unlink(path: [*:0]const u8) c_int; |
| ... | @@ -152,8 +152,8 @@ pub extern "c" fn fchown(fd: c.fd_t, owner: c.uid_t, group: c.gid_t) c_int; | ... | @@ -152,8 +152,8 @@ pub extern "c" fn fchown(fd: c.fd_t, owner: c.uid_t, group: c.gid_t) c_int; |
| 152 | 152 | ||
| 153 | pub extern "c" fn rmdir(path: [*:0]const u8) c_int; | 153 | pub extern "c" fn rmdir(path: [*:0]const u8) c_int; |
| 154 | pub extern "c" fn getenv(name: [*:0]const u8) ?[*:0]u8; | 154 | pub extern "c" fn getenv(name: [*:0]const u8) ?[*:0]u8; |
| 155 | pub extern "c" fn sysctl(name: [*]const c_int, namelen: c_uint, oldp: ?*c_void, oldlenp: ?*usize, newp: ?*c_void, newlen: usize) c_int; | 155 | pub extern "c" fn sysctl(name: [*]const c_int, namelen: c_uint, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int; |
| 156 | pub extern "c" fn sysctlbyname(name: [*:0]const u8, oldp: ?*c_void, oldlenp: ?*usize, newp: ?*c_void, newlen: usize) c_int; | 156 | pub extern "c" fn sysctlbyname(name: [*:0]const u8, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int; |
| 157 | pub extern "c" fn sysctlnametomib(name: [*:0]const u8, mibp: ?*c_int, sizep: ?*usize) c_int; | 157 | pub extern "c" fn sysctlnametomib(name: [*:0]const u8, mibp: ?*c_int, sizep: ?*usize) c_int; |
| 158 | pub extern "c" fn tcgetattr(fd: c.fd_t, termios_p: *c.termios) c_int; | 158 | pub extern "c" fn tcgetattr(fd: c.fd_t, termios_p: *c.termios) c_int; |
| 159 | pub extern "c" fn tcsetattr(fd: c.fd_t, optional_action: c.TCSA, termios_p: *const c.termios) c_int; | 159 | pub extern "c" fn tcsetattr(fd: c.fd_t, optional_action: c.TCSA, termios_p: *const c.termios) c_int; |
| ... | @@ -172,12 +172,12 @@ pub extern "c" fn getpeername(sockfd: c.fd_t, noalias addr: *c.sockaddr, noalias | ... | @@ -172,12 +172,12 @@ pub extern "c" fn getpeername(sockfd: c.fd_t, noalias addr: *c.sockaddr, noalias |
| 172 | pub extern "c" fn connect(sockfd: c.fd_t, sock_addr: *const c.sockaddr, addrlen: c.socklen_t) c_int; | 172 | pub extern "c" fn connect(sockfd: c.fd_t, sock_addr: *const c.sockaddr, addrlen: c.socklen_t) c_int; |
| 173 | pub extern "c" fn accept(sockfd: c.fd_t, noalias addr: ?*c.sockaddr, noalias addrlen: ?*c.socklen_t) c_int; | 173 | pub extern "c" fn accept(sockfd: c.fd_t, noalias addr: ?*c.sockaddr, noalias addrlen: ?*c.socklen_t) c_int; |
| 174 | pub extern "c" fn accept4(sockfd: c.fd_t, noalias addr: ?*c.sockaddr, noalias addrlen: ?*c.socklen_t, flags: c_uint) c_int; | 174 | pub extern "c" fn accept4(sockfd: c.fd_t, noalias addr: ?*c.sockaddr, noalias addrlen: ?*c.socklen_t, flags: c_uint) c_int; |
| 175 | pub extern "c" fn getsockopt(sockfd: c.fd_t, level: u32, optname: u32, noalias optval: ?*c_void, noalias optlen: *c.socklen_t) c_int; | 175 | pub extern "c" fn getsockopt(sockfd: c.fd_t, level: u32, optname: u32, noalias optval: ?*anyopaque, noalias optlen: *c.socklen_t) c_int; |
| 176 | pub extern "c" fn setsockopt(sockfd: c.fd_t, level: u32, optname: u32, optval: ?*const c_void, optlen: c.socklen_t) c_int; | 176 | pub extern "c" fn setsockopt(sockfd: c.fd_t, level: u32, optname: u32, optval: ?*const anyopaque, optlen: c.socklen_t) c_int; |
| 177 | pub extern "c" fn send(sockfd: c.fd_t, buf: *const c_void, len: usize, flags: u32) isize; | 177 | pub extern "c" fn send(sockfd: c.fd_t, buf: *const anyopaque, len: usize, flags: u32) isize; |
| 178 | pub extern "c" fn sendto( | 178 | pub extern "c" fn sendto( |
| 179 | sockfd: c.fd_t, | 179 | sockfd: c.fd_t, |
| 180 | buf: *const c_void, | 180 | buf: *const anyopaque, |
| 181 | len: usize, | 181 | len: usize, |
| 182 | flags: u32, | 182 | flags: u32, |
| 183 | dest_addr: ?*const c.sockaddr, | 183 | dest_addr: ?*const c.sockaddr, |
| ... | @@ -185,10 +185,10 @@ pub extern "c" fn sendto( | ... | @@ -185,10 +185,10 @@ pub extern "c" fn sendto( |
| 185 | ) isize; | 185 | ) isize; |
| 186 | pub extern "c" fn sendmsg(sockfd: c.fd_t, msg: *const std.x.os.Socket.Message, flags: c_int) isize; | 186 | pub extern "c" fn sendmsg(sockfd: c.fd_t, msg: *const std.x.os.Socket.Message, flags: c_int) isize; |
| 187 | 187 | ||
| 188 | pub extern "c" fn recv(sockfd: c.fd_t, arg1: ?*c_void, arg2: usize, arg3: c_int) isize; | 188 | pub extern "c" fn recv(sockfd: c.fd_t, arg1: ?*anyopaque, arg2: usize, arg3: c_int) isize; |
| 189 | pub extern "c" fn recvfrom( | 189 | pub extern "c" fn recvfrom( |
| 190 | sockfd: c.fd_t, | 190 | sockfd: c.fd_t, |
| 191 | noalias buf: *c_void, | 191 | noalias buf: *anyopaque, |
| 192 | len: usize, | 192 | len: usize, |
| 193 | flags: u32, | 193 | flags: u32, |
| 194 | noalias src_addr: ?*c.sockaddr, | 194 | noalias src_addr: ?*c.sockaddr, |
| ... | @@ -208,9 +208,9 @@ pub extern "c" fn setregid(rgid: c.gid_t, egid: c.gid_t) c_int; | ... | @@ -208,9 +208,9 @@ pub extern "c" fn setregid(rgid: c.gid_t, egid: c.gid_t) c_int; |
| 208 | pub extern "c" fn setresuid(ruid: c.uid_t, euid: c.uid_t, suid: c.uid_t) c_int; | 208 | pub extern "c" fn setresuid(ruid: c.uid_t, euid: c.uid_t, suid: c.uid_t) c_int; |
| 209 | pub extern "c" fn setresgid(rgid: c.gid_t, egid: c.gid_t, sgid: c.gid_t) c_int; | 209 | pub extern "c" fn setresgid(rgid: c.gid_t, egid: c.gid_t, sgid: c.gid_t) c_int; |
| 210 | 210 | ||
| 211 | pub extern "c" fn malloc(usize) ?*c_void; | 211 | pub extern "c" fn malloc(usize) ?*anyopaque; |
| 212 | pub extern "c" fn realloc(?*c_void, usize) ?*c_void; | 212 | pub extern "c" fn realloc(?*anyopaque, usize) ?*anyopaque; |
| 213 | pub extern "c" fn free(?*c_void) void; | 213 | pub extern "c" fn free(?*anyopaque) void; |
| 214 | 214 | ||
| 215 | pub extern "c" fn futimes(fd: c.fd_t, times: *[2]c.timeval) c_int; | 215 | pub extern "c" fn futimes(fd: c.fd_t, times: *[2]c.timeval) c_int; |
| 216 | pub extern "c" fn utimes(path: [*:0]const u8, times: *[2]c.timeval) c_int; | 216 | pub extern "c" fn utimes(path: [*:0]const u8, times: *[2]c.timeval) c_int; |
| ... | @@ -218,24 +218,24 @@ pub extern "c" fn utimes(path: [*:0]const u8, times: *[2]c.timeval) c_int; | ... | @@ -218,24 +218,24 @@ pub extern "c" fn utimes(path: [*:0]const u8, times: *[2]c.timeval) c_int; |
| 218 | pub extern "c" fn utimensat(dirfd: c.fd_t, pathname: [*:0]const u8, times: *[2]c.timespec, flags: u32) c_int; | 218 | pub extern "c" fn utimensat(dirfd: c.fd_t, pathname: [*:0]const u8, times: *[2]c.timespec, flags: u32) c_int; |
| 219 | pub extern "c" fn futimens(fd: c.fd_t, times: *const [2]c.timespec) c_int; | 219 | pub extern "c" fn futimens(fd: c.fd_t, times: *const [2]c.timespec) c_int; |
| 220 | 220 | ||
| 221 | pub extern "c" fn pthread_create(noalias newthread: *pthread_t, noalias attr: ?*const c.pthread_attr_t, start_routine: fn (?*c_void) callconv(.C) ?*c_void, noalias arg: ?*c_void) c.E; | 221 | pub extern "c" fn pthread_create(noalias newthread: *pthread_t, noalias attr: ?*const c.pthread_attr_t, start_routine: fn (?*anyopaque) callconv(.C) ?*anyopaque, noalias arg: ?*anyopaque) c.E; |
| 222 | pub extern "c" fn pthread_attr_init(attr: *c.pthread_attr_t) c.E; | 222 | pub extern "c" fn pthread_attr_init(attr: *c.pthread_attr_t) c.E; |
| 223 | pub extern "c" fn pthread_attr_setstack(attr: *c.pthread_attr_t, stackaddr: *c_void, stacksize: usize) c.E; | 223 | pub extern "c" fn pthread_attr_setstack(attr: *c.pthread_attr_t, stackaddr: *anyopaque, stacksize: usize) c.E; |
| 224 | pub extern "c" fn pthread_attr_setstacksize(attr: *c.pthread_attr_t, stacksize: usize) c.E; | 224 | pub extern "c" fn pthread_attr_setstacksize(attr: *c.pthread_attr_t, stacksize: usize) c.E; |
| 225 | pub extern "c" fn pthread_attr_setguardsize(attr: *c.pthread_attr_t, guardsize: usize) c.E; | 225 | pub extern "c" fn pthread_attr_setguardsize(attr: *c.pthread_attr_t, guardsize: usize) c.E; |
| 226 | pub extern "c" fn pthread_attr_destroy(attr: *c.pthread_attr_t) c.E; | 226 | pub extern "c" fn pthread_attr_destroy(attr: *c.pthread_attr_t) c.E; |
| 227 | pub extern "c" fn pthread_self() pthread_t; | 227 | pub extern "c" fn pthread_self() pthread_t; |
| 228 | pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*c_void) c.E; | 228 | pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*anyopaque) c.E; |
| 229 | pub extern "c" fn pthread_detach(thread: pthread_t) c.E; | 229 | pub extern "c" fn pthread_detach(thread: pthread_t) c.E; |
| 230 | pub extern "c" fn pthread_atfork( | 230 | pub extern "c" fn pthread_atfork( |
| 231 | prepare: ?fn () callconv(.C) void, | 231 | prepare: ?fn () callconv(.C) void, |
| 232 | parent: ?fn () callconv(.C) void, | 232 | parent: ?fn () callconv(.C) void, |
| 233 | child: ?fn () callconv(.C) void, | 233 | child: ?fn () callconv(.C) void, |
| 234 | ) c_int; | 234 | ) c_int; |
| 235 | pub extern "c" fn pthread_key_create(key: *c.pthread_key_t, destructor: ?fn (value: *c_void) callconv(.C) void) c.E; | 235 | pub extern "c" fn pthread_key_create(key: *c.pthread_key_t, destructor: ?fn (value: *anyopaque) callconv(.C) void) c.E; |
| 236 | pub extern "c" fn pthread_key_delete(key: c.pthread_key_t) c.E; | 236 | pub extern "c" fn pthread_key_delete(key: c.pthread_key_t) c.E; |
| 237 | pub extern "c" fn pthread_getspecific(key: c.pthread_key_t) ?*c_void; | 237 | pub extern "c" fn pthread_getspecific(key: c.pthread_key_t) ?*anyopaque; |
| 238 | pub extern "c" fn pthread_setspecific(key: c.pthread_key_t, value: ?*c_void) c_int; | 238 | pub extern "c" fn pthread_setspecific(key: c.pthread_key_t, value: ?*anyopaque) c_int; |
| 239 | pub extern "c" fn sem_init(sem: *c.sem_t, pshared: c_int, value: c_uint) c_int; | 239 | pub extern "c" fn sem_init(sem: *c.sem_t, pshared: c_int, value: c_uint) c_int; |
| 240 | pub extern "c" fn sem_destroy(sem: *c.sem_t) c_int; | 240 | pub extern "c" fn sem_destroy(sem: *c.sem_t) c_int; |
| 241 | pub extern "c" fn sem_post(sem: *c.sem_t) c_int; | 241 | pub extern "c" fn sem_post(sem: *c.sem_t) c_int; |
| ... | @@ -260,16 +260,16 @@ pub extern "c" fn port_associate( | ... | @@ -260,16 +260,16 @@ pub extern "c" fn port_associate( |
| 260 | source: u32, | 260 | source: u32, |
| 261 | object: usize, | 261 | object: usize, |
| 262 | events: u32, | 262 | events: u32, |
| 263 | user_var: ?*c_void, | 263 | user_var: ?*anyopaque, |
| 264 | ) c_int; | 264 | ) c_int; |
| 265 | pub extern "c" fn port_dissociate(port: c.port_t, source: u32, object: usize) c_int; | 265 | pub extern "c" fn port_dissociate(port: c.port_t, source: u32, object: usize) c_int; |
| 266 | pub extern "c" fn port_send(port: c.port_t, events: u32, user_var: ?*c_void) c_int; | 266 | pub extern "c" fn port_send(port: c.port_t, events: u32, user_var: ?*anyopaque) c_int; |
| 267 | pub extern "c" fn port_sendn( | 267 | pub extern "c" fn port_sendn( |
| 268 | ports: [*]c.port_t, | 268 | ports: [*]c.port_t, |
| 269 | errors: []u32, | 269 | errors: []u32, |
| 270 | num_ports: u32, | 270 | num_ports: u32, |
| 271 | events: u32, | 271 | events: u32, |
| 272 | user_var: ?*c_void, | 272 | user_var: ?*anyopaque, |
| 273 | ) c_int; | 273 | ) c_int; |
| 274 | pub extern "c" fn port_get(port: c.port_t, event: *c.port_event, timeout: ?*c.timespec) c_int; | 274 | pub extern "c" fn port_get(port: c.port_t, event: *c.port_event, timeout: ?*c.timespec) c_int; |
| 275 | pub extern "c" fn port_getn( | 275 | pub extern "c" fn port_getn( |
| ... | @@ -279,7 +279,7 @@ pub extern "c" fn port_getn( | ... | @@ -279,7 +279,7 @@ pub extern "c" fn port_getn( |
| 279 | events_retrieved: *u32, | 279 | events_retrieved: *u32, |
| 280 | timeout: ?*c.timespec, | 280 | timeout: ?*c.timespec, |
| 281 | ) c_int; | 281 | ) c_int; |
| 282 | pub extern "c" fn port_alert(port: c.port_t, flags: u32, events: u32, user_var: ?*c_void) c_int; | 282 | pub extern "c" fn port_alert(port: c.port_t, flags: u32, events: u32, user_var: ?*anyopaque) c_int; |
| 283 | 283 | ||
| 284 | pub extern "c" fn getaddrinfo( | 284 | pub extern "c" fn getaddrinfo( |
| 285 | noalias node: ?[*:0]const u8, | 285 | noalias node: ?[*:0]const u8, |
| ... | @@ -336,9 +336,9 @@ pub extern "c" fn pthread_rwlock_unlock(rwl: *c.pthread_rwlock_t) callconv(.C) c | ... | @@ -336,9 +336,9 @@ pub extern "c" fn pthread_rwlock_unlock(rwl: *c.pthread_rwlock_t) callconv(.C) c |
| 336 | pub const pthread_t = *opaque {}; | 336 | pub const pthread_t = *opaque {}; |
| 337 | pub const FILE = opaque {}; | 337 | pub const FILE = opaque {}; |
| 338 | 338 | ||
| 339 | pub extern "c" fn dlopen(path: [*:0]const u8, mode: c_int) ?*c_void; | 339 | pub extern "c" fn dlopen(path: [*:0]const u8, mode: c_int) ?*anyopaque; |
| 340 | pub extern "c" fn dlclose(handle: *c_void) c_int; | 340 | pub extern "c" fn dlclose(handle: *anyopaque) c_int; |
| 341 | pub extern "c" fn dlsym(handle: ?*c_void, symbol: [*:0]const u8) ?*c_void; | 341 | pub extern "c" fn dlsym(handle: ?*anyopaque, symbol: [*:0]const u8) ?*anyopaque; |
| 342 | 342 | ||
| 343 | pub extern "c" fn sync() void; | 343 | pub extern "c" fn sync() void; |
| 344 | pub extern "c" fn syncfs(fd: c_int) c_int; | 344 | pub extern "c" fn syncfs(fd: c_int) c_int; |
| ... | @@ -350,7 +350,7 @@ pub extern "c" fn prctl(option: c_int, ...) c_int; | ... | @@ -350,7 +350,7 @@ pub extern "c" fn prctl(option: c_int, ...) c_int; |
| 350 | pub extern "c" fn getrlimit(resource: c.rlimit_resource, rlim: *c.rlimit) c_int; | 350 | pub extern "c" fn getrlimit(resource: c.rlimit_resource, rlim: *c.rlimit) c_int; |
| 351 | pub extern "c" fn setrlimit(resource: c.rlimit_resource, rlim: *const c.rlimit) c_int; | 351 | pub extern "c" fn setrlimit(resource: c.rlimit_resource, rlim: *const c.rlimit) c_int; |
| 352 | 352 | ||
| 353 | pub extern "c" fn fmemopen(noalias buf: ?*c_void, size: usize, noalias mode: [*:0]const u8) ?*FILE; | 353 | pub extern "c" fn fmemopen(noalias buf: ?*anyopaque, size: usize, noalias mode: [*:0]const u8) ?*FILE; |
| 354 | 354 | ||
| 355 | pub extern "c" fn syslog(priority: c_int, message: [*:0]const u8, ...) void; | 355 | pub extern "c" fn syslog(priority: c_int, message: [*:0]const u8, ...) void; |
| 356 | pub extern "c" fn openlog(ident: [*:0]const u8, logopt: c_int, facility: c_int) void; | 356 | pub extern "c" fn openlog(ident: [*:0]const u8, logopt: c_int, facility: c_int) void; |
lib/std/c/darwin.zig+16-16| ... | @@ -46,8 +46,8 @@ pub const fstatat = if (native_arch == .aarch64) private.fstatat else private.@" | ... | @@ -46,8 +46,8 @@ pub const fstatat = if (native_arch == .aarch64) private.fstatat else private.@" |
| 46 | pub extern "c" fn mach_absolute_time() u64; | 46 | pub extern "c" fn mach_absolute_time() u64; |
| 47 | pub extern "c" fn mach_timebase_info(tinfo: ?*mach_timebase_info_data) void; | 47 | pub extern "c" fn mach_timebase_info(tinfo: ?*mach_timebase_info_data) void; |
| 48 | 48 | ||
| 49 | pub extern "c" fn malloc_size(?*const c_void) usize; | 49 | pub extern "c" fn malloc_size(?*const anyopaque) usize; |
| 50 | pub extern "c" fn posix_memalign(memptr: *?*c_void, alignment: usize, size: usize) c_int; | 50 | pub extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int; |
| 51 | 51 | ||
| 52 | pub extern "c" fn kevent64( | 52 | pub extern "c" fn kevent64( |
| 53 | kq: c_int, | 53 | kq: c_int, |
| ... | @@ -196,7 +196,7 @@ pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len | ... | @@ -196,7 +196,7 @@ pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len |
| 196 | pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void; | 196 | pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void; |
| 197 | 197 | ||
| 198 | // Grand Central Dispatch is exposed by libSystem. | 198 | // Grand Central Dispatch is exposed by libSystem. |
| 199 | pub extern "c" fn dispatch_release(object: *c_void) void; | 199 | pub extern "c" fn dispatch_release(object: *anyopaque) void; |
| 200 | 200 | ||
| 201 | pub const dispatch_semaphore_t = *opaque {}; | 201 | pub const dispatch_semaphore_t = *opaque {}; |
| 202 | pub extern "c" fn dispatch_semaphore_create(value: isize) ?dispatch_semaphore_t; | 202 | pub extern "c" fn dispatch_semaphore_create(value: isize) ?dispatch_semaphore_t; |
| ... | @@ -209,10 +209,10 @@ pub const DISPATCH_TIME_FOREVER = ~@as(dispatch_time_t, 0); | ... | @@ -209,10 +209,10 @@ pub const DISPATCH_TIME_FOREVER = ~@as(dispatch_time_t, 0); |
| 209 | pub extern "c" fn dispatch_time(when: dispatch_time_t, delta: i64) dispatch_time_t; | 209 | pub extern "c" fn dispatch_time(when: dispatch_time_t, delta: i64) dispatch_time_t; |
| 210 | 210 | ||
| 211 | const dispatch_once_t = usize; | 211 | const dispatch_once_t = usize; |
| 212 | const dispatch_function_t = fn (?*c_void) callconv(.C) void; | 212 | const dispatch_function_t = fn (?*anyopaque) callconv(.C) void; |
| 213 | pub extern fn dispatch_once_f( | 213 | pub extern fn dispatch_once_f( |
| 214 | predicate: *dispatch_once_t, | 214 | predicate: *dispatch_once_t, |
| 215 | context: ?*c_void, | 215 | context: ?*anyopaque, |
| 216 | function: dispatch_function_t, | 216 | function: dispatch_function_t, |
| 217 | ) void; | 217 | ) void; |
| 218 | 218 | ||
| ... | @@ -243,9 +243,9 @@ pub const UL_COMPARE_AND_WAIT64 = 5; | ... | @@ -243,9 +243,9 @@ pub const UL_COMPARE_AND_WAIT64 = 5; |
| 243 | pub const UL_COMPARE_AND_WAIT64_SHARED = 6; | 243 | pub const UL_COMPARE_AND_WAIT64_SHARED = 6; |
| 244 | pub const ULF_WAIT_ADAPTIVE_SPIN = 0x40000; | 244 | pub const ULF_WAIT_ADAPTIVE_SPIN = 0x40000; |
| 245 | 245 | ||
| 246 | pub extern "c" fn __ulock_wait2(op: u32, addr: ?*const c_void, val: u64, timeout_ns: u64, val2: u64) c_int; | 246 | pub extern "c" fn __ulock_wait2(op: u32, addr: ?*const anyopaque, val: u64, timeout_ns: u64, val2: u64) c_int; |
| 247 | pub extern "c" fn __ulock_wait(op: u32, addr: ?*const c_void, val: u64, timeout_us: u32) c_int; | 247 | pub extern "c" fn __ulock_wait(op: u32, addr: ?*const anyopaque, val: u64, timeout_us: u32) c_int; |
| 248 | pub extern "c" fn __ulock_wake(op: u32, addr: ?*const c_void, val: u64) c_int; | 248 | pub extern "c" fn __ulock_wake(op: u32, addr: ?*const anyopaque, val: u64) c_int; |
| 249 | 249 | ||
| 250 | pub const OS_UNFAIR_LOCK_INIT = os_unfair_lock{}; | 250 | pub const OS_UNFAIR_LOCK_INIT = os_unfair_lock{}; |
| 251 | pub const os_unfair_lock_t = *os_unfair_lock; | 251 | pub const os_unfair_lock_t = *os_unfair_lock; |
| ... | @@ -483,10 +483,10 @@ pub const siginfo_t = extern struct { | ... | @@ -483,10 +483,10 @@ pub const siginfo_t = extern struct { |
| 483 | pid: pid_t, | 483 | pid: pid_t, |
| 484 | uid: uid_t, | 484 | uid: uid_t, |
| 485 | status: c_int, | 485 | status: c_int, |
| 486 | addr: *c_void, | 486 | addr: *anyopaque, |
| 487 | value: extern union { | 487 | value: extern union { |
| 488 | int: c_int, | 488 | int: c_int, |
| 489 | ptr: *c_void, | 489 | ptr: *anyopaque, |
| 490 | }, | 490 | }, |
| 491 | si_band: c_long, | 491 | si_band: c_long, |
| 492 | _pad: [7]c_ulong, | 492 | _pad: [7]c_ulong, |
| ... | @@ -495,7 +495,7 @@ pub const siginfo_t = extern struct { | ... | @@ -495,7 +495,7 @@ pub const siginfo_t = extern struct { |
| 495 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name. | 495 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name. |
| 496 | pub const Sigaction = extern struct { | 496 | pub const Sigaction = extern struct { |
| 497 | pub const handler_fn = fn (c_int) callconv(.C) void; | 497 | pub const handler_fn = fn (c_int) callconv(.C) void; |
| 498 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const c_void) callconv(.C) void; | 498 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void; |
| 499 | 499 | ||
| 500 | handler: extern union { | 500 | handler: extern union { |
| 501 | handler: ?handler_fn, | 501 | handler: ?handler_fn, |
| ... | @@ -611,7 +611,7 @@ pub const MAP = struct { | ... | @@ -611,7 +611,7 @@ pub const MAP = struct { |
| 611 | pub const NOCACHE = 0x0400; | 611 | pub const NOCACHE = 0x0400; |
| 612 | /// don't reserve needed swap area | 612 | /// don't reserve needed swap area |
| 613 | pub const NORESERVE = 0x0040; | 613 | pub const NORESERVE = 0x0040; |
| 614 | pub const FAILED = @intToPtr(*c_void, maxInt(usize)); | 614 | pub const FAILED = @intToPtr(*anyopaque, maxInt(usize)); |
| 615 | }; | 615 | }; |
| 616 | 616 | ||
| 617 | pub const SA = struct { | 617 | pub const SA = struct { |
| ... | @@ -1537,10 +1537,10 @@ pub const RTLD = struct { | ... | @@ -1537,10 +1537,10 @@ pub const RTLD = struct { |
| 1537 | pub const NODELETE = 0x80; | 1537 | pub const NODELETE = 0x80; |
| 1538 | pub const FIRST = 0x100; | 1538 | pub const FIRST = 0x100; |
| 1539 | 1539 | ||
| 1540 | pub const NEXT = @intToPtr(*c_void, @bitCast(usize, @as(isize, -1))); | 1540 | pub const NEXT = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -1))); |
| 1541 | pub const DEFAULT = @intToPtr(*c_void, @bitCast(usize, @as(isize, -2))); | 1541 | pub const DEFAULT = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -2))); |
| 1542 | pub const SELF = @intToPtr(*c_void, @bitCast(usize, @as(isize, -3))); | 1542 | pub const SELF = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -3))); |
| 1543 | pub const MAIN_ONLY = @intToPtr(*c_void, @bitCast(usize, @as(isize, -5))); | 1543 | pub const MAIN_ONLY = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -5))); |
| 1544 | }; | 1544 | }; |
| 1545 | 1545 | ||
| 1546 | pub const F = struct { | 1546 | pub const F = struct { |
lib/std/c/dragonfly.zig+15-15| ... | @@ -12,18 +12,18 @@ pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; | ... | @@ -12,18 +12,18 @@ pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; |
| 12 | pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize; | 12 | pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize; |
| 13 | pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int; | 13 | pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int; |
| 14 | 14 | ||
| 15 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int; | 15 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int; |
| 16 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int; | 16 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 17 | 17 | ||
| 18 | pub extern "c" fn lwp_gettid() c_int; | 18 | pub extern "c" fn lwp_gettid() c_int; |
| 19 | 19 | ||
| 20 | pub extern "c" fn posix_memalign(memptr: *?*c_void, alignment: usize, size: usize) c_int; | 20 | pub extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int; |
| 21 | 21 | ||
| 22 | pub const pthread_mutex_t = extern struct { | 22 | pub const pthread_mutex_t = extern struct { |
| 23 | inner: ?*c_void = null, | 23 | inner: ?*anyopaque = null, |
| 24 | }; | 24 | }; |
| 25 | pub const pthread_cond_t = extern struct { | 25 | pub const pthread_cond_t = extern struct { |
| 26 | inner: ?*c_void = null, | 26 | inner: ?*anyopaque = null, |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | pub const pthread_attr_t = extern struct { // copied from freebsd | 29 | pub const pthread_attr_t = extern struct { // copied from freebsd |
| ... | @@ -165,7 +165,7 @@ pub const PROT = struct { | ... | @@ -165,7 +165,7 @@ pub const PROT = struct { |
| 165 | 165 | ||
| 166 | pub const MAP = struct { | 166 | pub const MAP = struct { |
| 167 | pub const FILE = 0; | 167 | pub const FILE = 0; |
| 168 | pub const FAILED = @intToPtr(*c_void, maxInt(usize)); | 168 | pub const FAILED = @intToPtr(*anyopaque, maxInt(usize)); |
| 169 | pub const ANONYMOUS = ANON; | 169 | pub const ANONYMOUS = ANON; |
| 170 | pub const COPY = PRIVATE; | 170 | pub const COPY = PRIVATE; |
| 171 | pub const SHARED = 1; | 171 | pub const SHARED = 1; |
| ... | @@ -648,7 +648,7 @@ pub const siginfo_t = extern struct { | ... | @@ -648,7 +648,7 @@ pub const siginfo_t = extern struct { |
| 648 | pid: c_int, | 648 | pid: c_int, |
| 649 | uid: uid_t, | 649 | uid: uid_t, |
| 650 | status: c_int, | 650 | status: c_int, |
| 651 | addr: ?*c_void, | 651 | addr: ?*anyopaque, |
| 652 | value: sigval, | 652 | value: sigval, |
| 653 | band: c_long, | 653 | band: c_long, |
| 654 | __spare__: [7]c_int, | 654 | __spare__: [7]c_int, |
| ... | @@ -656,7 +656,7 @@ pub const siginfo_t = extern struct { | ... | @@ -656,7 +656,7 @@ pub const siginfo_t = extern struct { |
| 656 | 656 | ||
| 657 | pub const sigval = extern union { | 657 | pub const sigval = extern union { |
| 658 | sival_int: c_int, | 658 | sival_int: c_int, |
| 659 | sival_ptr: ?*c_void, | 659 | sival_ptr: ?*anyopaque, |
| 660 | }; | 660 | }; |
| 661 | 661 | ||
| 662 | pub const _SIG_WORDS = 4; | 662 | pub const _SIG_WORDS = 4; |
| ... | @@ -671,7 +671,7 @@ pub const sig_atomic_t = c_int; | ... | @@ -671,7 +671,7 @@ pub const sig_atomic_t = c_int; |
| 671 | 671 | ||
| 672 | pub const Sigaction = extern struct { | 672 | pub const Sigaction = extern struct { |
| 673 | pub const handler_fn = fn (c_int) callconv(.C) void; | 673 | pub const handler_fn = fn (c_int) callconv(.C) void; |
| 674 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const c_void) callconv(.C) void; | 674 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void; |
| 675 | 675 | ||
| 676 | /// signal handler | 676 | /// signal handler |
| 677 | handler: extern union { | 677 | handler: extern union { |
| ... | @@ -847,10 +847,10 @@ pub const RTLD = struct { | ... | @@ -847,10 +847,10 @@ pub const RTLD = struct { |
| 847 | pub const NODELETE = 0x01000; | 847 | pub const NODELETE = 0x01000; |
| 848 | pub const NOLOAD = 0x02000; | 848 | pub const NOLOAD = 0x02000; |
| 849 | 849 | ||
| 850 | pub const NEXT = @intToPtr(*c_void, @bitCast(usize, @as(isize, -1))); | 850 | pub const NEXT = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -1))); |
| 851 | pub const DEFAULT = @intToPtr(*c_void, @bitCast(usize, @as(isize, -2))); | 851 | pub const DEFAULT = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -2))); |
| 852 | pub const SELF = @intToPtr(*c_void, @bitCast(usize, @as(isize, -3))); | 852 | pub const SELF = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -3))); |
| 853 | pub const ALL = @intToPtr(*c_void, @bitCast(usize, @as(isize, -4))); | 853 | pub const ALL = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -4))); |
| 854 | }; | 854 | }; |
| 855 | 855 | ||
| 856 | pub const dl_phdr_info = extern struct { | 856 | pub const dl_phdr_info = extern struct { |
| ... | @@ -865,11 +865,11 @@ pub const cmsghdr = extern struct { | ... | @@ -865,11 +865,11 @@ pub const cmsghdr = extern struct { |
| 865 | cmsg_type: c_int, | 865 | cmsg_type: c_int, |
| 866 | }; | 866 | }; |
| 867 | pub const msghdr = extern struct { | 867 | pub const msghdr = extern struct { |
| 868 | msg_name: ?*c_void, | 868 | msg_name: ?*anyopaque, |
| 869 | msg_namelen: socklen_t, | 869 | msg_namelen: socklen_t, |
| 870 | msg_iov: [*c]iovec, | 870 | msg_iov: [*c]iovec, |
| 871 | msg_iovlen: c_int, | 871 | msg_iovlen: c_int, |
| 872 | msg_control: ?*c_void, | 872 | msg_control: ?*anyopaque, |
| 873 | msg_controllen: socklen_t, | 873 | msg_controllen: socklen_t, |
| 874 | msg_flags: c_int, | 874 | msg_flags: c_int, |
| 875 | }; | 875 | }; |
lib/std/c/freebsd.zig+13-13| ... | @@ -16,8 +16,8 @@ pub extern "c" fn pthread_set_name_np(thread: std.c.pthread_t, name: [*:0]const | ... | @@ -16,8 +16,8 @@ pub extern "c" fn pthread_set_name_np(thread: std.c.pthread_t, name: [*:0]const |
| 16 | pub extern "c" fn pthread_get_name_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) void; | 16 | pub extern "c" fn pthread_get_name_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) void; |
| 17 | pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int; | 17 | pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int; |
| 18 | 18 | ||
| 19 | pub extern "c" fn posix_memalign(memptr: *?*c_void, alignment: usize, size: usize) c_int; | 19 | pub extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int; |
| 20 | pub extern "c" fn malloc_usable_size(?*const c_void) usize; | 20 | pub extern "c" fn malloc_usable_size(?*const anyopaque) usize; |
| 21 | 21 | ||
| 22 | pub const sf_hdtr = extern struct { | 22 | pub const sf_hdtr = extern struct { |
| 23 | headers: [*]const iovec_const, | 23 | headers: [*]const iovec_const, |
| ... | @@ -35,17 +35,17 @@ pub extern "c" fn sendfile( | ... | @@ -35,17 +35,17 @@ pub extern "c" fn sendfile( |
| 35 | flags: u32, | 35 | flags: u32, |
| 36 | ) c_int; | 36 | ) c_int; |
| 37 | 37 | ||
| 38 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int; | 38 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int; |
| 39 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int; | 39 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 40 | 40 | ||
| 41 | pub const pthread_mutex_t = extern struct { | 41 | pub const pthread_mutex_t = extern struct { |
| 42 | inner: ?*c_void = null, | 42 | inner: ?*anyopaque = null, |
| 43 | }; | 43 | }; |
| 44 | pub const pthread_cond_t = extern struct { | 44 | pub const pthread_cond_t = extern struct { |
| 45 | inner: ?*c_void = null, | 45 | inner: ?*anyopaque = null, |
| 46 | }; | 46 | }; |
| 47 | pub const pthread_rwlock_t = extern struct { | 47 | pub const pthread_rwlock_t = extern struct { |
| 48 | ptr: ?*c_void = null, | 48 | ptr: ?*anyopaque = null, |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | pub const pthread_attr_t = extern struct { | 51 | pub const pthread_attr_t = extern struct { |
| ... | @@ -216,7 +216,7 @@ pub const msghdr = extern struct { | ... | @@ -216,7 +216,7 @@ pub const msghdr = extern struct { |
| 216 | msg_iovlen: i32, | 216 | msg_iovlen: i32, |
| 217 | 217 | ||
| 218 | /// ancillary data | 218 | /// ancillary data |
| 219 | msg_control: ?*c_void, | 219 | msg_control: ?*anyopaque, |
| 220 | 220 | ||
| 221 | /// ancillary data buffer len | 221 | /// ancillary data buffer len |
| 222 | msg_controllen: socklen_t, | 222 | msg_controllen: socklen_t, |
| ... | @@ -239,7 +239,7 @@ pub const msghdr_const = extern struct { | ... | @@ -239,7 +239,7 @@ pub const msghdr_const = extern struct { |
| 239 | msg_iovlen: i32, | 239 | msg_iovlen: i32, |
| 240 | 240 | ||
| 241 | /// ancillary data | 241 | /// ancillary data |
| 242 | msg_control: ?*c_void, | 242 | msg_control: ?*anyopaque, |
| 243 | 243 | ||
| 244 | /// ancillary data buffer len | 244 | /// ancillary data buffer len |
| 245 | msg_controllen: socklen_t, | 245 | msg_controllen: socklen_t, |
| ... | @@ -393,7 +393,7 @@ pub const CLOCK = struct { | ... | @@ -393,7 +393,7 @@ pub const CLOCK = struct { |
| 393 | }; | 393 | }; |
| 394 | 394 | ||
| 395 | pub const MAP = struct { | 395 | pub const MAP = struct { |
| 396 | pub const FAILED = @intToPtr(*c_void, maxInt(usize)); | 396 | pub const FAILED = @intToPtr(*anyopaque, maxInt(usize)); |
| 397 | pub const SHARED = 0x0001; | 397 | pub const SHARED = 0x0001; |
| 398 | pub const PRIVATE = 0x0002; | 398 | pub const PRIVATE = 0x0002; |
| 399 | pub const FIXED = 0x0010; | 399 | pub const FIXED = 0x0010; |
| ... | @@ -515,7 +515,7 @@ pub const SIG = struct { | ... | @@ -515,7 +515,7 @@ pub const SIG = struct { |
| 515 | }; | 515 | }; |
| 516 | pub const sigval = extern union { | 516 | pub const sigval = extern union { |
| 517 | int: c_int, | 517 | int: c_int, |
| 518 | ptr: ?*c_void, | 518 | ptr: ?*anyopaque, |
| 519 | }; | 519 | }; |
| 520 | 520 | ||
| 521 | pub const sigset_t = extern struct { | 521 | pub const sigset_t = extern struct { |
| ... | @@ -949,7 +949,7 @@ const NSIG = 32; | ... | @@ -949,7 +949,7 @@ const NSIG = 32; |
| 949 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. | 949 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 950 | pub const Sigaction = extern struct { | 950 | pub const Sigaction = extern struct { |
| 951 | pub const handler_fn = fn (c_int) callconv(.C) void; | 951 | pub const handler_fn = fn (c_int) callconv(.C) void; |
| 952 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const c_void) callconv(.C) void; | 952 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void; |
| 953 | 953 | ||
| 954 | /// signal handler | 954 | /// signal handler |
| 955 | handler: extern union { | 955 | handler: extern union { |
| ... | @@ -971,7 +971,7 @@ pub const siginfo_t = extern struct { | ... | @@ -971,7 +971,7 @@ pub const siginfo_t = extern struct { |
| 971 | pid: pid_t, | 971 | pid: pid_t, |
| 972 | uid: uid_t, | 972 | uid: uid_t, |
| 973 | status: c_int, | 973 | status: c_int, |
| 974 | addr: ?*c_void, | 974 | addr: ?*anyopaque, |
| 975 | value: sigval, | 975 | value: sigval, |
| 976 | reason: extern union { | 976 | reason: extern union { |
| 977 | fault: extern struct { | 977 | fault: extern struct { |
lib/std/c/haiku.zig+10-10| ... | @@ -10,7 +10,7 @@ pub const _errno = _errnop; | ... | @@ -10,7 +10,7 @@ pub const _errno = _errnop; |
| 10 | 10 | ||
| 11 | pub extern "c" fn find_directory(which: c_int, volume: i32, createIt: bool, path_ptr: [*]u8, length: i32) u64; | 11 | pub extern "c" fn find_directory(which: c_int, volume: i32, createIt: bool, path_ptr: [*]u8, length: i32) u64; |
| 12 | 12 | ||
| 13 | pub extern "c" fn find_thread(thread_name: ?*c_void) i32; | 13 | pub extern "c" fn find_thread(thread_name: ?*anyopaque) i32; |
| 14 | 14 | ||
| 15 | pub extern "c" fn get_system_info(system_info: *system_info) usize; | 15 | pub extern "c" fn get_system_info(system_info: *system_info) usize; |
| 16 | 16 | ||
| ... | @@ -41,7 +41,7 @@ pub const pthread_attr_t = extern struct { | ... | @@ -41,7 +41,7 @@ pub const pthread_attr_t = extern struct { |
| 41 | __sched_priority: i32, | 41 | __sched_priority: i32, |
| 42 | __stack_size: i32, | 42 | __stack_size: i32, |
| 43 | __guard_size: i32, | 43 | __guard_size: i32, |
| 44 | __stack_address: ?*c_void, | 44 | __stack_address: ?*anyopaque, |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | pub const pthread_mutex_t = extern struct { | 47 | pub const pthread_mutex_t = extern struct { |
| ... | @@ -55,7 +55,7 @@ pub const pthread_mutex_t = extern struct { | ... | @@ -55,7 +55,7 @@ pub const pthread_mutex_t = extern struct { |
| 55 | pub const pthread_cond_t = extern struct { | 55 | pub const pthread_cond_t = extern struct { |
| 56 | flags: u32 = 0, | 56 | flags: u32 = 0, |
| 57 | unused: i32 = -42, | 57 | unused: i32 = -42, |
| 58 | mutex: ?*c_void = null, | 58 | mutex: ?*anyopaque = null, |
| 59 | waiter_count: i32 = 0, | 59 | waiter_count: i32 = 0, |
| 60 | lock: i32 = 0, | 60 | lock: i32 = 0, |
| 61 | }; | 61 | }; |
| ... | @@ -180,7 +180,7 @@ pub const msghdr = extern struct { | ... | @@ -180,7 +180,7 @@ pub const msghdr = extern struct { |
| 180 | msg_iovlen: i32, | 180 | msg_iovlen: i32, |
| 181 | 181 | ||
| 182 | /// ancillary data | 182 | /// ancillary data |
| 183 | msg_control: ?*c_void, | 183 | msg_control: ?*anyopaque, |
| 184 | 184 | ||
| 185 | /// ancillary data buffer len | 185 | /// ancillary data buffer len |
| 186 | msg_controllen: socklen_t, | 186 | msg_controllen: socklen_t, |
| ... | @@ -262,7 +262,7 @@ pub const area_info = extern struct { | ... | @@ -262,7 +262,7 @@ pub const area_info = extern struct { |
| 262 | copy_count: u32, | 262 | copy_count: u32, |
| 263 | in_count: u32, | 263 | in_count: u32, |
| 264 | out_count: u32, | 264 | out_count: u32, |
| 265 | address: *c_void, | 265 | address: *anyopaque, |
| 266 | }; | 266 | }; |
| 267 | 267 | ||
| 268 | pub const MAXPATHLEN = PATH_MAX; | 268 | pub const MAXPATHLEN = PATH_MAX; |
| ... | @@ -272,13 +272,13 @@ pub const image_info = extern struct { | ... | @@ -272,13 +272,13 @@ pub const image_info = extern struct { |
| 272 | image_type: u32, | 272 | image_type: u32, |
| 273 | sequence: i32, | 273 | sequence: i32, |
| 274 | init_order: i32, | 274 | init_order: i32, |
| 275 | init_routine: *c_void, | 275 | init_routine: *anyopaque, |
| 276 | term_routine: *c_void, | 276 | term_routine: *anyopaque, |
| 277 | device: i32, | 277 | device: i32, |
| 278 | node: i64, | 278 | node: i64, |
| 279 | name: [MAXPATHLEN]u8, | 279 | name: [MAXPATHLEN]u8, |
| 280 | text: *c_void, | 280 | text: *anyopaque, |
| 281 | data: *c_void, | 281 | data: *anyopaque, |
| 282 | text_size: i32, | 282 | text_size: i32, |
| 283 | data_size: i32, | 283 | data_size: i32, |
| 284 | api_version: i32, | 284 | api_version: i32, |
| ... | @@ -396,7 +396,7 @@ pub const CLOCK = struct { | ... | @@ -396,7 +396,7 @@ pub const CLOCK = struct { |
| 396 | 396 | ||
| 397 | pub const MAP = struct { | 397 | pub const MAP = struct { |
| 398 | /// mmap() error return code | 398 | /// mmap() error return code |
| 399 | pub const FAILED = @intToPtr(*c_void, maxInt(usize)); | 399 | pub const FAILED = @intToPtr(*anyopaque, maxInt(usize)); |
| 400 | /// changes are seen by others | 400 | /// changes are seen by others |
| 401 | pub const SHARED = 0x01; | 401 | pub const SHARED = 0x01; |
| 402 | /// changes are only seen by caller | 402 | /// changes are only seen by caller |
lib/std/c/linux.zig+7-7| ... | @@ -28,7 +28,7 @@ pub const MADV = linux.MADV; | ... | @@ -28,7 +28,7 @@ pub const MADV = linux.MADV; |
| 28 | pub const MAP = struct { | 28 | pub const MAP = struct { |
| 29 | pub usingnamespace linux.MAP; | 29 | pub usingnamespace linux.MAP; |
| 30 | /// Only used by libc to communicate failure. | 30 | /// Only used by libc to communicate failure. |
| 31 | pub const FAILED = @intToPtr(*c_void, maxInt(usize)); | 31 | pub const FAILED = @intToPtr(*anyopaque, maxInt(usize)); |
| 32 | }; | 32 | }; |
| 33 | pub const MMAP2_UNIT = linux.MMAP2_UNIT; | 33 | pub const MMAP2_UNIT = linux.MMAP2_UNIT; |
| 34 | pub const MSG = linux.MSG; | 34 | pub const MSG = linux.MSG; |
| ... | @@ -228,7 +228,7 @@ pub extern "c" fn fstatat64(dirfd: fd_t, path: [*:0]const u8, stat_buf: *Stat, f | ... | @@ -228,7 +228,7 @@ pub extern "c" fn fstatat64(dirfd: fd_t, path: [*:0]const u8, stat_buf: *Stat, f |
| 228 | pub extern "c" fn ftruncate64(fd: c_int, length: off_t) c_int; | 228 | pub extern "c" fn ftruncate64(fd: c_int, length: off_t) c_int; |
| 229 | pub extern "c" fn getrlimit64(resource: rlimit_resource, rlim: *rlimit) c_int; | 229 | pub extern "c" fn getrlimit64(resource: rlimit_resource, rlim: *rlimit) c_int; |
| 230 | pub extern "c" fn lseek64(fd: fd_t, offset: i64, whence: c_int) i64; | 230 | pub extern "c" fn lseek64(fd: fd_t, offset: i64, whence: c_int) i64; |
| 231 | pub extern "c" fn mmap64(addr: ?*align(std.mem.page_size) c_void, len: usize, prot: c_uint, flags: c_uint, fd: fd_t, offset: i64) *c_void; | 231 | pub extern "c" fn mmap64(addr: ?*align(std.mem.page_size) anyopaque, len: usize, prot: c_uint, flags: c_uint, fd: fd_t, offset: i64) *anyopaque; |
| 232 | pub extern "c" fn open64(path: [*:0]const u8, oflag: c_uint, ...) c_int; | 232 | pub extern "c" fn open64(path: [*:0]const u8, oflag: c_uint, ...) c_int; |
| 233 | pub extern "c" fn openat64(fd: c_int, path: [*:0]const u8, oflag: c_uint, ...) c_int; | 233 | pub extern "c" fn openat64(fd: c_int, path: [*:0]const u8, oflag: c_uint, ...) c_int; |
| 234 | pub extern "c" fn pread64(fd: fd_t, buf: [*]u8, nbyte: usize, offset: i64) isize; | 234 | pub extern "c" fn pread64(fd: fd_t, buf: [*]u8, nbyte: usize, offset: i64) isize; |
| ... | @@ -258,8 +258,8 @@ pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int; | ... | @@ -258,8 +258,8 @@ pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int; |
| 258 | /// See std.elf for constants for this | 258 | /// See std.elf for constants for this |
| 259 | pub extern "c" fn getauxval(__type: c_ulong) c_ulong; | 259 | pub extern "c" fn getauxval(__type: c_ulong) c_ulong; |
| 260 | 260 | ||
| 261 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int; | 261 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int; |
| 262 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int; | 262 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 263 | 263 | ||
| 264 | pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; | 264 | pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; |
| 265 | 265 | ||
| ... | @@ -280,11 +280,11 @@ pub extern "c" fn copy_file_range(fd_in: fd_t, off_in: ?*i64, fd_out: fd_t, off_ | ... | @@ -280,11 +280,11 @@ pub extern "c" fn copy_file_range(fd_in: fd_t, off_in: ?*i64, fd_out: fd_t, off_ |
| 280 | pub extern "c" fn signalfd(fd: fd_t, mask: *const sigset_t, flags: c_uint) c_int; | 280 | pub extern "c" fn signalfd(fd: fd_t, mask: *const sigset_t, flags: c_uint) c_int; |
| 281 | 281 | ||
| 282 | pub extern "c" fn prlimit(pid: pid_t, resource: rlimit_resource, new_limit: *const rlimit, old_limit: *rlimit) c_int; | 282 | pub extern "c" fn prlimit(pid: pid_t, resource: rlimit_resource, new_limit: *const rlimit, old_limit: *rlimit) c_int; |
| 283 | pub extern "c" fn posix_memalign(memptr: *?*c_void, alignment: usize, size: usize) c_int; | 283 | pub extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int; |
| 284 | pub extern "c" fn malloc_usable_size(?*const c_void) usize; | 284 | pub extern "c" fn malloc_usable_size(?*const anyopaque) usize; |
| 285 | 285 | ||
| 286 | pub extern "c" fn madvise( | 286 | pub extern "c" fn madvise( |
| 287 | addr: *align(std.mem.page_size) c_void, | 287 | addr: *align(std.mem.page_size) anyopaque, |
| 288 | length: usize, | 288 | length: usize, |
| 289 | advice: c_uint, | 289 | advice: c_uint, |
| 290 | ) c_int; | 290 | ) c_int; |
lib/std/c/netbsd.zig+17-17| ... | @@ -9,8 +9,8 @@ const rusage = std.c.rusage; | ... | @@ -9,8 +9,8 @@ const rusage = std.c.rusage; |
| 9 | extern "c" fn __errno() *c_int; | 9 | extern "c" fn __errno() *c_int; |
| 10 | pub const _errno = __errno; | 10 | pub const _errno = __errno; |
| 11 | 11 | ||
| 12 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int; | 12 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int; |
| 13 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int; | 13 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 14 | 14 | ||
| 15 | pub extern "c" fn _lwp_self() lwpid_t; | 15 | pub extern "c" fn _lwp_self() lwpid_t; |
| 16 | 16 | ||
| ... | @@ -56,7 +56,7 @@ pub const getrusage = __getrusage50; | ... | @@ -56,7 +56,7 @@ pub const getrusage = __getrusage50; |
| 56 | pub extern "c" fn __libc_thr_yield() c_int; | 56 | pub extern "c" fn __libc_thr_yield() c_int; |
| 57 | pub const sched_yield = __libc_thr_yield; | 57 | pub const sched_yield = __libc_thr_yield; |
| 58 | 58 | ||
| 59 | pub extern "c" fn posix_memalign(memptr: *?*c_void, alignment: usize, size: usize) c_int; | 59 | pub extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int; |
| 60 | 60 | ||
| 61 | pub const pthread_mutex_t = extern struct { | 61 | pub const pthread_mutex_t = extern struct { |
| 62 | magic: u32 = 0x33330003, | 62 | magic: u32 = 0x33330003, |
| ... | @@ -65,7 +65,7 @@ pub const pthread_mutex_t = extern struct { | ... | @@ -65,7 +65,7 @@ pub const pthread_mutex_t = extern struct { |
| 65 | owner: usize = 0, | 65 | owner: usize = 0, |
| 66 | waiters: ?*u8 = null, | 66 | waiters: ?*u8 = null, |
| 67 | recursed: u32 = 0, | 67 | recursed: u32 = 0, |
| 68 | spare2: ?*c_void = null, | 68 | spare2: ?*anyopaque = null, |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | pub const pthread_cond_t = extern struct { | 71 | pub const pthread_cond_t = extern struct { |
| ... | @@ -74,7 +74,7 @@ pub const pthread_cond_t = extern struct { | ... | @@ -74,7 +74,7 @@ pub const pthread_cond_t = extern struct { |
| 74 | waiters_first: ?*u8 = null, | 74 | waiters_first: ?*u8 = null, |
| 75 | waiters_last: ?*u8 = null, | 75 | waiters_last: ?*u8 = null, |
| 76 | mutex: ?*pthread_mutex_t = null, | 76 | mutex: ?*pthread_mutex_t = null, |
| 77 | private: ?*c_void = null, | 77 | private: ?*anyopaque = null, |
| 78 | }; | 78 | }; |
| 79 | 79 | ||
| 80 | pub const pthread_rwlock_t = extern struct { | 80 | pub const pthread_rwlock_t = extern struct { |
| ... | @@ -90,7 +90,7 @@ pub const pthread_rwlock_t = extern struct { | ... | @@ -90,7 +90,7 @@ pub const pthread_rwlock_t = extern struct { |
| 90 | wblocked_last: ?*u8 = null, | 90 | wblocked_last: ?*u8 = null, |
| 91 | nreaders: c_uint = 0, | 91 | nreaders: c_uint = 0, |
| 92 | owner: std.c.pthread_t = null, | 92 | owner: std.c.pthread_t = null, |
| 93 | private: ?*c_void = null, | 93 | private: ?*anyopaque = null, |
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | const pthread_spin_t = switch (builtin.cpu.arch) { | 96 | const pthread_spin_t = switch (builtin.cpu.arch) { |
| ... | @@ -113,12 +113,12 @@ const padded_pthread_spin_t = switch (builtin.cpu.arch) { | ... | @@ -113,12 +113,12 @@ const padded_pthread_spin_t = switch (builtin.cpu.arch) { |
| 113 | pub const pthread_attr_t = extern struct { | 113 | pub const pthread_attr_t = extern struct { |
| 114 | pta_magic: u32, | 114 | pta_magic: u32, |
| 115 | pta_flags: i32, | 115 | pta_flags: i32, |
| 116 | pta_private: ?*c_void, | 116 | pta_private: ?*anyopaque, |
| 117 | }; | 117 | }; |
| 118 | 118 | ||
| 119 | pub const sem_t = ?*opaque {}; | 119 | pub const sem_t = ?*opaque {}; |
| 120 | 120 | ||
| 121 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8, arg: ?*c_void) E; | 121 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8, arg: ?*anyopaque) E; |
| 122 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) E; | 122 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) E; |
| 123 | 123 | ||
| 124 | pub const blkcnt_t = i64; | 124 | pub const blkcnt_t = i64; |
| ... | @@ -156,9 +156,9 @@ pub const RTLD = struct { | ... | @@ -156,9 +156,9 @@ pub const RTLD = struct { |
| 156 | pub const NODELETE = 0x01000; | 156 | pub const NODELETE = 0x01000; |
| 157 | pub const NOLOAD = 0x02000; | 157 | pub const NOLOAD = 0x02000; |
| 158 | 158 | ||
| 159 | pub const NEXT = @intToPtr(*c_void, @bitCast(usize, @as(isize, -1))); | 159 | pub const NEXT = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -1))); |
| 160 | pub const DEFAULT = @intToPtr(*c_void, @bitCast(usize, @as(isize, -2))); | 160 | pub const DEFAULT = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -2))); |
| 161 | pub const SELF = @intToPtr(*c_void, @bitCast(usize, @as(isize, -3))); | 161 | pub const SELF = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -3))); |
| 162 | }; | 162 | }; |
| 163 | 163 | ||
| 164 | pub const dl_phdr_info = extern struct { | 164 | pub const dl_phdr_info = extern struct { |
| ... | @@ -249,7 +249,7 @@ pub const msghdr = extern struct { | ... | @@ -249,7 +249,7 @@ pub const msghdr = extern struct { |
| 249 | msg_iovlen: i32, | 249 | msg_iovlen: i32, |
| 250 | 250 | ||
| 251 | /// ancillary data | 251 | /// ancillary data |
| 252 | msg_control: ?*c_void, | 252 | msg_control: ?*anyopaque, |
| 253 | 253 | ||
| 254 | /// ancillary data buffer len | 254 | /// ancillary data buffer len |
| 255 | msg_controllen: socklen_t, | 255 | msg_controllen: socklen_t, |
| ... | @@ -272,7 +272,7 @@ pub const msghdr_const = extern struct { | ... | @@ -272,7 +272,7 @@ pub const msghdr_const = extern struct { |
| 272 | msg_iovlen: i32, | 272 | msg_iovlen: i32, |
| 273 | 273 | ||
| 274 | /// ancillary data | 274 | /// ancillary data |
| 275 | msg_control: ?*c_void, | 275 | msg_control: ?*anyopaque, |
| 276 | 276 | ||
| 277 | /// ancillary data buffer len | 277 | /// ancillary data buffer len |
| 278 | msg_controllen: socklen_t, | 278 | msg_controllen: socklen_t, |
| ... | @@ -556,7 +556,7 @@ pub const CLOCK = struct { | ... | @@ -556,7 +556,7 @@ pub const CLOCK = struct { |
| 556 | }; | 556 | }; |
| 557 | 557 | ||
| 558 | pub const MAP = struct { | 558 | pub const MAP = struct { |
| 559 | pub const FAILED = @intToPtr(*c_void, maxInt(usize)); | 559 | pub const FAILED = @intToPtr(*anyopaque, maxInt(usize)); |
| 560 | pub const SHARED = 0x0001; | 560 | pub const SHARED = 0x0001; |
| 561 | pub const PRIVATE = 0x0002; | 561 | pub const PRIVATE = 0x0002; |
| 562 | pub const REMAPDUP = 0x0004; | 562 | pub const REMAPDUP = 0x0004; |
| ... | @@ -962,7 +962,7 @@ pub const SIG = struct { | ... | @@ -962,7 +962,7 @@ pub const SIG = struct { |
| 962 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. | 962 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 963 | pub const Sigaction = extern struct { | 963 | pub const Sigaction = extern struct { |
| 964 | pub const handler_fn = fn (c_int) callconv(.C) void; | 964 | pub const handler_fn = fn (c_int) callconv(.C) void; |
| 965 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const c_void) callconv(.C) void; | 965 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void; |
| 966 | 966 | ||
| 967 | /// signal handler | 967 | /// signal handler |
| 968 | handler: extern union { | 968 | handler: extern union { |
| ... | @@ -977,7 +977,7 @@ pub const Sigaction = extern struct { | ... | @@ -977,7 +977,7 @@ pub const Sigaction = extern struct { |
| 977 | 977 | ||
| 978 | pub const sigval_t = extern union { | 978 | pub const sigval_t = extern union { |
| 979 | int: i32, | 979 | int: i32, |
| 980 | ptr: ?*c_void, | 980 | ptr: ?*anyopaque, |
| 981 | }; | 981 | }; |
| 982 | 982 | ||
| 983 | pub const siginfo_t = extern union { | 983 | pub const siginfo_t = extern union { |
| ... | @@ -1005,7 +1005,7 @@ pub const _ksiginfo = extern struct { | ... | @@ -1005,7 +1005,7 @@ pub const _ksiginfo = extern struct { |
| 1005 | stime: clock_t, | 1005 | stime: clock_t, |
| 1006 | }, | 1006 | }, |
| 1007 | fault: extern struct { | 1007 | fault: extern struct { |
| 1008 | addr: ?*c_void, | 1008 | addr: ?*anyopaque, |
| 1009 | trap: i32, | 1009 | trap: i32, |
| 1010 | trap2: i32, | 1010 | trap2: i32, |
| 1011 | trap3: i32, | 1011 | trap3: i32, |
lib/std/c/openbsd.zig+14-14| ... | @@ -7,8 +7,8 @@ const iovec_const = std.os.iovec_const; | ... | @@ -7,8 +7,8 @@ const iovec_const = std.os.iovec_const; |
| 7 | extern "c" fn __errno() *c_int; | 7 | extern "c" fn __errno() *c_int; |
| 8 | pub const _errno = __errno; | 8 | pub const _errno = __errno; |
| 9 | 9 | ||
| 10 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int; | 10 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int; |
| 11 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int; | 11 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 12 | 12 | ||
| 13 | pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void; | 13 | pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void; |
| 14 | 14 | ||
| ... | @@ -19,25 +19,25 @@ pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize; | ... | @@ -19,25 +19,25 @@ pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize; |
| 19 | pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; | 19 | pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; |
| 20 | 20 | ||
| 21 | pub const pthread_mutex_t = extern struct { | 21 | pub const pthread_mutex_t = extern struct { |
| 22 | inner: ?*c_void = null, | 22 | inner: ?*anyopaque = null, |
| 23 | }; | 23 | }; |
| 24 | pub const pthread_cond_t = extern struct { | 24 | pub const pthread_cond_t = extern struct { |
| 25 | inner: ?*c_void = null, | 25 | inner: ?*anyopaque = null, |
| 26 | }; | 26 | }; |
| 27 | pub const pthread_rwlock_t = extern struct { | 27 | pub const pthread_rwlock_t = extern struct { |
| 28 | ptr: ?*c_void = null, | 28 | ptr: ?*anyopaque = null, |
| 29 | }; | 29 | }; |
| 30 | pub const pthread_spinlock_t = extern struct { | 30 | pub const pthread_spinlock_t = extern struct { |
| 31 | inner: ?*c_void = null, | 31 | inner: ?*anyopaque = null, |
| 32 | }; | 32 | }; |
| 33 | pub const pthread_attr_t = extern struct { | 33 | pub const pthread_attr_t = extern struct { |
| 34 | inner: ?*c_void = null, | 34 | inner: ?*anyopaque = null, |
| 35 | }; | 35 | }; |
| 36 | pub const pthread_key_t = c_int; | 36 | pub const pthread_key_t = c_int; |
| 37 | 37 | ||
| 38 | pub const sem_t = ?*opaque {}; | 38 | pub const sem_t = ?*opaque {}; |
| 39 | 39 | ||
| 40 | pub extern "c" fn posix_memalign(memptr: *?*c_void, alignment: usize, size: usize) c_int; | 40 | pub extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int; |
| 41 | 41 | ||
| 42 | pub extern "c" fn pledge(promises: ?[*:0]const u8, execpromises: ?[*:0]const u8) c_int; | 42 | pub extern "c" fn pledge(promises: ?[*:0]const u8, execpromises: ?[*:0]const u8) c_int; |
| 43 | pub extern "c" fn unveil(path: ?[*:0]const u8, permissions: ?[*:0]const u8) c_int; | 43 | pub extern "c" fn unveil(path: ?[*:0]const u8, permissions: ?[*:0]const u8) c_int; |
| ... | @@ -174,7 +174,7 @@ pub const msghdr = extern struct { | ... | @@ -174,7 +174,7 @@ pub const msghdr = extern struct { |
| 174 | msg_iovlen: c_uint, | 174 | msg_iovlen: c_uint, |
| 175 | 175 | ||
| 176 | /// ancillary data | 176 | /// ancillary data |
| 177 | msg_control: ?*c_void, | 177 | msg_control: ?*anyopaque, |
| 178 | 178 | ||
| 179 | /// ancillary data buffer len | 179 | /// ancillary data buffer len |
| 180 | msg_controllen: socklen_t, | 180 | msg_controllen: socklen_t, |
| ... | @@ -197,7 +197,7 @@ pub const msghdr_const = extern struct { | ... | @@ -197,7 +197,7 @@ pub const msghdr_const = extern struct { |
| 197 | msg_iovlen: c_uint, | 197 | msg_iovlen: c_uint, |
| 198 | 198 | ||
| 199 | /// ancillary data | 199 | /// ancillary data |
| 200 | msg_control: ?*c_void, | 200 | msg_control: ?*anyopaque, |
| 201 | 201 | ||
| 202 | /// ancillary data buffer len | 202 | /// ancillary data buffer len |
| 203 | msg_controllen: socklen_t, | 203 | msg_controllen: socklen_t, |
| ... | @@ -346,7 +346,7 @@ pub const CLOCK = struct { | ... | @@ -346,7 +346,7 @@ pub const CLOCK = struct { |
| 346 | }; | 346 | }; |
| 347 | 347 | ||
| 348 | pub const MAP = struct { | 348 | pub const MAP = struct { |
| 349 | pub const FAILED = @intToPtr(*c_void, maxInt(usize)); | 349 | pub const FAILED = @intToPtr(*anyopaque, maxInt(usize)); |
| 350 | pub const SHARED = 0x0001; | 350 | pub const SHARED = 0x0001; |
| 351 | pub const PRIVATE = 0x0002; | 351 | pub const PRIVATE = 0x0002; |
| 352 | pub const FIXED = 0x0010; | 352 | pub const FIXED = 0x0010; |
| ... | @@ -889,7 +889,7 @@ pub const SIG = struct { | ... | @@ -889,7 +889,7 @@ pub const SIG = struct { |
| 889 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. | 889 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 890 | pub const Sigaction = extern struct { | 890 | pub const Sigaction = extern struct { |
| 891 | pub const handler_fn = fn (c_int) callconv(.C) void; | 891 | pub const handler_fn = fn (c_int) callconv(.C) void; |
| 892 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const c_void) callconv(.C) void; | 892 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void; |
| 893 | 893 | ||
| 894 | /// signal handler | 894 | /// signal handler |
| 895 | handler: extern union { | 895 | handler: extern union { |
| ... | @@ -904,7 +904,7 @@ pub const Sigaction = extern struct { | ... | @@ -904,7 +904,7 @@ pub const Sigaction = extern struct { |
| 904 | 904 | ||
| 905 | pub const sigval = extern union { | 905 | pub const sigval = extern union { |
| 906 | int: c_int, | 906 | int: c_int, |
| 907 | ptr: ?*c_void, | 907 | ptr: ?*anyopaque, |
| 908 | }; | 908 | }; |
| 909 | 909 | ||
| 910 | pub const siginfo_t = extern struct { | 910 | pub const siginfo_t = extern struct { |
| ... | @@ -927,7 +927,7 @@ pub const siginfo_t = extern struct { | ... | @@ -927,7 +927,7 @@ pub const siginfo_t = extern struct { |
| 927 | }, | 927 | }, |
| 928 | }, | 928 | }, |
| 929 | fault: extern struct { | 929 | fault: extern struct { |
| 930 | addr: ?*c_void, | 930 | addr: ?*anyopaque, |
| 931 | trapno: c_int, | 931 | trapno: c_int, |
| 932 | }, | 932 | }, |
| 933 | __pad: [128 - 3 * @sizeOf(c_int)]u8, | 933 | __pad: [128 - 3 * @sizeOf(c_int)]u8, |
lib/std/c/solaris.zig+20-20| ... | @@ -8,14 +8,14 @@ const timezone = std.c.timezone; | ... | @@ -8,14 +8,14 @@ const timezone = std.c.timezone; |
| 8 | extern "c" fn ___errno() *c_int; | 8 | extern "c" fn ___errno() *c_int; |
| 9 | pub const _errno = ___errno; | 9 | pub const _errno = ___errno; |
| 10 | 10 | ||
| 11 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int; | 11 | pub const dl_iterate_phdr_callback = fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int; |
| 12 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int; | 12 | pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int; |
| 13 | 13 | ||
| 14 | pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize; | 14 | pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize; |
| 15 | pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; | 15 | pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int; |
| 16 | pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int; | 16 | pub extern "c" fn pipe2(fds: *[2]fd_t, flags: u32) c_int; |
| 17 | pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void; | 17 | pub extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void; |
| 18 | pub extern "c" fn posix_memalign(memptr: *?*c_void, alignment: usize, size: usize) c_int; | 18 | pub extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int; |
| 19 | pub extern "c" fn sysconf(sc: c_int) i64; | 19 | pub extern "c" fn sysconf(sc: c_int) i64; |
| 20 | pub extern "c" fn signalfd(fd: fd_t, mask: *const sigset_t, flags: u32) c_int; | 20 | pub extern "c" fn signalfd(fd: fd_t, mask: *const sigset_t, flags: u32) c_int; |
| 21 | pub extern "c" fn madvise(address: [*]u8, len: usize, advise: u32) c_int; | 21 | pub extern "c" fn madvise(address: [*]u8, len: usize, advise: u32) c_int; |
| ... | @@ -44,7 +44,7 @@ pub const pthread_rwlock_t = extern struct { | ... | @@ -44,7 +44,7 @@ pub const pthread_rwlock_t = extern struct { |
| 44 | writercv: pthread_cond_t = .{}, | 44 | writercv: pthread_cond_t = .{}, |
| 45 | }; | 45 | }; |
| 46 | pub const pthread_attr_t = extern struct { | 46 | pub const pthread_attr_t = extern struct { |
| 47 | mutexattr: ?*c_void = null, | 47 | mutexattr: ?*anyopaque = null, |
| 48 | }; | 48 | }; |
| 49 | pub const pthread_key_t = c_int; | 49 | pub const pthread_key_t = c_int; |
| 50 | 50 | ||
| ... | @@ -56,7 +56,7 @@ pub const sem_t = extern struct { | ... | @@ -56,7 +56,7 @@ pub const sem_t = extern struct { |
| 56 | __pad2: [2]u64 = [_]u64{0} ** 2, | 56 | __pad2: [2]u64 = [_]u64{0} ** 2, |
| 57 | }; | 57 | }; |
| 58 | 58 | ||
| 59 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8, arg: ?*c_void) E; | 59 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8, arg: ?*anyopaque) E; |
| 60 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) E; | 60 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) E; |
| 61 | 61 | ||
| 62 | pub const blkcnt_t = i64; | 62 | pub const blkcnt_t = i64; |
| ... | @@ -109,10 +109,10 @@ pub const RTLD = struct { | ... | @@ -109,10 +109,10 @@ pub const RTLD = struct { |
| 109 | pub const FIRST = 0x02000; | 109 | pub const FIRST = 0x02000; |
| 110 | pub const CONFGEN = 0x10000; | 110 | pub const CONFGEN = 0x10000; |
| 111 | 111 | ||
| 112 | pub const NEXT = @intToPtr(*c_void, @bitCast(usize, @as(isize, -1))); | 112 | pub const NEXT = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -1))); |
| 113 | pub const DEFAULT = @intToPtr(*c_void, @bitCast(usize, @as(isize, -2))); | 113 | pub const DEFAULT = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -2))); |
| 114 | pub const SELF = @intToPtr(*c_void, @bitCast(usize, @as(isize, -3))); | 114 | pub const SELF = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -3))); |
| 115 | pub const PROBE = @intToPtr(*c_void, @bitCast(usize, @as(isize, -4))); | 115 | pub const PROBE = @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -4))); |
| 116 | }; | 116 | }; |
| 117 | 117 | ||
| 118 | pub const Flock = extern struct { | 118 | pub const Flock = extern struct { |
| ... | @@ -189,7 +189,7 @@ pub const msghdr = extern struct { | ... | @@ -189,7 +189,7 @@ pub const msghdr = extern struct { |
| 189 | /// # elements in msg_iov | 189 | /// # elements in msg_iov |
| 190 | msg_iovlen: i32, | 190 | msg_iovlen: i32, |
| 191 | /// ancillary data | 191 | /// ancillary data |
| 192 | msg_control: ?*c_void, | 192 | msg_control: ?*anyopaque, |
| 193 | /// ancillary data buffer len | 193 | /// ancillary data buffer len |
| 194 | msg_controllen: socklen_t, | 194 | msg_controllen: socklen_t, |
| 195 | /// flags on received message | 195 | /// flags on received message |
| ... | @@ -206,7 +206,7 @@ pub const msghdr_const = extern struct { | ... | @@ -206,7 +206,7 @@ pub const msghdr_const = extern struct { |
| 206 | /// # elements in msg_iov | 206 | /// # elements in msg_iov |
| 207 | msg_iovlen: i32, | 207 | msg_iovlen: i32, |
| 208 | /// ancillary data | 208 | /// ancillary data |
| 209 | msg_control: ?*c_void, | 209 | msg_control: ?*anyopaque, |
| 210 | /// ancillary data buffer len | 210 | /// ancillary data buffer len |
| 211 | msg_controllen: socklen_t, | 211 | msg_controllen: socklen_t, |
| 212 | /// flags on received message | 212 | /// flags on received message |
| ... | @@ -514,7 +514,7 @@ pub const CLOCK = struct { | ... | @@ -514,7 +514,7 @@ pub const CLOCK = struct { |
| 514 | }; | 514 | }; |
| 515 | 515 | ||
| 516 | pub const MAP = struct { | 516 | pub const MAP = struct { |
| 517 | pub const FAILED = @intToPtr(*c_void, maxInt(usize)); | 517 | pub const FAILED = @intToPtr(*anyopaque, maxInt(usize)); |
| 518 | pub const SHARED = 0x0001; | 518 | pub const SHARED = 0x0001; |
| 519 | pub const PRIVATE = 0x0002; | 519 | pub const PRIVATE = 0x0002; |
| 520 | pub const TYPE = 0x000f; | 520 | pub const TYPE = 0x000f; |
| ... | @@ -947,7 +947,7 @@ pub const SIG = struct { | ... | @@ -947,7 +947,7 @@ pub const SIG = struct { |
| 947 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. | 947 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 948 | pub const Sigaction = extern struct { | 948 | pub const Sigaction = extern struct { |
| 949 | pub const handler_fn = fn (c_int) callconv(.C) void; | 949 | pub const handler_fn = fn (c_int) callconv(.C) void; |
| 950 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const c_void) callconv(.C) void; | 950 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void; |
| 951 | 951 | ||
| 952 | /// signal options | 952 | /// signal options |
| 953 | flags: c_uint, | 953 | flags: c_uint, |
| ... | @@ -962,7 +962,7 @@ pub const Sigaction = extern struct { | ... | @@ -962,7 +962,7 @@ pub const Sigaction = extern struct { |
| 962 | 962 | ||
| 963 | pub const sigval_t = extern union { | 963 | pub const sigval_t = extern union { |
| 964 | int: c_int, | 964 | int: c_int, |
| 965 | ptr: ?*c_void, | 965 | ptr: ?*anyopaque, |
| 966 | }; | 966 | }; |
| 967 | 967 | ||
| 968 | pub const siginfo_t = extern struct { | 968 | pub const siginfo_t = extern struct { |
| ... | @@ -989,9 +989,9 @@ pub const siginfo_t = extern struct { | ... | @@ -989,9 +989,9 @@ pub const siginfo_t = extern struct { |
| 989 | zone: zoneid_t, | 989 | zone: zoneid_t, |
| 990 | }, | 990 | }, |
| 991 | fault: extern struct { | 991 | fault: extern struct { |
| 992 | addr: ?*c_void, | 992 | addr: ?*anyopaque, |
| 993 | trapno: c_int, | 993 | trapno: c_int, |
| 994 | pc: ?*c_void, | 994 | pc: ?*anyopaque, |
| 995 | }, | 995 | }, |
| 996 | file: extern struct { | 996 | file: extern struct { |
| 997 | // fd not currently available for SIGPOLL. | 997 | // fd not currently available for SIGPOLL. |
| ... | @@ -999,7 +999,7 @@ pub const siginfo_t = extern struct { | ... | @@ -999,7 +999,7 @@ pub const siginfo_t = extern struct { |
| 999 | band: c_long, | 999 | band: c_long, |
| 1000 | }, | 1000 | }, |
| 1001 | prof: extern struct { | 1001 | prof: extern struct { |
| 1002 | addr: ?*c_void, | 1002 | addr: ?*anyopaque, |
| 1003 | timestamp: timespec, | 1003 | timestamp: timespec, |
| 1004 | syscall: c_short, | 1004 | syscall: c_short, |
| 1005 | sysarg: u8, | 1005 | sysarg: u8, |
| ... | @@ -1065,7 +1065,7 @@ pub const ucontext_t = extern struct { | ... | @@ -1065,7 +1065,7 @@ pub const ucontext_t = extern struct { |
| 1065 | sigmask: sigset_t, | 1065 | sigmask: sigset_t, |
| 1066 | stack: stack_t, | 1066 | stack: stack_t, |
| 1067 | mcontext: mcontext_t, | 1067 | mcontext: mcontext_t, |
| 1068 | brand_data: [3]?*c_void, | 1068 | brand_data: [3]?*anyopaque, |
| 1069 | filler: [2]i64, | 1069 | filler: [2]i64, |
| 1070 | }; | 1070 | }; |
| 1071 | 1071 | ||
| ... | @@ -1783,9 +1783,9 @@ pub const port_event = extern struct { | ... | @@ -1783,9 +1783,9 @@ pub const port_event = extern struct { |
| 1783 | source: u16, | 1783 | source: u16, |
| 1784 | __pad: u16, | 1784 | __pad: u16, |
| 1785 | /// Source-specific object. | 1785 | /// Source-specific object. |
| 1786 | object: ?*c_void, | 1786 | object: ?*anyopaque, |
| 1787 | /// User cookie. | 1787 | /// User cookie. |
| 1788 | cookie: ?*c_void, | 1788 | cookie: ?*anyopaque, |
| 1789 | }; | 1789 | }; |
| 1790 | 1790 | ||
| 1791 | pub const port_notify = extern struct { | 1791 | pub const port_notify = extern struct { |
lib/std/c/windows.zig+1-1| ... | @@ -5,7 +5,7 @@ const windows = std.os.windows; | ... | @@ -5,7 +5,7 @@ const windows = std.os.windows; |
| 5 | 5 | ||
| 6 | pub extern "c" fn _errno() *c_int; | 6 | pub extern "c" fn _errno() *c_int; |
| 7 | 7 | ||
| 8 | pub extern "c" fn _msize(memblock: ?*c_void) usize; | 8 | pub extern "c" fn _msize(memblock: ?*anyopaque) usize; |
| 9 | 9 | ||
| 10 | // TODO: copied the else case and removed the socket function (because its in ws2_32) | 10 | // TODO: copied the else case and removed the socket function (because its in ws2_32) |
| 11 | // need to verify which of these is actually supported on windows | 11 | // need to verify which of these is actually supported on windows |
lib/std/child_process.zig+1-1| ... | @@ -923,7 +923,7 @@ fn windowsCreateProcess(app_name: [*:0]u16, cmd_line: [*:0]u16, envp_ptr: ?[*]u1 | ... | @@ -923,7 +923,7 @@ fn windowsCreateProcess(app_name: [*:0]u16, cmd_line: [*:0]u16, envp_ptr: ?[*]u1 |
| 923 | null, | 923 | null, |
| 924 | windows.TRUE, | 924 | windows.TRUE, |
| 925 | windows.CREATE_UNICODE_ENVIRONMENT, | 925 | windows.CREATE_UNICODE_ENVIRONMENT, |
| 926 | @ptrCast(?*c_void, envp_ptr), | 926 | @ptrCast(?*anyopaque, envp_ptr), |
| 927 | cwd_ptr, | 927 | cwd_ptr, |
| 928 | lpStartupInfo, | 928 | lpStartupInfo, |
| 929 | lpProcessInformation, | 929 | lpProcessInformation, |
lib/std/crypto/tlcsprng.zig+1-1| ... | @@ -59,7 +59,7 @@ var install_atfork_handler = std.once(struct { | ... | @@ -59,7 +59,7 @@ var install_atfork_handler = std.once(struct { |
| 59 | 59 | ||
| 60 | threadlocal var wipe_mem: []align(mem.page_size) u8 = &[_]u8{}; | 60 | threadlocal var wipe_mem: []align(mem.page_size) u8 = &[_]u8{}; |
| 61 | 61 | ||
| 62 | fn tlsCsprngFill(_: *c_void, buffer: []u8) void { | 62 | fn tlsCsprngFill(_: *anyopaque, buffer: []u8) void { |
| 63 | if (builtin.link_libc and @hasDecl(std.c, "arc4random_buf")) { | 63 | if (builtin.link_libc and @hasDecl(std.c, "arc4random_buf")) { |
| 64 | // arc4random is already a thread-local CSPRNG. | 64 | // arc4random is already a thread-local CSPRNG. |
| 65 | return std.c.arc4random_buf(buffer.ptr, buffer.len); | 65 | return std.c.arc4random_buf(buffer.ptr, buffer.len); |
lib/std/debug.zig+4-4| ... | @@ -156,14 +156,14 @@ pub fn captureStackTrace(first_address: ?usize, stack_trace: *std.builtin.StackT | ... | @@ -156,14 +156,14 @@ pub fn captureStackTrace(first_address: ?usize, stack_trace: *std.builtin.StackT |
| 156 | stack_trace.index = windows.ntdll.RtlCaptureStackBackTrace( | 156 | stack_trace.index = windows.ntdll.RtlCaptureStackBackTrace( |
| 157 | 0, | 157 | 0, |
| 158 | u32_addrs_len, | 158 | u32_addrs_len, |
| 159 | @ptrCast(**c_void, addrs.ptr), | 159 | @ptrCast(**anyopaque, addrs.ptr), |
| 160 | null, | 160 | null, |
| 161 | ); | 161 | ); |
| 162 | return; | 162 | return; |
| 163 | }; | 163 | }; |
| 164 | var addr_buf_stack: [32]usize = undefined; | 164 | var addr_buf_stack: [32]usize = undefined; |
| 165 | const addr_buf = if (addr_buf_stack.len > addrs.len) addr_buf_stack[0..] else addrs; | 165 | const addr_buf = if (addr_buf_stack.len > addrs.len) addr_buf_stack[0..] else addrs; |
| 166 | const n = windows.ntdll.RtlCaptureStackBackTrace(0, u32_addrs_len, @ptrCast(**c_void, addr_buf.ptr), null); | 166 | const n = windows.ntdll.RtlCaptureStackBackTrace(0, u32_addrs_len, @ptrCast(**anyopaque, addr_buf.ptr), null); |
| 167 | const first_index = for (addr_buf[0..n]) |addr, i| { | 167 | const first_index = for (addr_buf[0..n]) |addr, i| { |
| 168 | if (addr == first_addr) { | 168 | if (addr == first_addr) { |
| 169 | break i; | 169 | break i; |
| ... | @@ -472,7 +472,7 @@ pub fn writeCurrentStackTraceWindows( | ... | @@ -472,7 +472,7 @@ pub fn writeCurrentStackTraceWindows( |
| 472 | start_addr: ?usize, | 472 | start_addr: ?usize, |
| 473 | ) !void { | 473 | ) !void { |
| 474 | var addr_buf: [1024]usize = undefined; | 474 | var addr_buf: [1024]usize = undefined; |
| 475 | const n = windows.ntdll.RtlCaptureStackBackTrace(0, addr_buf.len, @ptrCast(**c_void, &addr_buf), null); | 475 | const n = windows.ntdll.RtlCaptureStackBackTrace(0, addr_buf.len, @ptrCast(**anyopaque, &addr_buf), null); |
| 476 | const addrs = addr_buf[0..n]; | 476 | const addrs = addr_buf[0..n]; |
| 477 | var start_i: usize = if (start_addr) |saddr| blk: { | 477 | var start_i: usize = if (start_addr) |saddr| blk: { |
| 478 | for (addrs) |addr, i| { | 478 | for (addrs) |addr, i| { |
| ... | @@ -1629,7 +1629,7 @@ fn resetSegfaultHandler() void { | ... | @@ -1629,7 +1629,7 @@ fn resetSegfaultHandler() void { |
| 1629 | os.sigaction(os.SIG.BUS, &act, null); | 1629 | os.sigaction(os.SIG.BUS, &act, null); |
| 1630 | } | 1630 | } |
| 1631 | 1631 | ||
| 1632 | fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const c_void) callconv(.C) noreturn { | 1632 | fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const anyopaque) callconv(.C) noreturn { |
| 1633 | // Reset to the default handler so that if a segfault happens in this handler it will crash | 1633 | // Reset to the default handler so that if a segfault happens in this handler it will crash |
| 1634 | // the process. Also when this handler returns, the original instruction will be repeated | 1634 | // the process. Also when this handler returns, the original instruction will be repeated |
| 1635 | // and the resulting segfault will crash the process rather than continually dump stack traces. | 1635 | // and the resulting segfault will crash the process rather than continually dump stack traces. |
lib/std/dynamic_library.zig+1-1| ... | @@ -357,7 +357,7 @@ pub const WindowsDynLib = struct { | ... | @@ -357,7 +357,7 @@ pub const WindowsDynLib = struct { |
| 357 | pub const DlDynlib = struct { | 357 | pub const DlDynlib = struct { |
| 358 | pub const Error = error{FileNotFound}; | 358 | pub const Error = error{FileNotFound}; |
| 359 | 359 | ||
| 360 | handle: *c_void, | 360 | handle: *anyopaque, |
| 361 | 361 | ||
| 362 | pub fn open(path: []const u8) !DlDynlib { | 362 | pub fn open(path: []const u8) !DlDynlib { |
| 363 | const path_c = try os.toPosixPath(path); | 363 | const path_c = try os.toPosixPath(path); |
lib/std/fs/get_app_data_dir.zig+1-1| ... | @@ -23,7 +23,7 @@ pub fn getAppDataDir(allocator: mem.Allocator, appname: []const u8) GetAppDataDi | ... | @@ -23,7 +23,7 @@ pub fn getAppDataDir(allocator: mem.Allocator, appname: []const u8) GetAppDataDi |
| 23 | &dir_path_ptr, | 23 | &dir_path_ptr, |
| 24 | )) { | 24 | )) { |
| 25 | os.windows.S_OK => { | 25 | os.windows.S_OK => { |
| 26 | defer os.windows.ole32.CoTaskMemFree(@ptrCast(*c_void, dir_path_ptr)); | 26 | defer os.windows.ole32.CoTaskMemFree(@ptrCast(*anyopaque, dir_path_ptr)); |
| 27 | const global_dir = unicode.utf16leToUtf8Alloc(allocator, mem.sliceTo(dir_path_ptr, 0)) catch |err| switch (err) { | 27 | const global_dir = unicode.utf16leToUtf8Alloc(allocator, mem.sliceTo(dir_path_ptr, 0)) catch |err| switch (err) { |
| 28 | error.UnexpectedSecondSurrogateHalf => return error.AppDataDirUnavailable, | 28 | error.UnexpectedSecondSurrogateHalf => return error.AppDataDirUnavailable, |
| 29 | error.ExpectedSecondSurrogateHalf => return error.AppDataDirUnavailable, | 29 | error.ExpectedSecondSurrogateHalf => return error.AppDataDirUnavailable, |
lib/std/heap.zig+18-18| ... | @@ -58,7 +58,7 @@ const CAllocator = struct { | ... | @@ -58,7 +58,7 @@ const CAllocator = struct { |
| 58 | // multiple of the pointer size | 58 | // multiple of the pointer size |
| 59 | const eff_alignment = std.math.max(alignment, @sizeOf(usize)); | 59 | const eff_alignment = std.math.max(alignment, @sizeOf(usize)); |
| 60 | 60 | ||
| 61 | var aligned_ptr: ?*c_void = undefined; | 61 | var aligned_ptr: ?*anyopaque = undefined; |
| 62 | if (c.posix_memalign(&aligned_ptr, eff_alignment, len) != 0) | 62 | if (c.posix_memalign(&aligned_ptr, eff_alignment, len) != 0) |
| 63 | return null; | 63 | return null; |
| 64 | 64 | ||
| ... | @@ -97,7 +97,7 @@ const CAllocator = struct { | ... | @@ -97,7 +97,7 @@ const CAllocator = struct { |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | fn alloc( | 99 | fn alloc( |
| 100 | _: *c_void, | 100 | _: *anyopaque, |
| 101 | len: usize, | 101 | len: usize, |
| 102 | alignment: u29, | 102 | alignment: u29, |
| 103 | len_align: u29, | 103 | len_align: u29, |
| ... | @@ -123,7 +123,7 @@ const CAllocator = struct { | ... | @@ -123,7 +123,7 @@ const CAllocator = struct { |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | fn resize( | 125 | fn resize( |
| 126 | _: *c_void, | 126 | _: *anyopaque, |
| 127 | buf: []u8, | 127 | buf: []u8, |
| 128 | buf_align: u29, | 128 | buf_align: u29, |
| 129 | new_len: usize, | 129 | new_len: usize, |
| ... | @@ -145,7 +145,7 @@ const CAllocator = struct { | ... | @@ -145,7 +145,7 @@ const CAllocator = struct { |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | fn free( | 147 | fn free( |
| 148 | _: *c_void, | 148 | _: *anyopaque, |
| 149 | buf: []u8, | 149 | buf: []u8, |
| 150 | buf_align: u29, | 150 | buf_align: u29, |
| 151 | return_address: usize, | 151 | return_address: usize, |
| ... | @@ -185,7 +185,7 @@ const raw_c_allocator_vtable = Allocator.VTable{ | ... | @@ -185,7 +185,7 @@ const raw_c_allocator_vtable = Allocator.VTable{ |
| 185 | }; | 185 | }; |
| 186 | 186 | ||
| 187 | fn rawCAlloc( | 187 | fn rawCAlloc( |
| 188 | _: *c_void, | 188 | _: *anyopaque, |
| 189 | len: usize, | 189 | len: usize, |
| 190 | ptr_align: u29, | 190 | ptr_align: u29, |
| 191 | len_align: u29, | 191 | len_align: u29, |
| ... | @@ -199,7 +199,7 @@ fn rawCAlloc( | ... | @@ -199,7 +199,7 @@ fn rawCAlloc( |
| 199 | } | 199 | } |
| 200 | 200 | ||
| 201 | fn rawCResize( | 201 | fn rawCResize( |
| 202 | _: *c_void, | 202 | _: *anyopaque, |
| 203 | buf: []u8, | 203 | buf: []u8, |
| 204 | old_align: u29, | 204 | old_align: u29, |
| 205 | new_len: usize, | 205 | new_len: usize, |
| ... | @@ -215,7 +215,7 @@ fn rawCResize( | ... | @@ -215,7 +215,7 @@ fn rawCResize( |
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | fn rawCFree( | 217 | fn rawCFree( |
| 218 | _: *c_void, | 218 | _: *anyopaque, |
| 219 | buf: []u8, | 219 | buf: []u8, |
| 220 | old_align: u29, | 220 | old_align: u29, |
| 221 | ret_addr: usize, | 221 | ret_addr: usize, |
| ... | @@ -257,7 +257,7 @@ const PageAllocator = struct { | ... | @@ -257,7 +257,7 @@ const PageAllocator = struct { |
| 257 | .free = free, | 257 | .free = free, |
| 258 | }; | 258 | }; |
| 259 | 259 | ||
| 260 | fn alloc(_: *c_void, n: usize, alignment: u29, len_align: u29, ra: usize) error{OutOfMemory}![]u8 { | 260 | fn alloc(_: *anyopaque, n: usize, alignment: u29, len_align: u29, ra: usize) error{OutOfMemory}![]u8 { |
| 261 | _ = ra; | 261 | _ = ra; |
| 262 | assert(n > 0); | 262 | assert(n > 0); |
| 263 | const aligned_len = mem.alignForward(n, mem.page_size); | 263 | const aligned_len = mem.alignForward(n, mem.page_size); |
| ... | @@ -305,7 +305,7 @@ const PageAllocator = struct { | ... | @@ -305,7 +305,7 @@ const PageAllocator = struct { |
| 305 | // VirtualAlloc call to fail. To handle this, we will retry | 305 | // VirtualAlloc call to fail. To handle this, we will retry |
| 306 | // until it succeeds. | 306 | // until it succeeds. |
| 307 | const ptr = w.VirtualAlloc( | 307 | const ptr = w.VirtualAlloc( |
| 308 | @intToPtr(*c_void, aligned_addr), | 308 | @intToPtr(*anyopaque, aligned_addr), |
| 309 | aligned_len, | 309 | aligned_len, |
| 310 | w.MEM_COMMIT | w.MEM_RESERVE, | 310 | w.MEM_COMMIT | w.MEM_RESERVE, |
| 311 | w.PAGE_READWRITE, | 311 | w.PAGE_READWRITE, |
| ... | @@ -355,7 +355,7 @@ const PageAllocator = struct { | ... | @@ -355,7 +355,7 @@ const PageAllocator = struct { |
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | fn resize( | 357 | fn resize( |
| 358 | _: *c_void, | 358 | _: *anyopaque, |
| 359 | buf_unaligned: []u8, | 359 | buf_unaligned: []u8, |
| 360 | buf_align: u29, | 360 | buf_align: u29, |
| 361 | new_size: usize, | 361 | new_size: usize, |
| ... | @@ -376,7 +376,7 @@ const PageAllocator = struct { | ... | @@ -376,7 +376,7 @@ const PageAllocator = struct { |
| 376 | // For shrinking that is not releasing, we will only | 376 | // For shrinking that is not releasing, we will only |
| 377 | // decommit the pages not needed anymore. | 377 | // decommit the pages not needed anymore. |
| 378 | w.VirtualFree( | 378 | w.VirtualFree( |
| 379 | @intToPtr(*c_void, new_addr_end), | 379 | @intToPtr(*anyopaque, new_addr_end), |
| 380 | old_addr_end - new_addr_end, | 380 | old_addr_end - new_addr_end, |
| 381 | w.MEM_DECOMMIT, | 381 | w.MEM_DECOMMIT, |
| 382 | ); | 382 | ); |
| ... | @@ -406,7 +406,7 @@ const PageAllocator = struct { | ... | @@ -406,7 +406,7 @@ const PageAllocator = struct { |
| 406 | return null; | 406 | return null; |
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | fn free(_: *c_void, buf_unaligned: []u8, buf_align: u29, return_address: usize) void { | 409 | fn free(_: *anyopaque, buf_unaligned: []u8, buf_align: u29, return_address: usize) void { |
| 410 | _ = buf_align; | 410 | _ = buf_align; |
| 411 | _ = return_address; | 411 | _ = return_address; |
| 412 | 412 | ||
| ... | @@ -518,7 +518,7 @@ const WasmPageAllocator = struct { | ... | @@ -518,7 +518,7 @@ const WasmPageAllocator = struct { |
| 518 | return mem.alignForward(memsize, mem.page_size) / mem.page_size; | 518 | return mem.alignForward(memsize, mem.page_size) / mem.page_size; |
| 519 | } | 519 | } |
| 520 | 520 | ||
| 521 | fn alloc(_: *c_void, len: usize, alignment: u29, len_align: u29, ra: usize) error{OutOfMemory}![]u8 { | 521 | fn alloc(_: *anyopaque, len: usize, alignment: u29, len_align: u29, ra: usize) error{OutOfMemory}![]u8 { |
| 522 | _ = ra; | 522 | _ = ra; |
| 523 | const page_count = nPages(len); | 523 | const page_count = nPages(len); |
| 524 | const page_idx = try allocPages(page_count, alignment); | 524 | const page_idx = try allocPages(page_count, alignment); |
| ... | @@ -573,7 +573,7 @@ const WasmPageAllocator = struct { | ... | @@ -573,7 +573,7 @@ const WasmPageAllocator = struct { |
| 573 | } | 573 | } |
| 574 | 574 | ||
| 575 | fn resize( | 575 | fn resize( |
| 576 | _: *c_void, | 576 | _: *anyopaque, |
| 577 | buf: []u8, | 577 | buf: []u8, |
| 578 | buf_align: u29, | 578 | buf_align: u29, |
| 579 | new_len: usize, | 579 | new_len: usize, |
| ... | @@ -594,7 +594,7 @@ const WasmPageAllocator = struct { | ... | @@ -594,7 +594,7 @@ const WasmPageAllocator = struct { |
| 594 | } | 594 | } |
| 595 | 595 | ||
| 596 | fn free( | 596 | fn free( |
| 597 | _: *c_void, | 597 | _: *anyopaque, |
| 598 | buf: []u8, | 598 | buf: []u8, |
| 599 | buf_align: u29, | 599 | buf_align: u29, |
| 600 | return_address: usize, | 600 | return_address: usize, |
| ... | @@ -684,10 +684,10 @@ pub const HeapAllocator = switch (builtin.os.tag) { | ... | @@ -684,10 +684,10 @@ pub const HeapAllocator = switch (builtin.os.tag) { |
| 684 | const new_ptr = os.windows.kernel32.HeapReAlloc( | 684 | const new_ptr = os.windows.kernel32.HeapReAlloc( |
| 685 | self.heap_handle.?, | 685 | self.heap_handle.?, |
| 686 | os.windows.HEAP_REALLOC_IN_PLACE_ONLY, | 686 | os.windows.HEAP_REALLOC_IN_PLACE_ONLY, |
| 687 | @intToPtr(*c_void, root_addr), | 687 | @intToPtr(*anyopaque, root_addr), |
| 688 | amt, | 688 | amt, |
| 689 | ) orelse return null; | 689 | ) orelse return null; |
| 690 | assert(new_ptr == @intToPtr(*c_void, root_addr)); | 690 | assert(new_ptr == @intToPtr(*anyopaque, root_addr)); |
| 691 | const return_len = init: { | 691 | const return_len = init: { |
| 692 | if (len_align == 0) break :init new_size; | 692 | if (len_align == 0) break :init new_size; |
| 693 | const full_len = os.windows.kernel32.HeapSize(self.heap_handle.?, 0, new_ptr); | 693 | const full_len = os.windows.kernel32.HeapSize(self.heap_handle.?, 0, new_ptr); |
| ... | @@ -707,7 +707,7 @@ pub const HeapAllocator = switch (builtin.os.tag) { | ... | @@ -707,7 +707,7 @@ pub const HeapAllocator = switch (builtin.os.tag) { |
| 707 | ) void { | 707 | ) void { |
| 708 | _ = buf_align; | 708 | _ = buf_align; |
| 709 | _ = return_address; | 709 | _ = return_address; |
| 710 | os.windows.HeapFree(self.heap_handle.?, 0, @intToPtr(*c_void, getRecordPtr(buf).*)); | 710 | os.windows.HeapFree(self.heap_handle.?, 0, @intToPtr(*anyopaque, getRecordPtr(buf).*)); |
| 711 | } | 711 | } |
| 712 | }, | 712 | }, |
| 713 | else => @compileError("Unsupported OS"), | 713 | else => @compileError("Unsupported OS"), |
lib/std/mem.zig+3-3| ... | @@ -151,11 +151,11 @@ const fail_allocator = Allocator{ | ... | @@ -151,11 +151,11 @@ const fail_allocator = Allocator{ |
| 151 | 151 | ||
| 152 | const failAllocator_vtable = Allocator.VTable{ | 152 | const failAllocator_vtable = Allocator.VTable{ |
| 153 | .alloc = failAllocatorAlloc, | 153 | .alloc = failAllocatorAlloc, |
| 154 | .resize = Allocator.NoResize(c_void).noResize, | 154 | .resize = Allocator.NoResize(anyopaque).noResize, |
| 155 | .free = Allocator.NoOpFree(c_void).noOpFree, | 155 | .free = Allocator.NoOpFree(anyopaque).noOpFree, |
| 156 | }; | 156 | }; |
| 157 | 157 | ||
| 158 | fn failAllocatorAlloc(_: *c_void, n: usize, alignment: u29, len_align: u29, ra: usize) Allocator.Error![]u8 { | 158 | fn failAllocatorAlloc(_: *anyopaque, n: usize, alignment: u29, len_align: u29, ra: usize) Allocator.Error![]u8 { |
| 159 | _ = n; | 159 | _ = n; |
| 160 | _ = alignment; | 160 | _ = alignment; |
| 161 | _ = len_align; | 161 | _ = len_align; |
lib/std/mem/Allocator.zig+7-7| ... | @@ -10,7 +10,7 @@ const builtin = @import("builtin"); | ... | @@ -10,7 +10,7 @@ const builtin = @import("builtin"); |
| 10 | pub const Error = error{OutOfMemory}; | 10 | pub const Error = error{OutOfMemory}; |
| 11 | 11 | ||
| 12 | // The type erased pointer to the allocator implementation | 12 | // The type erased pointer to the allocator implementation |
| 13 | ptr: *c_void, | 13 | ptr: *anyopaque, |
| 14 | vtable: *const VTable, | 14 | vtable: *const VTable, |
| 15 | 15 | ||
| 16 | pub const VTable = struct { | 16 | pub const VTable = struct { |
| ... | @@ -23,7 +23,7 @@ pub const VTable = struct { | ... | @@ -23,7 +23,7 @@ pub const VTable = struct { |
| 23 | /// | 23 | /// |
| 24 | /// `ret_addr` is optionally provided as the first return address of the allocation call stack. | 24 | /// `ret_addr` is optionally provided as the first return address of the allocation call stack. |
| 25 | /// If the value is `0` it means no return address has been provided. | 25 | /// If the value is `0` it means no return address has been provided. |
| 26 | alloc: fn (ptr: *c_void, len: usize, ptr_align: u29, len_align: u29, ret_addr: usize) Error![]u8, | 26 | alloc: fn (ptr: *anyopaque, len: usize, ptr_align: u29, len_align: u29, ret_addr: usize) Error![]u8, |
| 27 | 27 | ||
| 28 | /// Attempt to expand or shrink memory in place. `buf.len` must equal the most recent | 28 | /// Attempt to expand or shrink memory in place. `buf.len` must equal the most recent |
| 29 | /// length returned by `alloc` or `resize`. `buf_align` must equal the same value | 29 | /// length returned by `alloc` or `resize`. `buf_align` must equal the same value |
| ... | @@ -42,14 +42,14 @@ pub const VTable = struct { | ... | @@ -42,14 +42,14 @@ pub const VTable = struct { |
| 42 | /// | 42 | /// |
| 43 | /// `ret_addr` is optionally provided as the first return address of the allocation call stack. | 43 | /// `ret_addr` is optionally provided as the first return address of the allocation call stack. |
| 44 | /// If the value is `0` it means no return address has been provided. | 44 | /// If the value is `0` it means no return address has been provided. |
| 45 | resize: fn (ptr: *c_void, buf: []u8, buf_align: u29, new_len: usize, len_align: u29, ret_addr: usize) ?usize, | 45 | resize: fn (ptr: *anyopaque, buf: []u8, buf_align: u29, new_len: usize, len_align: u29, ret_addr: usize) ?usize, |
| 46 | 46 | ||
| 47 | /// Free and invalidate a buffer. `buf.len` must equal the most recent length returned by `alloc` or `resize`. | 47 | /// Free and invalidate a buffer. `buf.len` must equal the most recent length returned by `alloc` or `resize`. |
| 48 | /// `buf_align` must equal the same value that was passed as the `ptr_align` parameter to the original `alloc` call. | 48 | /// `buf_align` must equal the same value that was passed as the `ptr_align` parameter to the original `alloc` call. |
| 49 | /// | 49 | /// |
| 50 | /// `ret_addr` is optionally provided as the first return address of the allocation call stack. | 50 | /// `ret_addr` is optionally provided as the first return address of the allocation call stack. |
| 51 | /// If the value is `0` it means no return address has been provided. | 51 | /// If the value is `0` it means no return address has been provided. |
| 52 | free: fn (ptr: *c_void, buf: []u8, buf_align: u29, ret_addr: usize) void, | 52 | free: fn (ptr: *anyopaque, buf: []u8, buf_align: u29, ret_addr: usize) void, |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | pub fn init( | 55 | pub fn init( |
| ... | @@ -67,16 +67,16 @@ pub fn init( | ... | @@ -67,16 +67,16 @@ pub fn init( |
| 67 | const alignment = ptr_info.Pointer.alignment; | 67 | const alignment = ptr_info.Pointer.alignment; |
| 68 | 68 | ||
| 69 | const gen = struct { | 69 | const gen = struct { |
| 70 | fn allocImpl(ptr: *c_void, len: usize, ptr_align: u29, len_align: u29, ret_addr: usize) Error![]u8 { | 70 | fn allocImpl(ptr: *anyopaque, len: usize, ptr_align: u29, len_align: u29, ret_addr: usize) Error![]u8 { |
| 71 | const self = @ptrCast(Ptr, @alignCast(alignment, ptr)); | 71 | const self = @ptrCast(Ptr, @alignCast(alignment, ptr)); |
| 72 | return @call(.{ .modifier = .always_inline }, allocFn, .{ self, len, ptr_align, len_align, ret_addr }); | 72 | return @call(.{ .modifier = .always_inline }, allocFn, .{ self, len, ptr_align, len_align, ret_addr }); |
| 73 | } | 73 | } |
| 74 | fn resizeImpl(ptr: *c_void, buf: []u8, buf_align: u29, new_len: usize, len_align: u29, ret_addr: usize) ?usize { | 74 | fn resizeImpl(ptr: *anyopaque, buf: []u8, buf_align: u29, new_len: usize, len_align: u29, ret_addr: usize) ?usize { |
| 75 | assert(new_len != 0); | 75 | assert(new_len != 0); |
| 76 | const self = @ptrCast(Ptr, @alignCast(alignment, ptr)); | 76 | const self = @ptrCast(Ptr, @alignCast(alignment, ptr)); |
| 77 | return @call(.{ .modifier = .always_inline }, resizeFn, .{ self, buf, buf_align, new_len, len_align, ret_addr }); | 77 | return @call(.{ .modifier = .always_inline }, resizeFn, .{ self, buf, buf_align, new_len, len_align, ret_addr }); |
| 78 | } | 78 | } |
| 79 | fn freeImpl(ptr: *c_void, buf: []u8, buf_align: u29, ret_addr: usize) void { | 79 | fn freeImpl(ptr: *anyopaque, buf: []u8, buf_align: u29, ret_addr: usize) void { |
| 80 | const self = @ptrCast(Ptr, @alignCast(alignment, ptr)); | 80 | const self = @ptrCast(Ptr, @alignCast(alignment, ptr)); |
| 81 | @call(.{ .modifier = .always_inline }, freeFn, .{ self, buf, buf_align, ret_addr }); | 81 | @call(.{ .modifier = .always_inline }, freeFn, .{ self, buf, buf_align, ret_addr }); |
| 82 | } | 82 | } |
lib/std/os.zig+7-7| ... | @@ -2904,7 +2904,7 @@ pub fn isCygwinPty(handle: fd_t) bool { | ... | @@ -2904,7 +2904,7 @@ pub fn isCygwinPty(handle: fd_t) bool { |
| 2904 | if (windows.kernel32.GetFileInformationByHandleEx( | 2904 | if (windows.kernel32.GetFileInformationByHandleEx( |
| 2905 | handle, | 2905 | handle, |
| 2906 | windows.FileNameInfo, | 2906 | windows.FileNameInfo, |
| 2907 | @ptrCast(*c_void, &name_info_bytes), | 2907 | @ptrCast(*anyopaque, &name_info_bytes), |
| 2908 | name_info_bytes.len, | 2908 | name_info_bytes.len, |
| 2909 | ) == 0) { | 2909 | ) == 0) { |
| 2910 | return false; | 2910 | return false; |
| ... | @@ -4236,9 +4236,9 @@ pub const SysCtlError = error{ | ... | @@ -4236,9 +4236,9 @@ pub const SysCtlError = error{ |
| 4236 | 4236 | ||
| 4237 | pub fn sysctl( | 4237 | pub fn sysctl( |
| 4238 | name: []const c_int, | 4238 | name: []const c_int, |
| 4239 | oldp: ?*c_void, | 4239 | oldp: ?*anyopaque, |
| 4240 | oldlenp: ?*usize, | 4240 | oldlenp: ?*usize, |
| 4241 | newp: ?*c_void, | 4241 | newp: ?*anyopaque, |
| 4242 | newlen: usize, | 4242 | newlen: usize, |
| 4243 | ) SysCtlError!void { | 4243 | ) SysCtlError!void { |
| 4244 | if (builtin.os.tag == .wasi) { | 4244 | if (builtin.os.tag == .wasi) { |
| ... | @@ -4261,9 +4261,9 @@ pub fn sysctl( | ... | @@ -4261,9 +4261,9 @@ pub fn sysctl( |
| 4261 | 4261 | ||
| 4262 | pub fn sysctlbynameZ( | 4262 | pub fn sysctlbynameZ( |
| 4263 | name: [*:0]const u8, | 4263 | name: [*:0]const u8, |
| 4264 | oldp: ?*c_void, | 4264 | oldp: ?*anyopaque, |
| 4265 | oldlenp: ?*usize, | 4265 | oldlenp: ?*usize, |
| 4266 | newp: ?*c_void, | 4266 | newp: ?*anyopaque, |
| 4267 | newlen: usize, | 4267 | newlen: usize, |
| 4268 | ) SysCtlError!void { | 4268 | ) SysCtlError!void { |
| 4269 | if (builtin.os.tag == .wasi) { | 4269 | if (builtin.os.tag == .wasi) { |
| ... | @@ -4801,12 +4801,12 @@ pub fn dl_iterate_phdr( | ... | @@ -4801,12 +4801,12 @@ pub fn dl_iterate_phdr( |
| 4801 | 4801 | ||
| 4802 | if (builtin.link_libc) { | 4802 | if (builtin.link_libc) { |
| 4803 | switch (system.dl_iterate_phdr(struct { | 4803 | switch (system.dl_iterate_phdr(struct { |
| 4804 | fn callbackC(info: *dl_phdr_info, size: usize, data: ?*c_void) callconv(.C) c_int { | 4804 | fn callbackC(info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.C) c_int { |
| 4805 | const context_ptr = @ptrCast(*const Context, @alignCast(@alignOf(*const Context), data)); | 4805 | const context_ptr = @ptrCast(*const Context, @alignCast(@alignOf(*const Context), data)); |
| 4806 | callback(info, size, context_ptr.*) catch |err| return @errorToInt(err); | 4806 | callback(info, size, context_ptr.*) catch |err| return @errorToInt(err); |
| 4807 | return 0; | 4807 | return 0; |
| 4808 | } | 4808 | } |
| 4809 | }.callbackC, @intToPtr(?*c_void, @ptrToInt(&context)))) { | 4809 | }.callbackC, @intToPtr(?*anyopaque, @ptrToInt(&context)))) { |
| 4810 | 0 => return, | 4810 | 0 => return, |
| 4811 | else => |err| return @errSetCast(Error, @intToError(@intCast(u16, err))), // TODO don't hardcode u16 | 4811 | else => |err| return @errSetCast(Error, @intToError(@intCast(u16, err))), // TODO don't hardcode u16 |
| 4812 | } | 4812 | } |
lib/std/os/linux.zig+12-12| ... | @@ -845,14 +845,14 @@ pub fn flock(fd: fd_t, operation: i32) usize { | ... | @@ -845,14 +845,14 @@ pub fn flock(fd: fd_t, operation: i32) usize { |
| 845 | return syscall2(.flock, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, operation))); | 845 | return syscall2(.flock, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, operation))); |
| 846 | } | 846 | } |
| 847 | 847 | ||
| 848 | var vdso_clock_gettime = @ptrCast(?*const c_void, init_vdso_clock_gettime); | 848 | var vdso_clock_gettime = @ptrCast(?*const anyopaque, init_vdso_clock_gettime); |
| 849 | 849 | ||
| 850 | // We must follow the C calling convention when we call into the VDSO | 850 | // We must follow the C calling convention when we call into the VDSO |
| 851 | const vdso_clock_gettime_ty = fn (i32, *timespec) callconv(.C) usize; | 851 | const vdso_clock_gettime_ty = fn (i32, *timespec) callconv(.C) usize; |
| 852 | 852 | ||
| 853 | pub fn clock_gettime(clk_id: i32, tp: *timespec) usize { | 853 | pub fn clock_gettime(clk_id: i32, tp: *timespec) usize { |
| 854 | if (@hasDecl(VDSO, "CGT_SYM")) { | 854 | if (@hasDecl(VDSO, "CGT_SYM")) { |
| 855 | const ptr = @atomicLoad(?*const c_void, &vdso_clock_gettime, .Unordered); | 855 | const ptr = @atomicLoad(?*const anyopaque, &vdso_clock_gettime, .Unordered); |
| 856 | if (ptr) |fn_ptr| { | 856 | if (ptr) |fn_ptr| { |
| 857 | const f = @ptrCast(vdso_clock_gettime_ty, fn_ptr); | 857 | const f = @ptrCast(vdso_clock_gettime_ty, fn_ptr); |
| 858 | const rc = f(clk_id, tp); | 858 | const rc = f(clk_id, tp); |
| ... | @@ -866,10 +866,10 @@ pub fn clock_gettime(clk_id: i32, tp: *timespec) usize { | ... | @@ -866,10 +866,10 @@ pub fn clock_gettime(clk_id: i32, tp: *timespec) usize { |
| 866 | } | 866 | } |
| 867 | 867 | ||
| 868 | fn init_vdso_clock_gettime(clk: i32, ts: *timespec) callconv(.C) usize { | 868 | fn init_vdso_clock_gettime(clk: i32, ts: *timespec) callconv(.C) usize { |
| 869 | const ptr = @intToPtr(?*const c_void, vdso.lookup(VDSO.CGT_VER, VDSO.CGT_SYM)); | 869 | const ptr = @intToPtr(?*const anyopaque, vdso.lookup(VDSO.CGT_VER, VDSO.CGT_SYM)); |
| 870 | // Note that we may not have a VDSO at all, update the stub address anyway | 870 | // Note that we may not have a VDSO at all, update the stub address anyway |
| 871 | // so that clock_gettime will fall back on the good old (and slow) syscall | 871 | // so that clock_gettime will fall back on the good old (and slow) syscall |
| 872 | @atomicStore(?*const c_void, &vdso_clock_gettime, ptr, .Monotonic); | 872 | @atomicStore(?*const anyopaque, &vdso_clock_gettime, ptr, .Monotonic); |
| 873 | // Call into the VDSO if available | 873 | // Call into the VDSO if available |
| 874 | if (ptr) |fn_ptr| { | 874 | if (ptr) |fn_ptr| { |
| 875 | const f = @ptrCast(vdso_clock_gettime_ty, fn_ptr); | 875 | const f = @ptrCast(vdso_clock_gettime_ty, fn_ptr); |
| ... | @@ -1180,7 +1180,7 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize | ... | @@ -1180,7 +1180,7 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize |
| 1180 | return syscall4(.sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msgvec), vlen, flags); | 1180 | return syscall4(.sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msgvec), vlen, flags); |
| 1181 | } | 1181 | } |
| 1182 | 1182 | ||
| 1183 | pub fn connect(fd: i32, addr: *const c_void, len: socklen_t) usize { | 1183 | pub fn connect(fd: i32, addr: *const anyopaque, len: socklen_t) usize { |
| 1184 | if (native_arch == .i386) { | 1184 | if (native_arch == .i386) { |
| 1185 | return socketcall(SC.connect, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len }); | 1185 | return socketcall(SC.connect, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len }); |
| 1186 | } | 1186 | } |
| ... | @@ -1452,7 +1452,7 @@ pub fn io_uring_enter(fd: i32, to_submit: u32, min_complete: u32, flags: u32, si | ... | @@ -1452,7 +1452,7 @@ pub fn io_uring_enter(fd: i32, to_submit: u32, min_complete: u32, flags: u32, si |
| 1452 | return syscall6(.io_uring_enter, @bitCast(usize, @as(isize, fd)), to_submit, min_complete, flags, @ptrToInt(sig), NSIG / 8); | 1452 | return syscall6(.io_uring_enter, @bitCast(usize, @as(isize, fd)), to_submit, min_complete, flags, @ptrToInt(sig), NSIG / 8); |
| 1453 | } | 1453 | } |
| 1454 | 1454 | ||
| 1455 | pub fn io_uring_register(fd: i32, opcode: IORING_REGISTER, arg: ?*const c_void, nr_args: u32) usize { | 1455 | pub fn io_uring_register(fd: i32, opcode: IORING_REGISTER, arg: ?*const anyopaque, nr_args: u32) usize { |
| 1456 | return syscall4(.io_uring_register, @bitCast(usize, @as(isize, fd)), @enumToInt(opcode), @ptrToInt(arg), nr_args); | 1456 | return syscall4(.io_uring_register, @bitCast(usize, @as(isize, fd)), @enumToInt(opcode), @ptrToInt(arg), nr_args); |
| 1457 | } | 1457 | } |
| 1458 | 1458 | ||
| ... | @@ -3045,7 +3045,7 @@ pub const k_sigaction = switch (native_arch) { | ... | @@ -3045,7 +3045,7 @@ pub const k_sigaction = switch (native_arch) { |
| 3045 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. | 3045 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 3046 | pub const Sigaction = extern struct { | 3046 | pub const Sigaction = extern struct { |
| 3047 | pub const handler_fn = fn (c_int) callconv(.C) void; | 3047 | pub const handler_fn = fn (c_int) callconv(.C) void; |
| 3048 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const c_void) callconv(.C) void; | 3048 | pub const sigaction_fn = fn (c_int, *const siginfo_t, ?*const anyopaque) callconv(.C) void; |
| 3049 | 3049 | ||
| 3050 | handler: extern union { | 3050 | handler: extern union { |
| 3051 | handler: ?handler_fn, | 3051 | handler: ?handler_fn, |
| ... | @@ -3342,7 +3342,7 @@ else | ... | @@ -3342,7 +3342,7 @@ else |
| 3342 | 3342 | ||
| 3343 | pub const sigval = extern union { | 3343 | pub const sigval = extern union { |
| 3344 | int: i32, | 3344 | int: i32, |
| 3345 | ptr: *c_void, | 3345 | ptr: *anyopaque, |
| 3346 | }; | 3346 | }; |
| 3347 | 3347 | ||
| 3348 | const siginfo_fields_union = extern union { | 3348 | const siginfo_fields_union = extern union { |
| ... | @@ -3368,12 +3368,12 @@ const siginfo_fields_union = extern union { | ... | @@ -3368,12 +3368,12 @@ const siginfo_fields_union = extern union { |
| 3368 | }, | 3368 | }, |
| 3369 | }, | 3369 | }, |
| 3370 | sigfault: extern struct { | 3370 | sigfault: extern struct { |
| 3371 | addr: *c_void, | 3371 | addr: *anyopaque, |
| 3372 | addr_lsb: i16, | 3372 | addr_lsb: i16, |
| 3373 | first: extern union { | 3373 | first: extern union { |
| 3374 | addr_bnd: extern struct { | 3374 | addr_bnd: extern struct { |
| 3375 | lower: *c_void, | 3375 | lower: *anyopaque, |
| 3376 | upper: *c_void, | 3376 | upper: *anyopaque, |
| 3377 | }, | 3377 | }, |
| 3378 | pkey: u32, | 3378 | pkey: u32, |
| 3379 | }, | 3379 | }, |
| ... | @@ -3383,7 +3383,7 @@ const siginfo_fields_union = extern union { | ... | @@ -3383,7 +3383,7 @@ const siginfo_fields_union = extern union { |
| 3383 | fd: i32, | 3383 | fd: i32, |
| 3384 | }, | 3384 | }, |
| 3385 | sigsys: extern struct { | 3385 | sigsys: extern struct { |
| 3386 | call_addr: *c_void, | 3386 | call_addr: *anyopaque, |
| 3387 | syscall: i32, | 3387 | syscall: i32, |
| 3388 | native_arch: u32, | 3388 | native_arch: u32, |
| 3389 | }, | 3389 | }, |
lib/std/os/linux/arm-eabi.zig+2-2| ... | @@ -652,7 +652,7 @@ pub const msghdr = extern struct { | ... | @@ -652,7 +652,7 @@ pub const msghdr = extern struct { |
| 652 | msg_namelen: socklen_t, | 652 | msg_namelen: socklen_t, |
| 653 | msg_iov: [*]iovec, | 653 | msg_iov: [*]iovec, |
| 654 | msg_iovlen: i32, | 654 | msg_iovlen: i32, |
| 655 | msg_control: ?*c_void, | 655 | msg_control: ?*anyopaque, |
| 656 | msg_controllen: socklen_t, | 656 | msg_controllen: socklen_t, |
| 657 | msg_flags: i32, | 657 | msg_flags: i32, |
| 658 | }; | 658 | }; |
| ... | @@ -662,7 +662,7 @@ pub const msghdr_const = extern struct { | ... | @@ -662,7 +662,7 @@ pub const msghdr_const = extern struct { |
| 662 | msg_namelen: socklen_t, | 662 | msg_namelen: socklen_t, |
| 663 | msg_iov: [*]iovec_const, | 663 | msg_iov: [*]iovec_const, |
| 664 | msg_iovlen: i32, | 664 | msg_iovlen: i32, |
| 665 | msg_control: ?*c_void, | 665 | msg_control: ?*anyopaque, |
| 666 | msg_controllen: socklen_t, | 666 | msg_controllen: socklen_t, |
| 667 | msg_flags: i32, | 667 | msg_flags: i32, |
| 668 | }; | 668 | }; |
lib/std/os/linux/arm64.zig+2-2| ... | @@ -504,7 +504,7 @@ pub const msghdr = extern struct { | ... | @@ -504,7 +504,7 @@ pub const msghdr = extern struct { |
| 504 | msg_iov: [*]iovec, | 504 | msg_iov: [*]iovec, |
| 505 | msg_iovlen: i32, | 505 | msg_iovlen: i32, |
| 506 | __pad1: i32 = 0, | 506 | __pad1: i32 = 0, |
| 507 | msg_control: ?*c_void, | 507 | msg_control: ?*anyopaque, |
| 508 | msg_controllen: socklen_t, | 508 | msg_controllen: socklen_t, |
| 509 | __pad2: socklen_t = 0, | 509 | __pad2: socklen_t = 0, |
| 510 | msg_flags: i32, | 510 | msg_flags: i32, |
| ... | @@ -516,7 +516,7 @@ pub const msghdr_const = extern struct { | ... | @@ -516,7 +516,7 @@ pub const msghdr_const = extern struct { |
| 516 | msg_iov: [*]iovec_const, | 516 | msg_iov: [*]iovec_const, |
| 517 | msg_iovlen: i32, | 517 | msg_iovlen: i32, |
| 518 | __pad1: i32 = 0, | 518 | __pad1: i32 = 0, |
| 519 | msg_control: ?*c_void, | 519 | msg_control: ?*anyopaque, |
| 520 | msg_controllen: socklen_t, | 520 | msg_controllen: socklen_t, |
| 521 | __pad2: socklen_t = 0, | 521 | __pad2: socklen_t = 0, |
| 522 | msg_flags: i32, | 522 | msg_flags: i32, |
lib/std/os/linux/bpf/helpers.zig+63-63| ... | @@ -11,22 +11,22 @@ const SkFullSock = @compileError("TODO missing os bits: SkFullSock"); | ... | @@ -11,22 +11,22 @@ const SkFullSock = @compileError("TODO missing os bits: SkFullSock"); |
| 11 | // | 11 | // |
| 12 | // Note, these function signatures were created from documentation found in | 12 | // Note, these function signatures were created from documentation found in |
| 13 | // '/usr/include/linux/bpf.h' | 13 | // '/usr/include/linux/bpf.h' |
| 14 | pub const map_lookup_elem = @intToPtr(fn (map: *const kern.MapDef, key: ?*const c_void) ?*c_void, 1); | 14 | pub const map_lookup_elem = @intToPtr(fn (map: *const kern.MapDef, key: ?*const anyopaque) ?*anyopaque, 1); |
| 15 | pub const map_update_elem = @intToPtr(fn (map: *const kern.MapDef, key: ?*const c_void, value: ?*const c_void, flags: u64) c_long, 2); | 15 | pub const map_update_elem = @intToPtr(fn (map: *const kern.MapDef, key: ?*const anyopaque, value: ?*const anyopaque, flags: u64) c_long, 2); |
| 16 | pub const map_delete_elem = @intToPtr(fn (map: *const kern.MapDef, key: ?*const c_void) c_long, 3); | 16 | pub const map_delete_elem = @intToPtr(fn (map: *const kern.MapDef, key: ?*const anyopaque) c_long, 3); |
| 17 | pub const probe_read = @intToPtr(fn (dst: ?*c_void, size: u32, unsafe_ptr: ?*const c_void) c_long, 4); | 17 | pub const probe_read = @intToPtr(fn (dst: ?*anyopaque, size: u32, unsafe_ptr: ?*const anyopaque) c_long, 4); |
| 18 | pub const ktime_get_ns = @intToPtr(fn () u64, 5); | 18 | pub const ktime_get_ns = @intToPtr(fn () u64, 5); |
| 19 | pub const trace_printk = @intToPtr(fn (fmt: [*:0]const u8, fmt_size: u32, arg1: u64, arg2: u64, arg3: u64) c_long, 6); | 19 | pub const trace_printk = @intToPtr(fn (fmt: [*:0]const u8, fmt_size: u32, arg1: u64, arg2: u64, arg3: u64) c_long, 6); |
| 20 | pub const get_prandom_u32 = @intToPtr(fn () u32, 7); | 20 | pub const get_prandom_u32 = @intToPtr(fn () u32, 7); |
| 21 | pub const get_smp_processor_id = @intToPtr(fn () u32, 8); | 21 | pub const get_smp_processor_id = @intToPtr(fn () u32, 8); |
| 22 | pub const skb_store_bytes = @intToPtr(fn (skb: *kern.SkBuff, offset: u32, from: ?*const c_void, len: u32, flags: u64) c_long, 9); | 22 | pub const skb_store_bytes = @intToPtr(fn (skb: *kern.SkBuff, offset: u32, from: ?*const anyopaque, len: u32, flags: u64) c_long, 9); |
| 23 | pub const l3_csum_replace = @intToPtr(fn (skb: *kern.SkBuff, offset: u32, from: u64, to: u64, size: u64) c_long, 10); | 23 | pub const l3_csum_replace = @intToPtr(fn (skb: *kern.SkBuff, offset: u32, from: u64, to: u64, size: u64) c_long, 10); |
| 24 | pub const l4_csum_replace = @intToPtr(fn (skb: *kern.SkBuff, offset: u32, from: u64, to: u64, flags: u64) c_long, 11); | 24 | pub const l4_csum_replace = @intToPtr(fn (skb: *kern.SkBuff, offset: u32, from: u64, to: u64, flags: u64) c_long, 11); |
| 25 | pub const tail_call = @intToPtr(fn (ctx: ?*c_void, prog_array_map: *const kern.MapDef, index: u32) c_long, 12); | 25 | pub const tail_call = @intToPtr(fn (ctx: ?*anyopaque, prog_array_map: *const kern.MapDef, index: u32) c_long, 12); |
| 26 | pub const clone_redirect = @intToPtr(fn (skb: *kern.SkBuff, ifindex: u32, flags: u64) c_long, 13); | 26 | pub const clone_redirect = @intToPtr(fn (skb: *kern.SkBuff, ifindex: u32, flags: u64) c_long, 13); |
| 27 | pub const get_current_pid_tgid = @intToPtr(fn () u64, 14); | 27 | pub const get_current_pid_tgid = @intToPtr(fn () u64, 14); |
| 28 | pub const get_current_uid_gid = @intToPtr(fn () u64, 15); | 28 | pub const get_current_uid_gid = @intToPtr(fn () u64, 15); |
| 29 | pub const get_current_comm = @intToPtr(fn (buf: ?*c_void, size_of_buf: u32) c_long, 16); | 29 | pub const get_current_comm = @intToPtr(fn (buf: ?*anyopaque, size_of_buf: u32) c_long, 16); |
| 30 | pub const get_cgroup_classid = @intToPtr(fn (skb: *kern.SkBuff) u32, 17); | 30 | pub const get_cgroup_classid = @intToPtr(fn (skb: *kern.SkBuff) u32, 17); |
| 31 | // Note vlan_proto is big endian | 31 | // Note vlan_proto is big endian |
| 32 | pub const skb_vlan_push = @intToPtr(fn (skb: *kern.SkBuff, vlan_proto: u16, vlan_tci: u16) c_long, 18); | 32 | pub const skb_vlan_push = @intToPtr(fn (skb: *kern.SkBuff, vlan_proto: u16, vlan_tci: u16) c_long, 18); |
| ... | @@ -36,20 +36,20 @@ pub const skb_set_tunnel_key = @intToPtr(fn (skb: *kern.SkBuff, key: *kern.Tunne | ... | @@ -36,20 +36,20 @@ pub const skb_set_tunnel_key = @intToPtr(fn (skb: *kern.SkBuff, key: *kern.Tunne |
| 36 | pub const perf_event_read = @intToPtr(fn (map: *const kern.MapDef, flags: u64) u64, 22); | 36 | pub const perf_event_read = @intToPtr(fn (map: *const kern.MapDef, flags: u64) u64, 22); |
| 37 | pub const redirect = @intToPtr(fn (ifindex: u32, flags: u64) c_long, 23); | 37 | pub const redirect = @intToPtr(fn (ifindex: u32, flags: u64) c_long, 23); |
| 38 | pub const get_route_realm = @intToPtr(fn (skb: *kern.SkBuff) u32, 24); | 38 | pub const get_route_realm = @intToPtr(fn (skb: *kern.SkBuff) u32, 24); |
| 39 | pub const perf_event_output = @intToPtr(fn (ctx: ?*c_void, map: *const kern.MapDef, flags: u64, data: ?*c_void, size: u64) c_long, 25); | 39 | pub const perf_event_output = @intToPtr(fn (ctx: ?*anyopaque, map: *const kern.MapDef, flags: u64, data: ?*anyopaque, size: u64) c_long, 25); |
| 40 | pub const skb_load_bytes = @intToPtr(fn (skb: ?*c_void, offset: u32, to: ?*c_void, len: u32) c_long, 26); | 40 | pub const skb_load_bytes = @intToPtr(fn (skb: ?*anyopaque, offset: u32, to: ?*anyopaque, len: u32) c_long, 26); |
| 41 | pub const get_stackid = @intToPtr(fn (ctx: ?*c_void, map: *const kern.MapDef, flags: u64) c_long, 27); | 41 | pub const get_stackid = @intToPtr(fn (ctx: ?*anyopaque, map: *const kern.MapDef, flags: u64) c_long, 27); |
| 42 | // from and to point to __be32 | 42 | // from and to point to __be32 |
| 43 | pub const csum_diff = @intToPtr(fn (from: *u32, from_size: u32, to: *u32, to_size: u32, seed: u32) i64, 28); | 43 | pub const csum_diff = @intToPtr(fn (from: *u32, from_size: u32, to: *u32, to_size: u32, seed: u32) i64, 28); |
| 44 | pub const skb_get_tunnel_opt = @intToPtr(fn (skb: *kern.SkBuff, opt: ?*c_void, size: u32) c_long, 29); | 44 | pub const skb_get_tunnel_opt = @intToPtr(fn (skb: *kern.SkBuff, opt: ?*anyopaque, size: u32) c_long, 29); |
| 45 | pub const skb_set_tunnel_opt = @intToPtr(fn (skb: *kern.SkBuff, opt: ?*c_void, size: u32) c_long, 30); | 45 | pub const skb_set_tunnel_opt = @intToPtr(fn (skb: *kern.SkBuff, opt: ?*anyopaque, size: u32) c_long, 30); |
| 46 | // proto is __be16 | 46 | // proto is __be16 |
| 47 | pub const skb_change_proto = @intToPtr(fn (skb: *kern.SkBuff, proto: u16, flags: u64) c_long, 31); | 47 | pub const skb_change_proto = @intToPtr(fn (skb: *kern.SkBuff, proto: u16, flags: u64) c_long, 31); |
| 48 | pub const skb_change_type = @intToPtr(fn (skb: *kern.SkBuff, skb_type: u32) c_long, 32); | 48 | pub const skb_change_type = @intToPtr(fn (skb: *kern.SkBuff, skb_type: u32) c_long, 32); |
| 49 | pub const skb_under_cgroup = @intToPtr(fn (skb: *kern.SkBuff, map: ?*const c_void, index: u32) c_long, 33); | 49 | pub const skb_under_cgroup = @intToPtr(fn (skb: *kern.SkBuff, map: ?*const anyopaque, index: u32) c_long, 33); |
| 50 | pub const get_hash_recalc = @intToPtr(fn (skb: *kern.SkBuff) u32, 34); | 50 | pub const get_hash_recalc = @intToPtr(fn (skb: *kern.SkBuff) u32, 34); |
| 51 | pub const get_current_task = @intToPtr(fn () u64, 35); | 51 | pub const get_current_task = @intToPtr(fn () u64, 35); |
| 52 | pub const probe_write_user = @intToPtr(fn (dst: ?*c_void, src: ?*const c_void, len: u32) c_long, 36); | 52 | pub const probe_write_user = @intToPtr(fn (dst: ?*anyopaque, src: ?*const anyopaque, len: u32) c_long, 36); |
| 53 | pub const current_task_under_cgroup = @intToPtr(fn (map: *const kern.MapDef, index: u32) c_long, 37); | 53 | pub const current_task_under_cgroup = @intToPtr(fn (map: *const kern.MapDef, index: u32) c_long, 37); |
| 54 | pub const skb_change_tail = @intToPtr(fn (skb: *kern.SkBuff, len: u32, flags: u64) c_long, 38); | 54 | pub const skb_change_tail = @intToPtr(fn (skb: *kern.SkBuff, len: u32, flags: u64) c_long, 38); |
| 55 | pub const skb_pull_data = @intToPtr(fn (skb: *kern.SkBuff, len: u32) c_long, 39); | 55 | pub const skb_pull_data = @intToPtr(fn (skb: *kern.SkBuff, len: u32) c_long, 39); |
| ... | @@ -58,19 +58,19 @@ pub const set_hash_invalid = @intToPtr(fn (skb: *kern.SkBuff) void, 41); | ... | @@ -58,19 +58,19 @@ pub const set_hash_invalid = @intToPtr(fn (skb: *kern.SkBuff) void, 41); |
| 58 | pub const get_numa_node_id = @intToPtr(fn () c_long, 42); | 58 | pub const get_numa_node_id = @intToPtr(fn () c_long, 42); |
| 59 | pub const skb_change_head = @intToPtr(fn (skb: *kern.SkBuff, len: u32, flags: u64) c_long, 43); | 59 | pub const skb_change_head = @intToPtr(fn (skb: *kern.SkBuff, len: u32, flags: u64) c_long, 43); |
| 60 | pub const xdp_adjust_head = @intToPtr(fn (xdp_md: *kern.XdpMd, delta: c_int) c_long, 44); | 60 | pub const xdp_adjust_head = @intToPtr(fn (xdp_md: *kern.XdpMd, delta: c_int) c_long, 44); |
| 61 | pub const probe_read_str = @intToPtr(fn (dst: ?*c_void, size: u32, unsafe_ptr: ?*const c_void) c_long, 45); | 61 | pub const probe_read_str = @intToPtr(fn (dst: ?*anyopaque, size: u32, unsafe_ptr: ?*const anyopaque) c_long, 45); |
| 62 | pub const get_socket_cookie = @intToPtr(fn (ctx: ?*c_void) u64, 46); | 62 | pub const get_socket_cookie = @intToPtr(fn (ctx: ?*anyopaque) u64, 46); |
| 63 | pub const get_socket_uid = @intToPtr(fn (skb: *kern.SkBuff) u32, 47); | 63 | pub const get_socket_uid = @intToPtr(fn (skb: *kern.SkBuff) u32, 47); |
| 64 | pub const set_hash = @intToPtr(fn (skb: *kern.SkBuff, hash: u32) c_long, 48); | 64 | pub const set_hash = @intToPtr(fn (skb: *kern.SkBuff, hash: u32) c_long, 48); |
| 65 | pub const setsockopt = @intToPtr(fn (bpf_socket: *kern.SockOps, level: c_int, optname: c_int, optval: ?*c_void, optlen: c_int) c_long, 49); | 65 | pub const setsockopt = @intToPtr(fn (bpf_socket: *kern.SockOps, level: c_int, optname: c_int, optval: ?*anyopaque, optlen: c_int) c_long, 49); |
| 66 | pub const skb_adjust_room = @intToPtr(fn (skb: *kern.SkBuff, len_diff: i32, mode: u32, flags: u64) c_long, 50); | 66 | pub const skb_adjust_room = @intToPtr(fn (skb: *kern.SkBuff, len_diff: i32, mode: u32, flags: u64) c_long, 50); |
| 67 | pub const redirect_map = @intToPtr(fn (map: *const kern.MapDef, key: u32, flags: u64) c_long, 51); | 67 | pub const redirect_map = @intToPtr(fn (map: *const kern.MapDef, key: u32, flags: u64) c_long, 51); |
| 68 | pub const sk_redirect_map = @intToPtr(fn (skb: *kern.SkBuff, map: *const kern.MapDef, key: u32, flags: u64) c_long, 52); | 68 | pub const sk_redirect_map = @intToPtr(fn (skb: *kern.SkBuff, map: *const kern.MapDef, key: u32, flags: u64) c_long, 52); |
| 69 | pub const sock_map_update = @intToPtr(fn (skops: *kern.SockOps, map: *const kern.MapDef, key: ?*c_void, flags: u64) c_long, 53); | 69 | pub const sock_map_update = @intToPtr(fn (skops: *kern.SockOps, map: *const kern.MapDef, key: ?*anyopaque, flags: u64) c_long, 53); |
| 70 | pub const xdp_adjust_meta = @intToPtr(fn (xdp_md: *kern.XdpMd, delta: c_int) c_long, 54); | 70 | pub const xdp_adjust_meta = @intToPtr(fn (xdp_md: *kern.XdpMd, delta: c_int) c_long, 54); |
| 71 | pub const perf_event_read_value = @intToPtr(fn (map: *const kern.MapDef, flags: u64, buf: *kern.PerfEventValue, buf_size: u32) c_long, 55); | 71 | pub const perf_event_read_value = @intToPtr(fn (map: *const kern.MapDef, flags: u64, buf: *kern.PerfEventValue, buf_size: u32) c_long, 55); |
| 72 | pub const perf_prog_read_value = @intToPtr(fn (ctx: *kern.PerfEventData, buf: *kern.PerfEventValue, buf_size: u32) c_long, 56); | 72 | pub const perf_prog_read_value = @intToPtr(fn (ctx: *kern.PerfEventData, buf: *kern.PerfEventValue, buf_size: u32) c_long, 56); |
| 73 | pub const getsockopt = @intToPtr(fn (bpf_socket: ?*c_void, level: c_int, optname: c_int, optval: ?*c_void, optlen: c_int) c_long, 57); | 73 | pub const getsockopt = @intToPtr(fn (bpf_socket: ?*anyopaque, level: c_int, optname: c_int, optval: ?*anyopaque, optlen: c_int) c_long, 57); |
| 74 | pub const override_return = @intToPtr(fn (regs: *PtRegs, rc: u64) c_long, 58); | 74 | pub const override_return = @intToPtr(fn (regs: *PtRegs, rc: u64) c_long, 58); |
| 75 | pub const sock_ops_cb_flags_set = @intToPtr(fn (bpf_sock: *kern.SockOps, argval: c_int) c_long, 59); | 75 | pub const sock_ops_cb_flags_set = @intToPtr(fn (bpf_sock: *kern.SockOps, argval: c_int) c_long, 59); |
| 76 | pub const msg_redirect_map = @intToPtr(fn (msg: *kern.SkMsgMd, map: *const kern.MapDef, key: u32, flags: u64) c_long, 60); | 76 | pub const msg_redirect_map = @intToPtr(fn (msg: *kern.SkMsgMd, map: *const kern.MapDef, key: u32, flags: u64) c_long, 60); |
| ... | @@ -80,78 +80,78 @@ pub const msg_pull_data = @intToPtr(fn (msg: *kern.SkMsgMd, start: u32, end: u32 | ... | @@ -80,78 +80,78 @@ pub const msg_pull_data = @intToPtr(fn (msg: *kern.SkMsgMd, start: u32, end: u32 |
| 80 | pub const bind = @intToPtr(fn (ctx: *kern.BpfSockAddr, addr: *kern.SockAddr, addr_len: c_int) c_long, 64); | 80 | pub const bind = @intToPtr(fn (ctx: *kern.BpfSockAddr, addr: *kern.SockAddr, addr_len: c_int) c_long, 64); |
| 81 | pub const xdp_adjust_tail = @intToPtr(fn (xdp_md: *kern.XdpMd, delta: c_int) c_long, 65); | 81 | pub const xdp_adjust_tail = @intToPtr(fn (xdp_md: *kern.XdpMd, delta: c_int) c_long, 65); |
| 82 | pub const skb_get_xfrm_state = @intToPtr(fn (skb: *kern.SkBuff, index: u32, xfrm_state: *kern.XfrmState, size: u32, flags: u64) c_long, 66); | 82 | pub const skb_get_xfrm_state = @intToPtr(fn (skb: *kern.SkBuff, index: u32, xfrm_state: *kern.XfrmState, size: u32, flags: u64) c_long, 66); |
| 83 | pub const get_stack = @intToPtr(fn (ctx: ?*c_void, buf: ?*c_void, size: u32, flags: u64) c_long, 67); | 83 | pub const get_stack = @intToPtr(fn (ctx: ?*anyopaque, buf: ?*anyopaque, size: u32, flags: u64) c_long, 67); |
| 84 | pub const skb_load_bytes_relative = @intToPtr(fn (skb: ?*const c_void, offset: u32, to: ?*c_void, len: u32, start_header: u32) c_long, 68); | 84 | pub const skb_load_bytes_relative = @intToPtr(fn (skb: ?*const anyopaque, offset: u32, to: ?*anyopaque, len: u32, start_header: u32) c_long, 68); |
| 85 | pub const fib_lookup = @intToPtr(fn (ctx: ?*c_void, params: *kern.FibLookup, plen: c_int, flags: u32) c_long, 69); | 85 | pub const fib_lookup = @intToPtr(fn (ctx: ?*anyopaque, params: *kern.FibLookup, plen: c_int, flags: u32) c_long, 69); |
| 86 | pub const sock_hash_update = @intToPtr(fn (skops: *kern.SockOps, map: *const kern.MapDef, key: ?*c_void, flags: u64) c_long, 70); | 86 | pub const sock_hash_update = @intToPtr(fn (skops: *kern.SockOps, map: *const kern.MapDef, key: ?*anyopaque, flags: u64) c_long, 70); |
| 87 | pub const msg_redirect_hash = @intToPtr(fn (msg: *kern.SkMsgMd, map: *const kern.MapDef, key: ?*c_void, flags: u64) c_long, 71); | 87 | pub const msg_redirect_hash = @intToPtr(fn (msg: *kern.SkMsgMd, map: *const kern.MapDef, key: ?*anyopaque, flags: u64) c_long, 71); |
| 88 | pub const sk_redirect_hash = @intToPtr(fn (skb: *kern.SkBuff, map: *const kern.MapDef, key: ?*c_void, flags: u64) c_long, 72); | 88 | pub const sk_redirect_hash = @intToPtr(fn (skb: *kern.SkBuff, map: *const kern.MapDef, key: ?*anyopaque, flags: u64) c_long, 72); |
| 89 | pub const lwt_push_encap = @intToPtr(fn (skb: *kern.SkBuff, typ: u32, hdr: ?*c_void, len: u32) c_long, 73); | 89 | pub const lwt_push_encap = @intToPtr(fn (skb: *kern.SkBuff, typ: u32, hdr: ?*anyopaque, len: u32) c_long, 73); |
| 90 | pub const lwt_seg6_store_bytes = @intToPtr(fn (skb: *kern.SkBuff, offset: u32, from: ?*const c_void, len: u32) c_long, 74); | 90 | pub const lwt_seg6_store_bytes = @intToPtr(fn (skb: *kern.SkBuff, offset: u32, from: ?*const anyopaque, len: u32) c_long, 74); |
| 91 | pub const lwt_seg6_adjust_srh = @intToPtr(fn (skb: *kern.SkBuff, offset: u32, delta: i32) c_long, 75); | 91 | pub const lwt_seg6_adjust_srh = @intToPtr(fn (skb: *kern.SkBuff, offset: u32, delta: i32) c_long, 75); |
| 92 | pub const lwt_seg6_action = @intToPtr(fn (skb: *kern.SkBuff, action: u32, param: ?*c_void, param_len: u32) c_long, 76); | 92 | pub const lwt_seg6_action = @intToPtr(fn (skb: *kern.SkBuff, action: u32, param: ?*anyopaque, param_len: u32) c_long, 76); |
| 93 | pub const rc_repeat = @intToPtr(fn (ctx: ?*c_void) c_long, 77); | 93 | pub const rc_repeat = @intToPtr(fn (ctx: ?*anyopaque) c_long, 77); |
| 94 | pub const rc_keydown = @intToPtr(fn (ctx: ?*c_void, protocol: u32, scancode: u64, toggle: u32) c_long, 78); | 94 | pub const rc_keydown = @intToPtr(fn (ctx: ?*anyopaque, protocol: u32, scancode: u64, toggle: u32) c_long, 78); |
| 95 | pub const skb_cgroup_id = @intToPtr(fn (skb: *kern.SkBuff) u64, 79); | 95 | pub const skb_cgroup_id = @intToPtr(fn (skb: *kern.SkBuff) u64, 79); |
| 96 | pub const get_current_cgroup_id = @intToPtr(fn () u64, 80); | 96 | pub const get_current_cgroup_id = @intToPtr(fn () u64, 80); |
| 97 | pub const get_local_storage = @intToPtr(fn (map: ?*c_void, flags: u64) ?*c_void, 81); | 97 | pub const get_local_storage = @intToPtr(fn (map: ?*anyopaque, flags: u64) ?*anyopaque, 81); |
| 98 | pub const sk_select_reuseport = @intToPtr(fn (reuse: *kern.SkReusePortMd, map: *const kern.MapDef, key: ?*c_void, flags: u64) c_long, 82); | 98 | pub const sk_select_reuseport = @intToPtr(fn (reuse: *kern.SkReusePortMd, map: *const kern.MapDef, key: ?*anyopaque, flags: u64) c_long, 82); |
| 99 | pub const skb_ancestor_cgroup_id = @intToPtr(fn (skb: *kern.SkBuff, ancestor_level: c_int) u64, 83); | 99 | pub const skb_ancestor_cgroup_id = @intToPtr(fn (skb: *kern.SkBuff, ancestor_level: c_int) u64, 83); |
| 100 | pub const sk_lookup_tcp = @intToPtr(fn (ctx: ?*c_void, tuple: *kern.SockTuple, tuple_size: u32, netns: u64, flags: u64) ?*kern.Sock, 84); | 100 | pub const sk_lookup_tcp = @intToPtr(fn (ctx: ?*anyopaque, tuple: *kern.SockTuple, tuple_size: u32, netns: u64, flags: u64) ?*kern.Sock, 84); |
| 101 | pub const sk_lookup_udp = @intToPtr(fn (ctx: ?*c_void, tuple: *kern.SockTuple, tuple_size: u32, netns: u64, flags: u64) ?*kern.Sock, 85); | 101 | pub const sk_lookup_udp = @intToPtr(fn (ctx: ?*anyopaque, tuple: *kern.SockTuple, tuple_size: u32, netns: u64, flags: u64) ?*kern.Sock, 85); |
| 102 | pub const sk_release = @intToPtr(fn (sock: *kern.Sock) c_long, 86); | 102 | pub const sk_release = @intToPtr(fn (sock: *kern.Sock) c_long, 86); |
| 103 | pub const map_push_elem = @intToPtr(fn (map: *const kern.MapDef, value: ?*const c_void, flags: u64) c_long, 87); | 103 | pub const map_push_elem = @intToPtr(fn (map: *const kern.MapDef, value: ?*const anyopaque, flags: u64) c_long, 87); |
| 104 | pub const map_pop_elem = @intToPtr(fn (map: *const kern.MapDef, value: ?*c_void) c_long, 88); | 104 | pub const map_pop_elem = @intToPtr(fn (map: *const kern.MapDef, value: ?*anyopaque) c_long, 88); |
| 105 | pub const map_peek_elem = @intToPtr(fn (map: *const kern.MapDef, value: ?*c_void) c_long, 89); | 105 | pub const map_peek_elem = @intToPtr(fn (map: *const kern.MapDef, value: ?*anyopaque) c_long, 89); |
| 106 | pub const msg_push_data = @intToPtr(fn (msg: *kern.SkMsgMd, start: u32, len: u32, flags: u64) c_long, 90); | 106 | pub const msg_push_data = @intToPtr(fn (msg: *kern.SkMsgMd, start: u32, len: u32, flags: u64) c_long, 90); |
| 107 | pub const msg_pop_data = @intToPtr(fn (msg: *kern.SkMsgMd, start: u32, len: u32, flags: u64) c_long, 91); | 107 | pub const msg_pop_data = @intToPtr(fn (msg: *kern.SkMsgMd, start: u32, len: u32, flags: u64) c_long, 91); |
| 108 | pub const rc_pointer_rel = @intToPtr(fn (ctx: ?*c_void, rel_x: i32, rel_y: i32) c_long, 92); | 108 | pub const rc_pointer_rel = @intToPtr(fn (ctx: ?*anyopaque, rel_x: i32, rel_y: i32) c_long, 92); |
| 109 | pub const spin_lock = @intToPtr(fn (lock: *kern.SpinLock) c_long, 93); | 109 | pub const spin_lock = @intToPtr(fn (lock: *kern.SpinLock) c_long, 93); |
| 110 | pub const spin_unlock = @intToPtr(fn (lock: *kern.SpinLock) c_long, 94); | 110 | pub const spin_unlock = @intToPtr(fn (lock: *kern.SpinLock) c_long, 94); |
| 111 | pub const sk_fullsock = @intToPtr(fn (sk: *kern.Sock) ?*SkFullSock, 95); | 111 | pub const sk_fullsock = @intToPtr(fn (sk: *kern.Sock) ?*SkFullSock, 95); |
| 112 | pub const tcp_sock = @intToPtr(fn (sk: *kern.Sock) ?*kern.TcpSock, 96); | 112 | pub const tcp_sock = @intToPtr(fn (sk: *kern.Sock) ?*kern.TcpSock, 96); |
| 113 | pub const skb_ecn_set_ce = @intToPtr(fn (skb: *kern.SkBuff) c_long, 97); | 113 | pub const skb_ecn_set_ce = @intToPtr(fn (skb: *kern.SkBuff) c_long, 97); |
| 114 | pub const get_listener_sock = @intToPtr(fn (sk: *kern.Sock) ?*kern.Sock, 98); | 114 | pub const get_listener_sock = @intToPtr(fn (sk: *kern.Sock) ?*kern.Sock, 98); |
| 115 | pub const skc_lookup_tcp = @intToPtr(fn (ctx: ?*c_void, tuple: *kern.SockTuple, tuple_size: u32, netns: u64, flags: u64) ?*kern.Sock, 99); | 115 | pub const skc_lookup_tcp = @intToPtr(fn (ctx: ?*anyopaque, tuple: *kern.SockTuple, tuple_size: u32, netns: u64, flags: u64) ?*kern.Sock, 99); |
| 116 | pub const tcp_check_syncookie = @intToPtr(fn (sk: *kern.Sock, iph: ?*c_void, iph_len: u32, th: *TcpHdr, th_len: u32) c_long, 100); | 116 | pub const tcp_check_syncookie = @intToPtr(fn (sk: *kern.Sock, iph: ?*anyopaque, iph_len: u32, th: *TcpHdr, th_len: u32) c_long, 100); |
| 117 | pub const sysctl_get_name = @intToPtr(fn (ctx: *kern.SysCtl, buf: ?*u8, buf_len: c_ulong, flags: u64) c_long, 101); | 117 | pub const sysctl_get_name = @intToPtr(fn (ctx: *kern.SysCtl, buf: ?*u8, buf_len: c_ulong, flags: u64) c_long, 101); |
| 118 | pub const sysctl_get_current_value = @intToPtr(fn (ctx: *kern.SysCtl, buf: ?*u8, buf_len: c_ulong) c_long, 102); | 118 | pub const sysctl_get_current_value = @intToPtr(fn (ctx: *kern.SysCtl, buf: ?*u8, buf_len: c_ulong) c_long, 102); |
| 119 | pub const sysctl_get_new_value = @intToPtr(fn (ctx: *kern.SysCtl, buf: ?*u8, buf_len: c_ulong) c_long, 103); | 119 | pub const sysctl_get_new_value = @intToPtr(fn (ctx: *kern.SysCtl, buf: ?*u8, buf_len: c_ulong) c_long, 103); |
| 120 | pub const sysctl_set_new_value = @intToPtr(fn (ctx: *kern.SysCtl, buf: ?*const u8, buf_len: c_ulong) c_long, 104); | 120 | pub const sysctl_set_new_value = @intToPtr(fn (ctx: *kern.SysCtl, buf: ?*const u8, buf_len: c_ulong) c_long, 104); |
| 121 | pub const strtol = @intToPtr(fn (buf: *const u8, buf_len: c_ulong, flags: u64, res: *c_long) c_long, 105); | 121 | pub const strtol = @intToPtr(fn (buf: *const u8, buf_len: c_ulong, flags: u64, res: *c_long) c_long, 105); |
| 122 | pub const strtoul = @intToPtr(fn (buf: *const u8, buf_len: c_ulong, flags: u64, res: *c_ulong) c_long, 106); | 122 | pub const strtoul = @intToPtr(fn (buf: *const u8, buf_len: c_ulong, flags: u64, res: *c_ulong) c_long, 106); |
| 123 | pub const sk_storage_get = @intToPtr(fn (map: *const kern.MapDef, sk: *kern.Sock, value: ?*c_void, flags: u64) ?*c_void, 107); | 123 | pub const sk_storage_get = @intToPtr(fn (map: *const kern.MapDef, sk: *kern.Sock, value: ?*anyopaque, flags: u64) ?*anyopaque, 107); |
| 124 | pub const sk_storage_delete = @intToPtr(fn (map: *const kern.MapDef, sk: *kern.Sock) c_long, 108); | 124 | pub const sk_storage_delete = @intToPtr(fn (map: *const kern.MapDef, sk: *kern.Sock) c_long, 108); |
| 125 | pub const send_signal = @intToPtr(fn (sig: u32) c_long, 109); | 125 | pub const send_signal = @intToPtr(fn (sig: u32) c_long, 109); |
| 126 | pub const tcp_gen_syncookie = @intToPtr(fn (sk: *kern.Sock, iph: ?*c_void, iph_len: u32, th: *TcpHdr, th_len: u32) i64, 110); | 126 | pub const tcp_gen_syncookie = @intToPtr(fn (sk: *kern.Sock, iph: ?*anyopaque, iph_len: u32, th: *TcpHdr, th_len: u32) i64, 110); |
| 127 | pub const skb_output = @intToPtr(fn (ctx: ?*c_void, map: *const kern.MapDef, flags: u64, data: ?*c_void, size: u64) c_long, 111); | 127 | pub const skb_output = @intToPtr(fn (ctx: ?*anyopaque, map: *const kern.MapDef, flags: u64, data: ?*anyopaque, size: u64) c_long, 111); |
| 128 | pub const probe_read_user = @intToPtr(fn (dst: ?*c_void, size: u32, unsafe_ptr: ?*const c_void) c_long, 112); | 128 | pub const probe_read_user = @intToPtr(fn (dst: ?*anyopaque, size: u32, unsafe_ptr: ?*const anyopaque) c_long, 112); |
| 129 | pub const probe_read_kernel = @intToPtr(fn (dst: ?*c_void, size: u32, unsafe_ptr: ?*const c_void) c_long, 113); | 129 | pub const probe_read_kernel = @intToPtr(fn (dst: ?*anyopaque, size: u32, unsafe_ptr: ?*const anyopaque) c_long, 113); |
| 130 | pub const probe_read_user_str = @intToPtr(fn (dst: ?*c_void, size: u32, unsafe_ptr: ?*const c_void) c_long, 114); | 130 | pub const probe_read_user_str = @intToPtr(fn (dst: ?*anyopaque, size: u32, unsafe_ptr: ?*const anyopaque) c_long, 114); |
| 131 | pub const probe_read_kernel_str = @intToPtr(fn (dst: ?*c_void, size: u32, unsafe_ptr: ?*const c_void) c_long, 115); | 131 | pub const probe_read_kernel_str = @intToPtr(fn (dst: ?*anyopaque, size: u32, unsafe_ptr: ?*const anyopaque) c_long, 115); |
| 132 | pub const tcp_send_ack = @intToPtr(fn (tp: ?*c_void, rcv_nxt: u32) c_long, 116); | 132 | pub const tcp_send_ack = @intToPtr(fn (tp: ?*anyopaque, rcv_nxt: u32) c_long, 116); |
| 133 | pub const send_signal_thread = @intToPtr(fn (sig: u32) c_long, 117); | 133 | pub const send_signal_thread = @intToPtr(fn (sig: u32) c_long, 117); |
| 134 | pub const jiffies64 = @intToPtr(fn () u64, 118); | 134 | pub const jiffies64 = @intToPtr(fn () u64, 118); |
| 135 | pub const read_branch_records = @intToPtr(fn (ctx: *kern.PerfEventData, buf: ?*c_void, size: u32, flags: u64) c_long, 119); | 135 | pub const read_branch_records = @intToPtr(fn (ctx: *kern.PerfEventData, buf: ?*anyopaque, size: u32, flags: u64) c_long, 119); |
| 136 | pub const get_ns_current_pid_tgid = @intToPtr(fn (dev: u64, ino: u64, nsdata: *kern.PidNsInfo, size: u32) c_long, 120); | 136 | pub const get_ns_current_pid_tgid = @intToPtr(fn (dev: u64, ino: u64, nsdata: *kern.PidNsInfo, size: u32) c_long, 120); |
| 137 | pub const xdp_output = @intToPtr(fn (ctx: ?*c_void, map: *const kern.MapDef, flags: u64, data: ?*c_void, size: u64) c_long, 121); | 137 | pub const xdp_output = @intToPtr(fn (ctx: ?*anyopaque, map: *const kern.MapDef, flags: u64, data: ?*anyopaque, size: u64) c_long, 121); |
| 138 | pub const get_netns_cookie = @intToPtr(fn (ctx: ?*c_void) u64, 122); | 138 | pub const get_netns_cookie = @intToPtr(fn (ctx: ?*anyopaque) u64, 122); |
| 139 | pub const get_current_ancestor_cgroup_id = @intToPtr(fn (ancestor_level: c_int) u64, 123); | 139 | pub const get_current_ancestor_cgroup_id = @intToPtr(fn (ancestor_level: c_int) u64, 123); |
| 140 | pub const sk_assign = @intToPtr(fn (skb: *kern.SkBuff, sk: *kern.Sock, flags: u64) c_long, 124); | 140 | pub const sk_assign = @intToPtr(fn (skb: *kern.SkBuff, sk: *kern.Sock, flags: u64) c_long, 124); |
| 141 | pub const ktime_get_boot_ns = @intToPtr(fn () u64, 125); | 141 | pub const ktime_get_boot_ns = @intToPtr(fn () u64, 125); |
| 142 | pub const seq_printf = @intToPtr(fn (m: *kern.SeqFile, fmt: ?*const u8, fmt_size: u32, data: ?*const c_void, data_len: u32) c_long, 126); | 142 | pub const seq_printf = @intToPtr(fn (m: *kern.SeqFile, fmt: ?*const u8, fmt_size: u32, data: ?*const anyopaque, data_len: u32) c_long, 126); |
| 143 | pub const seq_write = @intToPtr(fn (m: *kern.SeqFile, data: ?*const u8, len: u32) c_long, 127); | 143 | pub const seq_write = @intToPtr(fn (m: *kern.SeqFile, data: ?*const u8, len: u32) c_long, 127); |
| 144 | pub const sk_cgroup_id = @intToPtr(fn (sk: *kern.BpfSock) u64, 128); | 144 | pub const sk_cgroup_id = @intToPtr(fn (sk: *kern.BpfSock) u64, 128); |
| 145 | pub const sk_ancestor_cgroup_id = @intToPtr(fn (sk: *kern.BpfSock, ancestor_level: c_long) u64, 129); | 145 | pub const sk_ancestor_cgroup_id = @intToPtr(fn (sk: *kern.BpfSock, ancestor_level: c_long) u64, 129); |
| 146 | pub const ringbuf_output = @intToPtr(fn (ringbuf: ?*c_void, data: ?*c_void, size: u64, flags: u64) ?*c_void, 130); | 146 | pub const ringbuf_output = @intToPtr(fn (ringbuf: ?*anyopaque, data: ?*anyopaque, size: u64, flags: u64) ?*anyopaque, 130); |
| 147 | pub const ringbuf_reserve = @intToPtr(fn (ringbuf: ?*c_void, size: u64, flags: u64) ?*c_void, 131); | 147 | pub const ringbuf_reserve = @intToPtr(fn (ringbuf: ?*anyopaque, size: u64, flags: u64) ?*anyopaque, 131); |
| 148 | pub const ringbuf_submit = @intToPtr(fn (data: ?*c_void, flags: u64) void, 132); | 148 | pub const ringbuf_submit = @intToPtr(fn (data: ?*anyopaque, flags: u64) void, 132); |
| 149 | pub const ringbuf_discard = @intToPtr(fn (data: ?*c_void, flags: u64) void, 133); | 149 | pub const ringbuf_discard = @intToPtr(fn (data: ?*anyopaque, flags: u64) void, 133); |
| 150 | pub const ringbuf_query = @intToPtr(fn (ringbuf: ?*c_void, flags: u64) u64, 134); | 150 | pub const ringbuf_query = @intToPtr(fn (ringbuf: ?*anyopaque, flags: u64) u64, 134); |
| 151 | pub const csum_level = @intToPtr(fn (skb: *kern.SkBuff, level: u64) c_long, 135); | 151 | pub const csum_level = @intToPtr(fn (skb: *kern.SkBuff, level: u64) c_long, 135); |
| 152 | pub const skc_to_tcp6_sock = @intToPtr(fn (sk: ?*c_void) ?*kern.Tcp6Sock, 136); | 152 | pub const skc_to_tcp6_sock = @intToPtr(fn (sk: ?*anyopaque) ?*kern.Tcp6Sock, 136); |
| 153 | pub const skc_to_tcp_sock = @intToPtr(fn (sk: ?*c_void) ?*kern.TcpSock, 137); | 153 | pub const skc_to_tcp_sock = @intToPtr(fn (sk: ?*anyopaque) ?*kern.TcpSock, 137); |
| 154 | pub const skc_to_tcp_timewait_sock = @intToPtr(fn (sk: ?*c_void) ?*kern.TcpTimewaitSock, 138); | 154 | pub const skc_to_tcp_timewait_sock = @intToPtr(fn (sk: ?*anyopaque) ?*kern.TcpTimewaitSock, 138); |
| 155 | pub const skc_to_tcp_request_sock = @intToPtr(fn (sk: ?*c_void) ?*kern.TcpRequestSock, 139); | 155 | pub const skc_to_tcp_request_sock = @intToPtr(fn (sk: ?*anyopaque) ?*kern.TcpRequestSock, 139); |
| 156 | pub const skc_to_udp6_sock = @intToPtr(fn (sk: ?*c_void) ?*kern.Udp6Sock, 140); | 156 | pub const skc_to_udp6_sock = @intToPtr(fn (sk: ?*anyopaque) ?*kern.Udp6Sock, 140); |
| 157 | pub const get_task_stack = @intToPtr(fn (task: ?*c_void, buf: ?*c_void, size: u32, flags: u64) c_long, 141); | 157 | pub const get_task_stack = @intToPtr(fn (task: ?*anyopaque, buf: ?*anyopaque, size: u32, flags: u64) c_long, 141); |
lib/std/os/linux/i386.zig+2-2| ... | @@ -660,7 +660,7 @@ pub const msghdr = extern struct { | ... | @@ -660,7 +660,7 @@ pub const msghdr = extern struct { |
| 660 | namelen: socklen_t, | 660 | namelen: socklen_t, |
| 661 | iov: [*]iovec, | 661 | iov: [*]iovec, |
| 662 | iovlen: i32, | 662 | iovlen: i32, |
| 663 | control: ?*c_void, | 663 | control: ?*anyopaque, |
| 664 | controllen: socklen_t, | 664 | controllen: socklen_t, |
| 665 | flags: i32, | 665 | flags: i32, |
| 666 | }; | 666 | }; |
| ... | @@ -670,7 +670,7 @@ pub const msghdr_const = extern struct { | ... | @@ -670,7 +670,7 @@ pub const msghdr_const = extern struct { |
| 670 | namelen: socklen_t, | 670 | namelen: socklen_t, |
| 671 | iov: [*]iovec_const, | 671 | iov: [*]iovec_const, |
| 672 | iovlen: i32, | 672 | iovlen: i32, |
| 673 | control: ?*c_void, | 673 | control: ?*anyopaque, |
| 674 | controllen: socklen_t, | 674 | controllen: socklen_t, |
| 675 | flags: i32, | 675 | flags: i32, |
| 676 | }; | 676 | }; |
lib/std/os/linux/io_uring.zig+5-5| ... | @@ -841,7 +841,7 @@ pub const IO_Uring = struct { | ... | @@ -841,7 +841,7 @@ pub const IO_Uring = struct { |
| 841 | const res = linux.io_uring_register( | 841 | const res = linux.io_uring_register( |
| 842 | self.fd, | 842 | self.fd, |
| 843 | .REGISTER_FILES, | 843 | .REGISTER_FILES, |
| 844 | @ptrCast(*const c_void, fds.ptr), | 844 | @ptrCast(*const anyopaque, fds.ptr), |
| 845 | @intCast(u32, fds.len), | 845 | @intCast(u32, fds.len), |
| 846 | ); | 846 | ); |
| 847 | try handle_registration_result(res); | 847 | try handle_registration_result(res); |
| ... | @@ -872,7 +872,7 @@ pub const IO_Uring = struct { | ... | @@ -872,7 +872,7 @@ pub const IO_Uring = struct { |
| 872 | const res = linux.io_uring_register( | 872 | const res = linux.io_uring_register( |
| 873 | self.fd, | 873 | self.fd, |
| 874 | .REGISTER_FILES_UPDATE, | 874 | .REGISTER_FILES_UPDATE, |
| 875 | @ptrCast(*const c_void, &update), | 875 | @ptrCast(*const anyopaque, &update), |
| 876 | @intCast(u32, fds.len), | 876 | @intCast(u32, fds.len), |
| 877 | ); | 877 | ); |
| 878 | try handle_registration_result(res); | 878 | try handle_registration_result(res); |
| ... | @@ -886,7 +886,7 @@ pub const IO_Uring = struct { | ... | @@ -886,7 +886,7 @@ pub const IO_Uring = struct { |
| 886 | const res = linux.io_uring_register( | 886 | const res = linux.io_uring_register( |
| 887 | self.fd, | 887 | self.fd, |
| 888 | .REGISTER_EVENTFD, | 888 | .REGISTER_EVENTFD, |
| 889 | @ptrCast(*const c_void, &fd), | 889 | @ptrCast(*const anyopaque, &fd), |
| 890 | 1, | 890 | 1, |
| 891 | ); | 891 | ); |
| 892 | try handle_registration_result(res); | 892 | try handle_registration_result(res); |
| ... | @@ -901,7 +901,7 @@ pub const IO_Uring = struct { | ... | @@ -901,7 +901,7 @@ pub const IO_Uring = struct { |
| 901 | const res = linux.io_uring_register( | 901 | const res = linux.io_uring_register( |
| 902 | self.fd, | 902 | self.fd, |
| 903 | .REGISTER_EVENTFD_ASYNC, | 903 | .REGISTER_EVENTFD_ASYNC, |
| 904 | @ptrCast(*const c_void, &fd), | 904 | @ptrCast(*const anyopaque, &fd), |
| 905 | 1, | 905 | 1, |
| 906 | ); | 906 | ); |
| 907 | try handle_registration_result(res); | 907 | try handle_registration_result(res); |
| ... | @@ -1307,7 +1307,7 @@ pub fn io_uring_prep_poll_add( | ... | @@ -1307,7 +1307,7 @@ pub fn io_uring_prep_poll_add( |
| 1307 | fd: os.fd_t, | 1307 | fd: os.fd_t, |
| 1308 | poll_mask: u32, | 1308 | poll_mask: u32, |
| 1309 | ) void { | 1309 | ) void { |
| 1310 | io_uring_prep_rw(.POLL_ADD, sqe, fd, @ptrToInt(@as(?*c_void, null)), 0, 0); | 1310 | io_uring_prep_rw(.POLL_ADD, sqe, fd, @ptrToInt(@as(?*anyopaque, null)), 0, 0); |
| 1311 | sqe.rw_flags = __io_uring_prep_poll_mask(poll_mask); | 1311 | sqe.rw_flags = __io_uring_prep_poll_mask(poll_mask); |
| 1312 | } | 1312 | } |
| 1313 | 1313 |
lib/std/os/linux/powerpc.zig+2-2| ... | @@ -655,7 +655,7 @@ pub const msghdr = extern struct { | ... | @@ -655,7 +655,7 @@ pub const msghdr = extern struct { |
| 655 | msg_namelen: socklen_t, | 655 | msg_namelen: socklen_t, |
| 656 | msg_iov: [*]iovec, | 656 | msg_iov: [*]iovec, |
| 657 | msg_iovlen: usize, | 657 | msg_iovlen: usize, |
| 658 | msg_control: ?*c_void, | 658 | msg_control: ?*anyopaque, |
| 659 | msg_controllen: socklen_t, | 659 | msg_controllen: socklen_t, |
| 660 | msg_flags: i32, | 660 | msg_flags: i32, |
| 661 | }; | 661 | }; |
| ... | @@ -665,7 +665,7 @@ pub const msghdr_const = extern struct { | ... | @@ -665,7 +665,7 @@ pub const msghdr_const = extern struct { |
| 665 | msg_namelen: socklen_t, | 665 | msg_namelen: socklen_t, |
| 666 | msg_iov: [*]iovec_const, | 666 | msg_iov: [*]iovec_const, |
| 667 | msg_iovlen: usize, | 667 | msg_iovlen: usize, |
| 668 | msg_control: ?*c_void, | 668 | msg_control: ?*anyopaque, |
| 669 | msg_controllen: socklen_t, | 669 | msg_controllen: socklen_t, |
| 670 | msg_flags: i32, | 670 | msg_flags: i32, |
| 671 | }; | 671 | }; |
lib/std/os/linux/powerpc64.zig+3-3| ... | @@ -630,7 +630,7 @@ pub const msghdr = extern struct { | ... | @@ -630,7 +630,7 @@ pub const msghdr = extern struct { |
| 630 | msg_namelen: socklen_t, | 630 | msg_namelen: socklen_t, |
| 631 | msg_iov: [*]iovec, | 631 | msg_iov: [*]iovec, |
| 632 | msg_iovlen: usize, | 632 | msg_iovlen: usize, |
| 633 | msg_control: ?*c_void, | 633 | msg_control: ?*anyopaque, |
| 634 | msg_controllen: usize, | 634 | msg_controllen: usize, |
| 635 | msg_flags: i32, | 635 | msg_flags: i32, |
| 636 | }; | 636 | }; |
| ... | @@ -640,7 +640,7 @@ pub const msghdr_const = extern struct { | ... | @@ -640,7 +640,7 @@ pub const msghdr_const = extern struct { |
| 640 | msg_namelen: socklen_t, | 640 | msg_namelen: socklen_t, |
| 641 | msg_iov: [*]iovec_const, | 641 | msg_iov: [*]iovec_const, |
| 642 | msg_iovlen: usize, | 642 | msg_iovlen: usize, |
| 643 | msg_control: ?*c_void, | 643 | msg_control: ?*anyopaque, |
| 644 | msg_controllen: usize, | 644 | msg_controllen: usize, |
| 645 | msg_flags: i32, | 645 | msg_flags: i32, |
| 646 | }; | 646 | }; |
| ... | @@ -718,7 +718,7 @@ pub const mcontext_t = extern struct { | ... | @@ -718,7 +718,7 @@ pub const mcontext_t = extern struct { |
| 718 | _pad0: i32, | 718 | _pad0: i32, |
| 719 | handler: u64, | 719 | handler: u64, |
| 720 | oldmask: u64, | 720 | oldmask: u64, |
| 721 | regs: ?*c_void, | 721 | regs: ?*anyopaque, |
| 722 | gp_regs: gregset_t, | 722 | gp_regs: gregset_t, |
| 723 | fp_regs: fpregset_t, | 723 | fp_regs: fpregset_t, |
| 724 | v_regs: *vrregset_t, | 724 | v_regs: *vrregset_t, |
lib/std/os/linux/sparc64.zig+2-2| ... | @@ -660,7 +660,7 @@ pub const msghdr = extern struct { | ... | @@ -660,7 +660,7 @@ pub const msghdr = extern struct { |
| 660 | msg_namelen: socklen_t, | 660 | msg_namelen: socklen_t, |
| 661 | msg_iov: [*]iovec, | 661 | msg_iov: [*]iovec, |
| 662 | msg_iovlen: u64, | 662 | msg_iovlen: u64, |
| 663 | msg_control: ?*c_void, | 663 | msg_control: ?*anyopaque, |
| 664 | msg_controllen: u64, | 664 | msg_controllen: u64, |
| 665 | msg_flags: i32, | 665 | msg_flags: i32, |
| 666 | }; | 666 | }; |
| ... | @@ -670,7 +670,7 @@ pub const msghdr_const = extern struct { | ... | @@ -670,7 +670,7 @@ pub const msghdr_const = extern struct { |
| 670 | msg_namelen: socklen_t, | 670 | msg_namelen: socklen_t, |
| 671 | msg_iov: [*]iovec_const, | 671 | msg_iov: [*]iovec_const, |
| 672 | msg_iovlen: u64, | 672 | msg_iovlen: u64, |
| 673 | msg_control: ?*c_void, | 673 | msg_control: ?*anyopaque, |
| 674 | msg_controllen: u64, | 674 | msg_controllen: u64, |
| 675 | msg_flags: i32, | 675 | msg_flags: i32, |
| 676 | }; | 676 | }; |
lib/std/os/linux/x86_64.zig+2-2| ... | @@ -604,7 +604,7 @@ pub const msghdr = extern struct { | ... | @@ -604,7 +604,7 @@ pub const msghdr = extern struct { |
| 604 | iov: [*]iovec, | 604 | iov: [*]iovec, |
| 605 | iovlen: i32, | 605 | iovlen: i32, |
| 606 | __pad1: i32 = 0, | 606 | __pad1: i32 = 0, |
| 607 | control: ?*c_void, | 607 | control: ?*anyopaque, |
| 608 | controllen: socklen_t, | 608 | controllen: socklen_t, |
| 609 | __pad2: socklen_t = 0, | 609 | __pad2: socklen_t = 0, |
| 610 | flags: i32, | 610 | flags: i32, |
| ... | @@ -616,7 +616,7 @@ pub const msghdr_const = extern struct { | ... | @@ -616,7 +616,7 @@ pub const msghdr_const = extern struct { |
| 616 | iov: [*]iovec_const, | 616 | iov: [*]iovec_const, |
| 617 | iovlen: i32, | 617 | iovlen: i32, |
| 618 | __pad1: i32 = 0, | 618 | __pad1: i32 = 0, |
| 619 | control: ?*c_void, | 619 | control: ?*anyopaque, |
| 620 | controllen: socklen_t, | 620 | controllen: socklen_t, |
| 621 | __pad2: socklen_t = 0, | 621 | __pad2: socklen_t = 0, |
| 622 | flags: i32, | 622 | flags: i32, |
lib/std/os/test.zig+2-2| ... | @@ -408,7 +408,7 @@ test "sigaltstack" { | ... | @@ -408,7 +408,7 @@ test "sigaltstack" { |
| 408 | 408 | ||
| 409 | // If the type is not available use void to avoid erroring out when `iter_fn` is | 409 | // If the type is not available use void to avoid erroring out when `iter_fn` is |
| 410 | // analyzed | 410 | // analyzed |
| 411 | const dl_phdr_info = if (@hasDecl(os.system, "dl_phdr_info")) os.dl_phdr_info else c_void; | 411 | const dl_phdr_info = if (@hasDecl(os.system, "dl_phdr_info")) os.dl_phdr_info else anyopaque; |
| 412 | 412 | ||
| 413 | const IterFnError = error{ | 413 | const IterFnError = error{ |
| 414 | MissingPtLoadSegment, | 414 | MissingPtLoadSegment, |
| ... | @@ -740,7 +740,7 @@ test "sigaction" { | ... | @@ -740,7 +740,7 @@ test "sigaction" { |
| 740 | return error.SkipZigTest; | 740 | return error.SkipZigTest; |
| 741 | 741 | ||
| 742 | const S = struct { | 742 | const S = struct { |
| 743 | fn handler(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const c_void) callconv(.C) void { | 743 | fn handler(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const anyopaque) callconv(.C) void { |
| 744 | _ = ctx_ptr; | 744 | _ = ctx_ptr; |
| 745 | // Check that we received the correct signal. | 745 | // Check that we received the correct signal. |
| 746 | switch (native_os) { | 746 | switch (native_os) { |
lib/std/os/uefi/protocols/ip6_config_protocol.zig+4-4| ... | @@ -4,16 +4,16 @@ const Event = uefi.Event; | ... | @@ -4,16 +4,16 @@ const Event = uefi.Event; |
| 4 | const Status = uefi.Status; | 4 | const Status = uefi.Status; |
| 5 | 5 | ||
| 6 | pub const Ip6ConfigProtocol = extern struct { | 6 | pub const Ip6ConfigProtocol = extern struct { |
| 7 | _set_data: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, usize, *const c_void) callconv(.C) Status, | 7 | _set_data: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, usize, *const anyopaque) callconv(.C) Status, |
| 8 | _get_data: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, *usize, ?*const c_void) callconv(.C) Status, | 8 | _get_data: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, *usize, ?*const anyopaque) callconv(.C) Status, |
| 9 | _register_data_notify: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status, | 9 | _register_data_notify: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status, |
| 10 | _unregister_data_notify: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status, | 10 | _unregister_data_notify: fn (*const Ip6ConfigProtocol, Ip6ConfigDataType, Event) callconv(.C) Status, |
| 11 | 11 | ||
| 12 | pub fn setData(self: *const Ip6ConfigProtocol, data_type: Ip6ConfigDataType, data_size: usize, data: *const c_void) Status { | 12 | pub fn setData(self: *const Ip6ConfigProtocol, data_type: Ip6ConfigDataType, data_size: usize, data: *const anyopaque) Status { |
| 13 | return self._set_data(self, data_type, data_size, data); | 13 | return self._set_data(self, data_type, data_size, data); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | pub fn getData(self: *const Ip6ConfigProtocol, data_type: Ip6ConfigDataType, data_size: *usize, data: ?*const c_void) Status { | 16 | pub fn getData(self: *const Ip6ConfigProtocol, data_type: Ip6ConfigDataType, data_size: *usize, data: ?*const anyopaque) Status { |
| 17 | return self._get_data(self, data_type, data_size, data); | 17 | return self._get_data(self, data_type, data_size, data); |
| 18 | } | 18 | } |
| 19 | 19 |
lib/std/os/uefi/protocols/ip6_protocol.zig+1-1| ... | @@ -140,5 +140,5 @@ pub const Ip6IcmpType = extern struct { | ... | @@ -140,5 +140,5 @@ pub const Ip6IcmpType = extern struct { |
| 140 | pub const Ip6CompletionToken = extern struct { | 140 | pub const Ip6CompletionToken = extern struct { |
| 141 | event: Event, | 141 | event: Event, |
| 142 | status: Status, | 142 | status: Status, |
| 143 | packet: *c_void, // union TODO | 143 | packet: *anyopaque, // union TODO |
| 144 | }; | 144 | }; |
lib/std/os/uefi/protocols/loaded_image_protocol.zig+2-2| ... | @@ -12,9 +12,9 @@ pub const LoadedImageProtocol = extern struct { | ... | @@ -12,9 +12,9 @@ pub const LoadedImageProtocol = extern struct { |
| 12 | system_table: *SystemTable, | 12 | system_table: *SystemTable, |
| 13 | device_handle: ?Handle, | 13 | device_handle: ?Handle, |
| 14 | file_path: *DevicePathProtocol, | 14 | file_path: *DevicePathProtocol, |
| 15 | reserved: *c_void, | 15 | reserved: *anyopaque, |
| 16 | load_options_size: u32, | 16 | load_options_size: u32, |
| 17 | load_options: ?*c_void, | 17 | load_options: ?*anyopaque, |
| 18 | image_base: [*]u8, | 18 | image_base: [*]u8, |
| 19 | image_size: u64, | 19 | image_size: u64, |
| 20 | image_code_type: MemoryType, | 20 | image_code_type: MemoryType, |
lib/std/os/uefi/protocols/managed_network_protocol.zig+2-2| ... | @@ -9,7 +9,7 @@ const MacAddress = uefi.protocols.MacAddress; | ... | @@ -9,7 +9,7 @@ const MacAddress = uefi.protocols.MacAddress; |
| 9 | pub const ManagedNetworkProtocol = extern struct { | 9 | pub const ManagedNetworkProtocol = extern struct { |
| 10 | _get_mode_data: fn (*const ManagedNetworkProtocol, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status, | 10 | _get_mode_data: fn (*const ManagedNetworkProtocol, ?*ManagedNetworkConfigData, ?*SimpleNetworkMode) callconv(.C) Status, |
| 11 | _configure: fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkConfigData) callconv(.C) Status, | 11 | _configure: fn (*const ManagedNetworkProtocol, ?*const ManagedNetworkConfigData) callconv(.C) Status, |
| 12 | _mcast_ip_to_mac: fn (*const ManagedNetworkProtocol, bool, *const c_void, *MacAddress) callconv(.C) Status, | 12 | _mcast_ip_to_mac: fn (*const ManagedNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status, |
| 13 | _groups: fn (*const ManagedNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status, | 13 | _groups: fn (*const ManagedNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status, |
| 14 | _transmit: fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status, | 14 | _transmit: fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status, |
| 15 | _receive: fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status, | 15 | _receive: fn (*const ManagedNetworkProtocol, *const ManagedNetworkCompletionToken) callconv(.C) Status, |
| ... | @@ -29,7 +29,7 @@ pub const ManagedNetworkProtocol = extern struct { | ... | @@ -29,7 +29,7 @@ pub const ManagedNetworkProtocol = extern struct { |
| 29 | 29 | ||
| 30 | /// Translates an IP multicast address to a hardware (MAC) multicast address. | 30 | /// Translates an IP multicast address to a hardware (MAC) multicast address. |
| 31 | /// This function may be unsupported in some MNP implementations. | 31 | /// This function may be unsupported in some MNP implementations. |
| 32 | pub fn mcastIpToMac(self: *const ManagedNetworkProtocol, ipv6flag: bool, ipaddress: *const c_void, mac_address: *MacAddress) Status { | 32 | pub fn mcastIpToMac(self: *const ManagedNetworkProtocol, ipv6flag: bool, ipaddress: *const anyopaque, mac_address: *MacAddress) Status { |
| 33 | _ = mac_address; | 33 | _ = mac_address; |
| 34 | return self._mcast_ip_to_mac(self, ipv6flag, ipaddress); | 34 | return self._mcast_ip_to_mac(self, ipv6flag, ipaddress); |
| 35 | } | 35 | } |
lib/std/os/uefi/protocols/simple_network_protocol.zig+2-2| ... | @@ -13,7 +13,7 @@ pub const SimpleNetworkProtocol = extern struct { | ... | @@ -13,7 +13,7 @@ pub const SimpleNetworkProtocol = extern struct { |
| 13 | _receive_filters: fn (*const SimpleNetworkProtocol, SimpleNetworkReceiveFilter, SimpleNetworkReceiveFilter, bool, usize, ?[*]const MacAddress) callconv(.C) Status, | 13 | _receive_filters: fn (*const SimpleNetworkProtocol, SimpleNetworkReceiveFilter, SimpleNetworkReceiveFilter, bool, usize, ?[*]const MacAddress) callconv(.C) Status, |
| 14 | _station_address: fn (*const SimpleNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status, | 14 | _station_address: fn (*const SimpleNetworkProtocol, bool, ?*const MacAddress) callconv(.C) Status, |
| 15 | _statistics: fn (*const SimpleNetworkProtocol, bool, ?*usize, ?*NetworkStatistics) callconv(.C) Status, | 15 | _statistics: fn (*const SimpleNetworkProtocol, bool, ?*usize, ?*NetworkStatistics) callconv(.C) Status, |
| 16 | _mcast_ip_to_mac: fn (*const SimpleNetworkProtocol, bool, *const c_void, *MacAddress) callconv(.C) Status, | 16 | _mcast_ip_to_mac: fn (*const SimpleNetworkProtocol, bool, *const anyopaque, *MacAddress) callconv(.C) Status, |
| 17 | _nvdata: fn (*const SimpleNetworkProtocol, bool, usize, usize, [*]u8) callconv(.C) Status, | 17 | _nvdata: fn (*const SimpleNetworkProtocol, bool, usize, usize, [*]u8) callconv(.C) Status, |
| 18 | _get_status: fn (*const SimpleNetworkProtocol, *SimpleNetworkInterruptStatus, ?*?[*]u8) callconv(.C) Status, | 18 | _get_status: fn (*const SimpleNetworkProtocol, *SimpleNetworkInterruptStatus, ?*?[*]u8) callconv(.C) Status, |
| 19 | _transmit: fn (*const SimpleNetworkProtocol, usize, usize, [*]const u8, ?*const MacAddress, ?*const MacAddress, ?*const u16) callconv(.C) Status, | 19 | _transmit: fn (*const SimpleNetworkProtocol, usize, usize, [*]const u8, ?*const MacAddress, ?*const MacAddress, ?*const u16) callconv(.C) Status, |
| ... | @@ -62,7 +62,7 @@ pub const SimpleNetworkProtocol = extern struct { | ... | @@ -62,7 +62,7 @@ pub const SimpleNetworkProtocol = extern struct { |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | /// Converts a multicast IP address to a multicast HW MAC address. | 64 | /// Converts a multicast IP address to a multicast HW MAC address. |
| 65 | pub fn mcastIpToMac(self: *const SimpleNetworkProtocol, ipv6: bool, ip: *const c_void, mac: *MacAddress) Status { | 65 | pub fn mcastIpToMac(self: *const SimpleNetworkProtocol, ipv6: bool, ip: *const anyopaque, mac: *MacAddress) Status { |
| 66 | return self._mcast_ip_to_mac(self, ipv6, ip, mac); | 66 | return self._mcast_ip_to_mac(self, ipv6, ip, mac); |
| 67 | } | 67 | } |
| 68 | 68 |
lib/std/os/uefi/protocols/simple_text_input_ex_protocol.zig+4-4| ... | @@ -9,8 +9,8 @@ pub const SimpleTextInputExProtocol = extern struct { | ... | @@ -9,8 +9,8 @@ pub const SimpleTextInputExProtocol = extern struct { |
| 9 | _read_key_stroke_ex: fn (*const SimpleTextInputExProtocol, *KeyData) callconv(.C) Status, | 9 | _read_key_stroke_ex: fn (*const SimpleTextInputExProtocol, *KeyData) callconv(.C) Status, |
| 10 | wait_for_key_ex: Event, | 10 | wait_for_key_ex: Event, |
| 11 | _set_state: fn (*const SimpleTextInputExProtocol, *const u8) callconv(.C) Status, | 11 | _set_state: fn (*const SimpleTextInputExProtocol, *const u8) callconv(.C) Status, |
| 12 | _register_key_notify: fn (*const SimpleTextInputExProtocol, *const KeyData, fn (*const KeyData) callconv(.C) usize, **c_void) callconv(.C) Status, | 12 | _register_key_notify: fn (*const SimpleTextInputExProtocol, *const KeyData, fn (*const KeyData) callconv(.C) usize, **anyopaque) callconv(.C) Status, |
| 13 | _unregister_key_notify: fn (*const SimpleTextInputExProtocol, *const c_void) callconv(.C) Status, | 13 | _unregister_key_notify: fn (*const SimpleTextInputExProtocol, *const anyopaque) callconv(.C) Status, |
| 14 | 14 | ||
| 15 | /// Resets the input device hardware. | 15 | /// Resets the input device hardware. |
| 16 | pub fn reset(self: *const SimpleTextInputExProtocol, verify: bool) Status { | 16 | pub fn reset(self: *const SimpleTextInputExProtocol, verify: bool) Status { |
| ... | @@ -28,12 +28,12 @@ pub const SimpleTextInputExProtocol = extern struct { | ... | @@ -28,12 +28,12 @@ pub const SimpleTextInputExProtocol = extern struct { |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | /// Register a notification function for a particular keystroke for the input device. | 30 | /// Register a notification function for a particular keystroke for the input device. |
| 31 | pub fn registerKeyNotify(self: *const SimpleTextInputExProtocol, key_data: *const KeyData, notify: fn (*const KeyData) callconv(.C) usize, handle: **c_void) Status { | 31 | pub fn registerKeyNotify(self: *const SimpleTextInputExProtocol, key_data: *const KeyData, notify: fn (*const KeyData) callconv(.C) usize, handle: **anyopaque) Status { |
| 32 | return self._register_key_notify(self, key_data, notify, handle); | 32 | return self._register_key_notify(self, key_data, notify, handle); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | /// Remove the notification that was previously registered. | 35 | /// Remove the notification that was previously registered. |
| 36 | pub fn unregisterKeyNotify(self: *const SimpleTextInputExProtocol, handle: *const c_void) Status { | 36 | pub fn unregisterKeyNotify(self: *const SimpleTextInputExProtocol, handle: *const anyopaque) Status { |
| 37 | return self._unregister_key_notify(self, handle); | 37 | return self._unregister_key_notify(self, handle); |
| 38 | } | 38 | } |
| 39 | 39 |
lib/std/os/uefi/tables/boot_services.zig+8-8| ... | @@ -42,7 +42,7 @@ pub const BootServices = extern struct { | ... | @@ -42,7 +42,7 @@ pub const BootServices = extern struct { |
| 42 | freePool: fn ([*]align(8) u8) callconv(.C) Status, | 42 | freePool: fn ([*]align(8) u8) callconv(.C) Status, |
| 43 | 43 | ||
| 44 | /// Creates an event. | 44 | /// Creates an event. |
| 45 | createEvent: fn (u32, usize, ?fn (Event, ?*c_void) callconv(.C) void, ?*const c_void, *Event) callconv(.C) Status, | 45 | createEvent: fn (u32, usize, ?fn (Event, ?*anyopaque) callconv(.C) void, ?*const anyopaque, *Event) callconv(.C) Status, |
| 46 | 46 | ||
| 47 | /// Sets the type of timer and the trigger time for a timer event. | 47 | /// Sets the type of timer and the trigger time for a timer event. |
| 48 | setTimer: fn (Event, TimerDelay, u64) callconv(.C) Status, | 48 | setTimer: fn (Event, TimerDelay, u64) callconv(.C) Status, |
| ... | @@ -64,14 +64,14 @@ pub const BootServices = extern struct { | ... | @@ -64,14 +64,14 @@ pub const BootServices = extern struct { |
| 64 | uninstallProtocolInterface: Status, // TODO | 64 | uninstallProtocolInterface: Status, // TODO |
| 65 | 65 | ||
| 66 | /// Queries a handle to determine if it supports a specified protocol. | 66 | /// Queries a handle to determine if it supports a specified protocol. |
| 67 | handleProtocol: fn (Handle, *align(8) const Guid, *?*c_void) callconv(.C) Status, | 67 | handleProtocol: fn (Handle, *align(8) const Guid, *?*anyopaque) callconv(.C) Status, |
| 68 | 68 | ||
| 69 | reserved: *c_void, | 69 | reserved: *anyopaque, |
| 70 | 70 | ||
| 71 | registerProtocolNotify: Status, // TODO | 71 | registerProtocolNotify: Status, // TODO |
| 72 | 72 | ||
| 73 | /// Returns an array of handles that support a specified protocol. | 73 | /// Returns an array of handles that support a specified protocol. |
| 74 | locateHandle: fn (LocateSearchType, ?*align(8) const Guid, ?*const c_void, *usize, [*]Handle) callconv(.C) Status, | 74 | locateHandle: fn (LocateSearchType, ?*align(8) const Guid, ?*const anyopaque, *usize, [*]Handle) callconv(.C) Status, |
| 75 | 75 | ||
| 76 | /// Locates the handle to a device on the device path that supports the specified protocol | 76 | /// Locates the handle to a device on the device path that supports the specified protocol |
| 77 | locateDevicePath: fn (*align(8) const Guid, **const DevicePathProtocol, *?Handle) callconv(.C) Status, | 77 | locateDevicePath: fn (*align(8) const Guid, **const DevicePathProtocol, *?Handle) callconv(.C) Status, |
| ... | @@ -84,7 +84,7 @@ pub const BootServices = extern struct { | ... | @@ -84,7 +84,7 @@ pub const BootServices = extern struct { |
| 84 | startImage: fn (Handle, ?*usize, ?*[*]u16) callconv(.C) Status, | 84 | startImage: fn (Handle, ?*usize, ?*[*]u16) callconv(.C) Status, |
| 85 | 85 | ||
| 86 | /// Terminates a loaded EFI image and returns control to boot services. | 86 | /// Terminates a loaded EFI image and returns control to boot services. |
| 87 | exit: fn (Handle, Status, usize, ?*const c_void) callconv(.C) Status, | 87 | exit: fn (Handle, Status, usize, ?*const anyopaque) callconv(.C) Status, |
| 88 | 88 | ||
| 89 | /// Unloads an image. | 89 | /// Unloads an image. |
| 90 | unloadImage: fn (Handle) callconv(.C) Status, | 90 | unloadImage: fn (Handle) callconv(.C) Status, |
| ... | @@ -105,7 +105,7 @@ pub const BootServices = extern struct { | ... | @@ -105,7 +105,7 @@ pub const BootServices = extern struct { |
| 105 | disconnectController: Status, // TODO | 105 | disconnectController: Status, // TODO |
| 106 | 106 | ||
| 107 | /// Queries a handle to determine if it supports a specified protocol. | 107 | /// Queries a handle to determine if it supports a specified protocol. |
| 108 | openProtocol: fn (Handle, *align(8) const Guid, *?*c_void, ?Handle, ?Handle, OpenProtocolAttributes) callconv(.C) Status, | 108 | openProtocol: fn (Handle, *align(8) const Guid, *?*anyopaque, ?Handle, ?Handle, OpenProtocolAttributes) callconv(.C) Status, |
| 109 | 109 | ||
| 110 | /// Closes a protocol on a handle that was opened using openProtocol(). | 110 | /// Closes a protocol on a handle that was opened using openProtocol(). |
| 111 | closeProtocol: fn (Handle, *align(8) const Guid, Handle, ?Handle) callconv(.C) Status, | 111 | closeProtocol: fn (Handle, *align(8) const Guid, Handle, ?Handle) callconv(.C) Status, |
| ... | @@ -117,10 +117,10 @@ pub const BootServices = extern struct { | ... | @@ -117,10 +117,10 @@ pub const BootServices = extern struct { |
| 117 | protocolsPerHandle: fn (Handle, *[*]*align(8) const Guid, *usize) callconv(.C) Status, | 117 | protocolsPerHandle: fn (Handle, *[*]*align(8) const Guid, *usize) callconv(.C) Status, |
| 118 | 118 | ||
| 119 | /// Returns an array of handles that support the requested protocol in a buffer allocated from pool. | 119 | /// Returns an array of handles that support the requested protocol in a buffer allocated from pool. |
| 120 | locateHandleBuffer: fn (LocateSearchType, ?*align(8) const Guid, ?*const c_void, *usize, *[*]Handle) callconv(.C) Status, | 120 | locateHandleBuffer: fn (LocateSearchType, ?*align(8) const Guid, ?*const anyopaque, *usize, *[*]Handle) callconv(.C) Status, |
| 121 | 121 | ||
| 122 | /// Returns the first protocol instance that matches the given protocol. | 122 | /// Returns the first protocol instance that matches the given protocol. |
| 123 | locateProtocol: fn (*align(8) const Guid, ?*const c_void, *?*c_void) callconv(.C) Status, | 123 | locateProtocol: fn (*align(8) const Guid, ?*const anyopaque, *?*anyopaque) callconv(.C) Status, |
| 124 | 124 | ||
| 125 | installMultipleProtocolInterfaces: Status, // TODO | 125 | installMultipleProtocolInterfaces: Status, // TODO |
| 126 | uninstallMultipleProtocolInterfaces: Status, // TODO | 126 | uninstallMultipleProtocolInterfaces: Status, // TODO |
lib/std/os/uefi/tables/configuration_table.zig+1-1| ... | @@ -3,7 +3,7 @@ const Guid = uefi.Guid; | ... | @@ -3,7 +3,7 @@ const Guid = uefi.Guid; |
| 3 | 3 | ||
| 4 | pub const ConfigurationTable = extern struct { | 4 | pub const ConfigurationTable = extern struct { |
| 5 | vendor_guid: Guid, | 5 | vendor_guid: Guid, |
| 6 | vendor_table: *c_void, | 6 | vendor_table: *anyopaque, |
| 7 | 7 | ||
| 8 | pub const acpi_20_table_guid align(8) = Guid{ | 8 | pub const acpi_20_table_guid align(8) = Guid{ |
| 9 | .time_low = 0x8868e871, | 9 | .time_low = 0x8868e871, |
lib/std/os/uefi/tables/runtime_services.zig+4-4| ... | @@ -28,21 +28,21 @@ pub const RuntimeServices = extern struct { | ... | @@ -28,21 +28,21 @@ pub const RuntimeServices = extern struct { |
| 28 | setVirtualAddressMap: fn (usize, usize, u32, [*]MemoryDescriptor) callconv(.C) Status, | 28 | setVirtualAddressMap: fn (usize, usize, u32, [*]MemoryDescriptor) callconv(.C) Status, |
| 29 | 29 | ||
| 30 | /// Determines the new virtual address that is to be used on subsequent memory accesses. | 30 | /// Determines the new virtual address that is to be used on subsequent memory accesses. |
| 31 | convertPointer: fn (usize, **c_void) callconv(.C) Status, | 31 | convertPointer: fn (usize, **anyopaque) callconv(.C) Status, |
| 32 | 32 | ||
| 33 | /// Returns the value of a variable. | 33 | /// Returns the value of a variable. |
| 34 | getVariable: fn ([*:0]const u16, *align(8) const Guid, ?*u32, *usize, ?*c_void) callconv(.C) Status, | 34 | getVariable: fn ([*:0]const u16, *align(8) const Guid, ?*u32, *usize, ?*anyopaque) callconv(.C) Status, |
| 35 | 35 | ||
| 36 | /// Enumerates the current variable names. | 36 | /// Enumerates the current variable names. |
| 37 | getNextVariableName: fn (*usize, [*:0]u16, *align(8) Guid) callconv(.C) Status, | 37 | getNextVariableName: fn (*usize, [*:0]u16, *align(8) Guid) callconv(.C) Status, |
| 38 | 38 | ||
| 39 | /// Sets the value of a variable. | 39 | /// Sets the value of a variable. |
| 40 | setVariable: fn ([*:0]const u16, *align(8) const Guid, u32, usize, *c_void) callconv(.C) Status, | 40 | setVariable: fn ([*:0]const u16, *align(8) const Guid, u32, usize, *anyopaque) callconv(.C) Status, |
| 41 | 41 | ||
| 42 | getNextHighMonotonicCount: Status, // TODO | 42 | getNextHighMonotonicCount: Status, // TODO |
| 43 | 43 | ||
| 44 | /// Resets the entire platform. | 44 | /// Resets the entire platform. |
| 45 | resetSystem: fn (ResetType, Status, usize, ?*const c_void) callconv(.C) noreturn, | 45 | resetSystem: fn (ResetType, Status, usize, ?*const anyopaque) callconv(.C) noreturn, |
| 46 | 46 | ||
| 47 | updateCapsule: Status, // TODO | 47 | updateCapsule: Status, // TODO |
| 48 | queryCapsuleCapabilities: Status, // TODO | 48 | queryCapsuleCapabilities: Status, // TODO |
lib/std/os/windows.zig+16-16| ... | @@ -1553,7 +1553,7 @@ pub fn CreateProcessW( | ... | @@ -1553,7 +1553,7 @@ pub fn CreateProcessW( |
| 1553 | lpThreadAttributes: ?*SECURITY_ATTRIBUTES, | 1553 | lpThreadAttributes: ?*SECURITY_ATTRIBUTES, |
| 1554 | bInheritHandles: BOOL, | 1554 | bInheritHandles: BOOL, |
| 1555 | dwCreationFlags: DWORD, | 1555 | dwCreationFlags: DWORD, |
| 1556 | lpEnvironment: ?*c_void, | 1556 | lpEnvironment: ?*anyopaque, |
| 1557 | lpCurrentDirectory: ?LPWSTR, | 1557 | lpCurrentDirectory: ?LPWSTR, |
| 1558 | lpStartupInfo: *STARTUPINFOW, | 1558 | lpStartupInfo: *STARTUPINFOW, |
| 1559 | lpProcessInformation: *PROCESS_INFORMATION, | 1559 | lpProcessInformation: *PROCESS_INFORMATION, |
| ... | @@ -1619,11 +1619,11 @@ pub fn QueryPerformanceCounter() u64 { | ... | @@ -1619,11 +1619,11 @@ pub fn QueryPerformanceCounter() u64 { |
| 1619 | return @bitCast(u64, result); | 1619 | return @bitCast(u64, result); |
| 1620 | } | 1620 | } |
| 1621 | 1621 | ||
| 1622 | pub fn InitOnceExecuteOnce(InitOnce: *INIT_ONCE, InitFn: INIT_ONCE_FN, Parameter: ?*c_void, Context: ?*c_void) void { | 1622 | pub fn InitOnceExecuteOnce(InitOnce: *INIT_ONCE, InitFn: INIT_ONCE_FN, Parameter: ?*anyopaque, Context: ?*anyopaque) void { |
| 1623 | assert(kernel32.InitOnceExecuteOnce(InitOnce, InitFn, Parameter, Context) != 0); | 1623 | assert(kernel32.InitOnceExecuteOnce(InitOnce, InitFn, Parameter, Context) != 0); |
| 1624 | } | 1624 | } |
| 1625 | 1625 | ||
| 1626 | pub fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: *c_void) void { | 1626 | pub fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: *anyopaque) void { |
| 1627 | assert(kernel32.HeapFree(hHeap, dwFlags, lpMem) != 0); | 1627 | assert(kernel32.HeapFree(hHeap, dwFlags, lpMem) != 0); |
| 1628 | } | 1628 | } |
| 1629 | 1629 | ||
| ... | @@ -1675,7 +1675,7 @@ pub fn LockFile( | ... | @@ -1675,7 +1675,7 @@ pub fn LockFile( |
| 1675 | FileHandle: HANDLE, | 1675 | FileHandle: HANDLE, |
| 1676 | Event: ?HANDLE, | 1676 | Event: ?HANDLE, |
| 1677 | ApcRoutine: ?*IO_APC_ROUTINE, | 1677 | ApcRoutine: ?*IO_APC_ROUTINE, |
| 1678 | ApcContext: ?*c_void, | 1678 | ApcContext: ?*anyopaque, |
| 1679 | IoStatusBlock: *IO_STATUS_BLOCK, | 1679 | IoStatusBlock: *IO_STATUS_BLOCK, |
| 1680 | ByteOffset: *const LARGE_INTEGER, | 1680 | ByteOffset: *const LARGE_INTEGER, |
| 1681 | Length: *const LARGE_INTEGER, | 1681 | Length: *const LARGE_INTEGER, |
| ... | @@ -1954,7 +1954,7 @@ pub fn loadWinsockExtensionFunction(comptime T: type, sock: ws2_32.SOCKET, guid: | ... | @@ -1954,7 +1954,7 @@ pub fn loadWinsockExtensionFunction(comptime T: type, sock: ws2_32.SOCKET, guid: |
| 1954 | const rc = ws2_32.WSAIoctl( | 1954 | const rc = ws2_32.WSAIoctl( |
| 1955 | sock, | 1955 | sock, |
| 1956 | ws2_32.SIO_GET_EXTENSION_FUNCTION_POINTER, | 1956 | ws2_32.SIO_GET_EXTENSION_FUNCTION_POINTER, |
| 1957 | @ptrCast(*const c_void, &guid), | 1957 | @ptrCast(*const anyopaque, &guid), |
| 1958 | @sizeOf(GUID), | 1958 | @sizeOf(GUID), |
| 1959 | &function, | 1959 | &function, |
| 1960 | @sizeOf(T), | 1960 | @sizeOf(T), |
| ... | @@ -2055,7 +2055,7 @@ pub const BYTE = u8; | ... | @@ -2055,7 +2055,7 @@ pub const BYTE = u8; |
| 2055 | pub const CHAR = u8; | 2055 | pub const CHAR = u8; |
| 2056 | pub const UCHAR = u8; | 2056 | pub const UCHAR = u8; |
| 2057 | pub const FLOAT = f32; | 2057 | pub const FLOAT = f32; |
| 2058 | pub const HANDLE = *c_void; | 2058 | pub const HANDLE = *anyopaque; |
| 2059 | pub const HCRYPTPROV = ULONG_PTR; | 2059 | pub const HCRYPTPROV = ULONG_PTR; |
| 2060 | pub const ATOM = u16; | 2060 | pub const ATOM = u16; |
| 2061 | pub const HBRUSH = *opaque {}; | 2061 | pub const HBRUSH = *opaque {}; |
| ... | @@ -2070,12 +2070,12 @@ pub const HGLRC = *opaque {}; | ... | @@ -2070,12 +2070,12 @@ pub const HGLRC = *opaque {}; |
| 2070 | pub const FARPROC = *opaque {}; | 2070 | pub const FARPROC = *opaque {}; |
| 2071 | pub const INT = c_int; | 2071 | pub const INT = c_int; |
| 2072 | pub const LPCSTR = [*:0]const CHAR; | 2072 | pub const LPCSTR = [*:0]const CHAR; |
| 2073 | pub const LPCVOID = *const c_void; | 2073 | pub const LPCVOID = *const anyopaque; |
| 2074 | pub const LPSTR = [*:0]CHAR; | 2074 | pub const LPSTR = [*:0]CHAR; |
| 2075 | pub const LPVOID = *c_void; | 2075 | pub const LPVOID = *anyopaque; |
| 2076 | pub const LPWSTR = [*:0]WCHAR; | 2076 | pub const LPWSTR = [*:0]WCHAR; |
| 2077 | pub const LPCWSTR = [*:0]const WCHAR; | 2077 | pub const LPCWSTR = [*:0]const WCHAR; |
| 2078 | pub const PVOID = *c_void; | 2078 | pub const PVOID = *anyopaque; |
| 2079 | pub const PWSTR = [*:0]WCHAR; | 2079 | pub const PWSTR = [*:0]WCHAR; |
| 2080 | pub const SIZE_T = usize; | 2080 | pub const SIZE_T = usize; |
| 2081 | pub const UINT = c_uint; | 2081 | pub const UINT = c_uint; |
| ... | @@ -2289,7 +2289,7 @@ pub const IO_STATUS_BLOCK = extern struct { | ... | @@ -2289,7 +2289,7 @@ pub const IO_STATUS_BLOCK = extern struct { |
| 2289 | // "DUMMYUNIONNAME" expands to "u" | 2289 | // "DUMMYUNIONNAME" expands to "u" |
| 2290 | u: extern union { | 2290 | u: extern union { |
| 2291 | Status: NTSTATUS, | 2291 | Status: NTSTATUS, |
| 2292 | Pointer: ?*c_void, | 2292 | Pointer: ?*anyopaque, |
| 2293 | }, | 2293 | }, |
| 2294 | Information: ULONG_PTR, | 2294 | Information: ULONG_PTR, |
| 2295 | }; | 2295 | }; |
| ... | @@ -2457,7 +2457,7 @@ pub const VOLUME_NAME_NT = 0x2; | ... | @@ -2457,7 +2457,7 @@ pub const VOLUME_NAME_NT = 0x2; |
| 2457 | 2457 | ||
| 2458 | pub const SECURITY_ATTRIBUTES = extern struct { | 2458 | pub const SECURITY_ATTRIBUTES = extern struct { |
| 2459 | nLength: DWORD, | 2459 | nLength: DWORD, |
| 2460 | lpSecurityDescriptor: ?*c_void, | 2460 | lpSecurityDescriptor: ?*anyopaque, |
| 2461 | bInheritHandle: BOOL, | 2461 | bInheritHandle: BOOL, |
| 2462 | }; | 2462 | }; |
| 2463 | 2463 | ||
| ... | @@ -2923,10 +2923,10 @@ pub const RTL_CRITICAL_SECTION = extern struct { | ... | @@ -2923,10 +2923,10 @@ pub const RTL_CRITICAL_SECTION = extern struct { |
| 2923 | pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION; | 2923 | pub const CRITICAL_SECTION = RTL_CRITICAL_SECTION; |
| 2924 | pub const INIT_ONCE = RTL_RUN_ONCE; | 2924 | pub const INIT_ONCE = RTL_RUN_ONCE; |
| 2925 | pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE_INIT; | 2925 | pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE_INIT; |
| 2926 | pub const INIT_ONCE_FN = fn (InitOnce: *INIT_ONCE, Parameter: ?*c_void, Context: ?*c_void) callconv(.C) BOOL; | 2926 | pub const INIT_ONCE_FN = fn (InitOnce: *INIT_ONCE, Parameter: ?*anyopaque, Context: ?*anyopaque) callconv(.C) BOOL; |
| 2927 | 2927 | ||
| 2928 | pub const RTL_RUN_ONCE = extern struct { | 2928 | pub const RTL_RUN_ONCE = extern struct { |
| 2929 | Ptr: ?*c_void, | 2929 | Ptr: ?*anyopaque, |
| 2930 | }; | 2930 | }; |
| 2931 | 2931 | ||
| 2932 | pub const RTL_RUN_ONCE_INIT = RTL_RUN_ONCE{ .Ptr = null }; | 2932 | pub const RTL_RUN_ONCE_INIT = RTL_RUN_ONCE{ .Ptr = null }; |
| ... | @@ -2966,7 +2966,7 @@ pub const EXCEPTION_RECORD = extern struct { | ... | @@ -2966,7 +2966,7 @@ pub const EXCEPTION_RECORD = extern struct { |
| 2966 | ExceptionCode: u32, | 2966 | ExceptionCode: u32, |
| 2967 | ExceptionFlags: u32, | 2967 | ExceptionFlags: u32, |
| 2968 | ExceptionRecord: *EXCEPTION_RECORD, | 2968 | ExceptionRecord: *EXCEPTION_RECORD, |
| 2969 | ExceptionAddress: *c_void, | 2969 | ExceptionAddress: *anyopaque, |
| 2970 | NumberParameters: u32, | 2970 | NumberParameters: u32, |
| 2971 | ExceptionInformation: [15]usize, | 2971 | ExceptionInformation: [15]usize, |
| 2972 | }; | 2972 | }; |
| ... | @@ -3202,8 +3202,8 @@ pub const OBJECT_ATTRIBUTES = extern struct { | ... | @@ -3202,8 +3202,8 @@ pub const OBJECT_ATTRIBUTES = extern struct { |
| 3202 | RootDirectory: ?HANDLE, | 3202 | RootDirectory: ?HANDLE, |
| 3203 | ObjectName: *UNICODE_STRING, | 3203 | ObjectName: *UNICODE_STRING, |
| 3204 | Attributes: ULONG, | 3204 | Attributes: ULONG, |
| 3205 | SecurityDescriptor: ?*c_void, | 3205 | SecurityDescriptor: ?*anyopaque, |
| 3206 | SecurityQualityOfService: ?*c_void, | 3206 | SecurityQualityOfService: ?*anyopaque, |
| 3207 | }; | 3207 | }; |
| 3208 | 3208 | ||
| 3209 | pub const OBJ_INHERIT = 0x00000002; | 3209 | pub const OBJ_INHERIT = 0x00000002; |
lib/std/os/windows/kernel32.zig+10-10| ... | @@ -57,7 +57,7 @@ const UCHAR = windows.UCHAR; | ... | @@ -57,7 +57,7 @@ const UCHAR = windows.UCHAR; |
| 57 | const FARPROC = windows.FARPROC; | 57 | const FARPROC = windows.FARPROC; |
| 58 | const INIT_ONCE_FN = windows.INIT_ONCE_FN; | 58 | const INIT_ONCE_FN = windows.INIT_ONCE_FN; |
| 59 | 59 | ||
| 60 | pub extern "kernel32" fn AddVectoredExceptionHandler(First: c_ulong, Handler: ?VECTORED_EXCEPTION_HANDLER) callconv(WINAPI) ?*c_void; | 60 | pub extern "kernel32" fn AddVectoredExceptionHandler(First: c_ulong, Handler: ?VECTORED_EXCEPTION_HANDLER) callconv(WINAPI) ?*anyopaque; |
| 61 | pub extern "kernel32" fn RemoveVectoredExceptionHandler(Handle: HANDLE) callconv(WINAPI) c_ulong; | 61 | pub extern "kernel32" fn RemoveVectoredExceptionHandler(Handle: HANDLE) callconv(WINAPI) c_ulong; |
| 62 | 62 | ||
| 63 | pub extern "kernel32" fn CancelIo(hFile: HANDLE) callconv(WINAPI) BOOL; | 63 | pub extern "kernel32" fn CancelIo(hFile: HANDLE) callconv(WINAPI) BOOL; |
| ... | @@ -110,7 +110,7 @@ pub extern "kernel32" fn CreateProcessW( | ... | @@ -110,7 +110,7 @@ pub extern "kernel32" fn CreateProcessW( |
| 110 | lpThreadAttributes: ?*SECURITY_ATTRIBUTES, | 110 | lpThreadAttributes: ?*SECURITY_ATTRIBUTES, |
| 111 | bInheritHandles: BOOL, | 111 | bInheritHandles: BOOL, |
| 112 | dwCreationFlags: DWORD, | 112 | dwCreationFlags: DWORD, |
| 113 | lpEnvironment: ?*c_void, | 113 | lpEnvironment: ?*anyopaque, |
| 114 | lpCurrentDirectory: ?LPWSTR, | 114 | lpCurrentDirectory: ?LPWSTR, |
| 115 | lpStartupInfo: *STARTUPINFOW, | 115 | lpStartupInfo: *STARTUPINFOW, |
| 116 | lpProcessInformation: *PROCESS_INFORMATION, | 116 | lpProcessInformation: *PROCESS_INFORMATION, |
| ... | @@ -125,7 +125,7 @@ pub extern "kernel32" fn CreateThread(lpThreadAttributes: ?*SECURITY_ATTRIBUTES, | ... | @@ -125,7 +125,7 @@ pub extern "kernel32" fn CreateThread(lpThreadAttributes: ?*SECURITY_ATTRIBUTES, |
| 125 | pub extern "kernel32" fn DeviceIoControl( | 125 | pub extern "kernel32" fn DeviceIoControl( |
| 126 | h: HANDLE, | 126 | h: HANDLE, |
| 127 | dwIoControlCode: DWORD, | 127 | dwIoControlCode: DWORD, |
| 128 | lpInBuffer: ?*const c_void, | 128 | lpInBuffer: ?*const anyopaque, |
| 129 | nInBufferSize: DWORD, | 129 | nInBufferSize: DWORD, |
| 130 | lpOutBuffer: ?LPVOID, | 130 | lpOutBuffer: ?LPVOID, |
| 131 | nOutBufferSize: DWORD, | 131 | nOutBufferSize: DWORD, |
| ... | @@ -194,7 +194,7 @@ pub extern "kernel32" fn GetFileInformationByHandle( | ... | @@ -194,7 +194,7 @@ pub extern "kernel32" fn GetFileInformationByHandle( |
| 194 | pub extern "kernel32" fn GetFileInformationByHandleEx( | 194 | pub extern "kernel32" fn GetFileInformationByHandleEx( |
| 195 | in_hFile: HANDLE, | 195 | in_hFile: HANDLE, |
| 196 | in_FileInformationClass: FILE_INFO_BY_HANDLE_CLASS, | 196 | in_FileInformationClass: FILE_INFO_BY_HANDLE_CLASS, |
| 197 | out_lpFileInformation: *c_void, | 197 | out_lpFileInformation: *anyopaque, |
| 198 | in_dwBufferSize: DWORD, | 198 | in_dwBufferSize: DWORD, |
| 199 | ) callconv(WINAPI) BOOL; | 199 | ) callconv(WINAPI) BOOL; |
| 200 | 200 | ||
| ... | @@ -230,18 +230,18 @@ pub extern "kernel32" fn GetSystemTimeAsFileTime(*FILETIME) callconv(WINAPI) voi | ... | @@ -230,18 +230,18 @@ pub extern "kernel32" fn GetSystemTimeAsFileTime(*FILETIME) callconv(WINAPI) voi |
| 230 | 230 | ||
| 231 | pub extern "kernel32" fn HeapCreate(flOptions: DWORD, dwInitialSize: SIZE_T, dwMaximumSize: SIZE_T) callconv(WINAPI) ?HANDLE; | 231 | pub extern "kernel32" fn HeapCreate(flOptions: DWORD, dwInitialSize: SIZE_T, dwMaximumSize: SIZE_T) callconv(WINAPI) ?HANDLE; |
| 232 | pub extern "kernel32" fn HeapDestroy(hHeap: HANDLE) callconv(WINAPI) BOOL; | 232 | pub extern "kernel32" fn HeapDestroy(hHeap: HANDLE) callconv(WINAPI) BOOL; |
| 233 | pub extern "kernel32" fn HeapReAlloc(hHeap: HANDLE, dwFlags: DWORD, lpMem: *c_void, dwBytes: SIZE_T) callconv(WINAPI) ?*c_void; | 233 | pub extern "kernel32" fn HeapReAlloc(hHeap: HANDLE, dwFlags: DWORD, lpMem: *anyopaque, dwBytes: SIZE_T) callconv(WINAPI) ?*anyopaque; |
| 234 | pub extern "kernel32" fn HeapSize(hHeap: HANDLE, dwFlags: DWORD, lpMem: *const c_void) callconv(WINAPI) SIZE_T; | 234 | pub extern "kernel32" fn HeapSize(hHeap: HANDLE, dwFlags: DWORD, lpMem: *const anyopaque) callconv(WINAPI) SIZE_T; |
| 235 | pub extern "kernel32" fn HeapCompact(hHeap: HANDLE, dwFlags: DWORD) callconv(WINAPI) SIZE_T; | 235 | pub extern "kernel32" fn HeapCompact(hHeap: HANDLE, dwFlags: DWORD) callconv(WINAPI) SIZE_T; |
| 236 | pub extern "kernel32" fn HeapSummary(hHeap: HANDLE, dwFlags: DWORD, lpSummary: LPHEAP_SUMMARY) callconv(WINAPI) BOOL; | 236 | pub extern "kernel32" fn HeapSummary(hHeap: HANDLE, dwFlags: DWORD, lpSummary: LPHEAP_SUMMARY) callconv(WINAPI) BOOL; |
| 237 | 237 | ||
| 238 | pub extern "kernel32" fn GetStdHandle(in_nStdHandle: DWORD) callconv(WINAPI) ?HANDLE; | 238 | pub extern "kernel32" fn GetStdHandle(in_nStdHandle: DWORD) callconv(WINAPI) ?HANDLE; |
| 239 | 239 | ||
| 240 | pub extern "kernel32" fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) callconv(WINAPI) ?*c_void; | 240 | pub extern "kernel32" fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) callconv(WINAPI) ?*anyopaque; |
| 241 | 241 | ||
| 242 | pub extern "kernel32" fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: *c_void) callconv(WINAPI) BOOL; | 242 | pub extern "kernel32" fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: *anyopaque) callconv(WINAPI) BOOL; |
| 243 | 243 | ||
| 244 | pub extern "kernel32" fn HeapValidate(hHeap: HANDLE, dwFlags: DWORD, lpMem: ?*const c_void) callconv(WINAPI) BOOL; | 244 | pub extern "kernel32" fn HeapValidate(hHeap: HANDLE, dwFlags: DWORD, lpMem: ?*const anyopaque) callconv(WINAPI) BOOL; |
| 245 | 245 | ||
| 246 | pub extern "kernel32" fn VirtualAlloc(lpAddress: ?LPVOID, dwSize: SIZE_T, flAllocationType: DWORD, flProtect: DWORD) callconv(WINAPI) ?LPVOID; | 246 | pub extern "kernel32" fn VirtualAlloc(lpAddress: ?LPVOID, dwSize: SIZE_T, flAllocationType: DWORD, flProtect: DWORD) callconv(WINAPI) ?LPVOID; |
| 247 | pub extern "kernel32" fn VirtualFree(lpAddress: ?LPVOID, dwSize: SIZE_T, dwFreeType: DWORD) callconv(WINAPI) BOOL; | 247 | pub extern "kernel32" fn VirtualFree(lpAddress: ?LPVOID, dwSize: SIZE_T, dwFreeType: DWORD) callconv(WINAPI) BOOL; |
| ... | @@ -356,7 +356,7 @@ pub extern "kernel32" fn EnterCriticalSection(lpCriticalSection: *CRITICAL_SECTI | ... | @@ -356,7 +356,7 @@ pub extern "kernel32" fn EnterCriticalSection(lpCriticalSection: *CRITICAL_SECTI |
| 356 | pub extern "kernel32" fn LeaveCriticalSection(lpCriticalSection: *CRITICAL_SECTION) callconv(WINAPI) void; | 356 | pub extern "kernel32" fn LeaveCriticalSection(lpCriticalSection: *CRITICAL_SECTION) callconv(WINAPI) void; |
| 357 | pub extern "kernel32" fn DeleteCriticalSection(lpCriticalSection: *CRITICAL_SECTION) callconv(WINAPI) void; | 357 | pub extern "kernel32" fn DeleteCriticalSection(lpCriticalSection: *CRITICAL_SECTION) callconv(WINAPI) void; |
| 358 | 358 | ||
| 359 | pub extern "kernel32" fn InitOnceExecuteOnce(InitOnce: *INIT_ONCE, InitFn: INIT_ONCE_FN, Parameter: ?*c_void, Context: ?*c_void) callconv(WINAPI) BOOL; | 359 | pub extern "kernel32" fn InitOnceExecuteOnce(InitOnce: *INIT_ONCE, InitFn: INIT_ONCE_FN, Parameter: ?*anyopaque, Context: ?*anyopaque) callconv(WINAPI) BOOL; |
| 360 | 360 | ||
| 361 | pub extern "kernel32" fn K32EmptyWorkingSet(hProcess: HANDLE) callconv(WINAPI) BOOL; | 361 | pub extern "kernel32" fn K32EmptyWorkingSet(hProcess: HANDLE) callconv(WINAPI) BOOL; |
| 362 | pub extern "kernel32" fn K32EnumDeviceDrivers(lpImageBase: [*]LPVOID, cb: DWORD, lpcbNeeded: *DWORD) callconv(WINAPI) BOOL; | 362 | pub extern "kernel32" fn K32EnumDeviceDrivers(lpImageBase: [*]LPVOID, cb: DWORD, lpcbNeeded: *DWORD) callconv(WINAPI) BOOL; |
lib/std/os/windows/ntdll.zig+16-16| ... | @@ -29,13 +29,13 @@ pub extern "NtDll" fn RtlGetVersion( | ... | @@ -29,13 +29,13 @@ pub extern "NtDll" fn RtlGetVersion( |
| 29 | pub extern "NtDll" fn RtlCaptureStackBackTrace( | 29 | pub extern "NtDll" fn RtlCaptureStackBackTrace( |
| 30 | FramesToSkip: DWORD, | 30 | FramesToSkip: DWORD, |
| 31 | FramesToCapture: DWORD, | 31 | FramesToCapture: DWORD, |
| 32 | BackTrace: **c_void, | 32 | BackTrace: **anyopaque, |
| 33 | BackTraceHash: ?*DWORD, | 33 | BackTraceHash: ?*DWORD, |
| 34 | ) callconv(WINAPI) WORD; | 34 | ) callconv(WINAPI) WORD; |
| 35 | pub extern "NtDll" fn NtQueryInformationFile( | 35 | pub extern "NtDll" fn NtQueryInformationFile( |
| 36 | FileHandle: HANDLE, | 36 | FileHandle: HANDLE, |
| 37 | IoStatusBlock: *IO_STATUS_BLOCK, | 37 | IoStatusBlock: *IO_STATUS_BLOCK, |
| 38 | FileInformation: *c_void, | 38 | FileInformation: *anyopaque, |
| 39 | Length: ULONG, | 39 | Length: ULONG, |
| 40 | FileInformationClass: FILE_INFORMATION_CLASS, | 40 | FileInformationClass: FILE_INFORMATION_CLASS, |
| 41 | ) callconv(WINAPI) NTSTATUS; | 41 | ) callconv(WINAPI) NTSTATUS; |
| ... | @@ -62,17 +62,17 @@ pub extern "NtDll" fn NtCreateFile( | ... | @@ -62,17 +62,17 @@ pub extern "NtDll" fn NtCreateFile( |
| 62 | ShareAccess: ULONG, | 62 | ShareAccess: ULONG, |
| 63 | CreateDisposition: ULONG, | 63 | CreateDisposition: ULONG, |
| 64 | CreateOptions: ULONG, | 64 | CreateOptions: ULONG, |
| 65 | EaBuffer: ?*c_void, | 65 | EaBuffer: ?*anyopaque, |
| 66 | EaLength: ULONG, | 66 | EaLength: ULONG, |
| 67 | ) callconv(WINAPI) NTSTATUS; | 67 | ) callconv(WINAPI) NTSTATUS; |
| 68 | pub extern "NtDll" fn NtDeviceIoControlFile( | 68 | pub extern "NtDll" fn NtDeviceIoControlFile( |
| 69 | FileHandle: HANDLE, | 69 | FileHandle: HANDLE, |
| 70 | Event: ?HANDLE, | 70 | Event: ?HANDLE, |
| 71 | ApcRoutine: ?IO_APC_ROUTINE, | 71 | ApcRoutine: ?IO_APC_ROUTINE, |
| 72 | ApcContext: ?*c_void, | 72 | ApcContext: ?*anyopaque, |
| 73 | IoStatusBlock: *IO_STATUS_BLOCK, | 73 | IoStatusBlock: *IO_STATUS_BLOCK, |
| 74 | IoControlCode: ULONG, | 74 | IoControlCode: ULONG, |
| 75 | InputBuffer: ?*const c_void, | 75 | InputBuffer: ?*const anyopaque, |
| 76 | InputBufferLength: ULONG, | 76 | InputBufferLength: ULONG, |
| 77 | OutputBuffer: ?PVOID, | 77 | OutputBuffer: ?PVOID, |
| 78 | OutputBufferLength: ULONG, | 78 | OutputBufferLength: ULONG, |
| ... | @@ -81,10 +81,10 @@ pub extern "NtDll" fn NtFsControlFile( | ... | @@ -81,10 +81,10 @@ pub extern "NtDll" fn NtFsControlFile( |
| 81 | FileHandle: HANDLE, | 81 | FileHandle: HANDLE, |
| 82 | Event: ?HANDLE, | 82 | Event: ?HANDLE, |
| 83 | ApcRoutine: ?IO_APC_ROUTINE, | 83 | ApcRoutine: ?IO_APC_ROUTINE, |
| 84 | ApcContext: ?*c_void, | 84 | ApcContext: ?*anyopaque, |
| 85 | IoStatusBlock: *IO_STATUS_BLOCK, | 85 | IoStatusBlock: *IO_STATUS_BLOCK, |
| 86 | FsControlCode: ULONG, | 86 | FsControlCode: ULONG, |
| 87 | InputBuffer: ?*const c_void, | 87 | InputBuffer: ?*const anyopaque, |
| 88 | InputBufferLength: ULONG, | 88 | InputBufferLength: ULONG, |
| 89 | OutputBuffer: ?PVOID, | 89 | OutputBuffer: ?PVOID, |
| 90 | OutputBufferLength: ULONG, | 90 | OutputBufferLength: ULONG, |
| ... | @@ -102,9 +102,9 @@ pub extern "NtDll" fn NtQueryDirectoryFile( | ... | @@ -102,9 +102,9 @@ pub extern "NtDll" fn NtQueryDirectoryFile( |
| 102 | FileHandle: HANDLE, | 102 | FileHandle: HANDLE, |
| 103 | Event: ?HANDLE, | 103 | Event: ?HANDLE, |
| 104 | ApcRoutine: ?IO_APC_ROUTINE, | 104 | ApcRoutine: ?IO_APC_ROUTINE, |
| 105 | ApcContext: ?*c_void, | 105 | ApcContext: ?*anyopaque, |
| 106 | IoStatusBlock: *IO_STATUS_BLOCK, | 106 | IoStatusBlock: *IO_STATUS_BLOCK, |
| 107 | FileInformation: *c_void, | 107 | FileInformation: *anyopaque, |
| 108 | Length: ULONG, | 108 | Length: ULONG, |
| 109 | FileInformationClass: FILE_INFORMATION_CLASS, | 109 | FileInformationClass: FILE_INFORMATION_CLASS, |
| 110 | ReturnSingleEntry: BOOLEAN, | 110 | ReturnSingleEntry: BOOLEAN, |
| ... | @@ -121,14 +121,14 @@ pub extern "NtDll" fn NtCreateKeyedEvent( | ... | @@ -121,14 +121,14 @@ pub extern "NtDll" fn NtCreateKeyedEvent( |
| 121 | 121 | ||
| 122 | pub extern "NtDll" fn NtReleaseKeyedEvent( | 122 | pub extern "NtDll" fn NtReleaseKeyedEvent( |
| 123 | EventHandle: ?HANDLE, | 123 | EventHandle: ?HANDLE, |
| 124 | Key: ?*const c_void, | 124 | Key: ?*const anyopaque, |
| 125 | Alertable: BOOLEAN, | 125 | Alertable: BOOLEAN, |
| 126 | Timeout: ?*const LARGE_INTEGER, | 126 | Timeout: ?*const LARGE_INTEGER, |
| 127 | ) callconv(WINAPI) NTSTATUS; | 127 | ) callconv(WINAPI) NTSTATUS; |
| 128 | 128 | ||
| 129 | pub extern "NtDll" fn NtWaitForKeyedEvent( | 129 | pub extern "NtDll" fn NtWaitForKeyedEvent( |
| 130 | EventHandle: ?HANDLE, | 130 | EventHandle: ?HANDLE, |
| 131 | Key: ?*const c_void, | 131 | Key: ?*const anyopaque, |
| 132 | Alertable: BOOLEAN, | 132 | Alertable: BOOLEAN, |
| 133 | Timeout: ?*const LARGE_INTEGER, | 133 | Timeout: ?*const LARGE_INTEGER, |
| 134 | ) callconv(WINAPI) NTSTATUS; | 134 | ) callconv(WINAPI) NTSTATUS; |
| ... | @@ -144,16 +144,16 @@ pub extern "NtDll" fn NtQueryObject( | ... | @@ -144,16 +144,16 @@ pub extern "NtDll" fn NtQueryObject( |
| 144 | ) callconv(WINAPI) NTSTATUS; | 144 | ) callconv(WINAPI) NTSTATUS; |
| 145 | 145 | ||
| 146 | pub extern "NtDll" fn RtlWakeAddressAll( | 146 | pub extern "NtDll" fn RtlWakeAddressAll( |
| 147 | Address: ?*const c_void, | 147 | Address: ?*const anyopaque, |
| 148 | ) callconv(WINAPI) void; | 148 | ) callconv(WINAPI) void; |
| 149 | 149 | ||
| 150 | pub extern "NtDll" fn RtlWakeAddressSingle( | 150 | pub extern "NtDll" fn RtlWakeAddressSingle( |
| 151 | Address: ?*const c_void, | 151 | Address: ?*const anyopaque, |
| 152 | ) callconv(WINAPI) void; | 152 | ) callconv(WINAPI) void; |
| 153 | 153 | ||
| 154 | pub extern "NtDll" fn RtlWaitOnAddress( | 154 | pub extern "NtDll" fn RtlWaitOnAddress( |
| 155 | Address: ?*const c_void, | 155 | Address: ?*const anyopaque, |
| 156 | CompareAddress: ?*const c_void, | 156 | CompareAddress: ?*const anyopaque, |
| 157 | AddressSize: SIZE_T, | 157 | AddressSize: SIZE_T, |
| 158 | Timeout: ?*const LARGE_INTEGER, | 158 | Timeout: ?*const LARGE_INTEGER, |
| 159 | ) callconv(WINAPI) NTSTATUS; | 159 | ) callconv(WINAPI) NTSTATUS; |
| ... | @@ -162,7 +162,7 @@ pub extern "NtDll" fn NtLockFile( | ... | @@ -162,7 +162,7 @@ pub extern "NtDll" fn NtLockFile( |
| 162 | FileHandle: HANDLE, | 162 | FileHandle: HANDLE, |
| 163 | Event: ?HANDLE, | 163 | Event: ?HANDLE, |
| 164 | ApcRoutine: ?*IO_APC_ROUTINE, | 164 | ApcRoutine: ?*IO_APC_ROUTINE, |
| 165 | ApcContext: ?*c_void, | 165 | ApcContext: ?*anyopaque, |
| 166 | IoStatusBlock: *IO_STATUS_BLOCK, | 166 | IoStatusBlock: *IO_STATUS_BLOCK, |
| 167 | ByteOffset: *const LARGE_INTEGER, | 167 | ByteOffset: *const LARGE_INTEGER, |
| 168 | Length: *const LARGE_INTEGER, | 168 | Length: *const LARGE_INTEGER, |
lib/std/os/windows/user32.zig+2-2| ... | @@ -1280,7 +1280,7 @@ pub const WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPM | ... | @@ -1280,7 +1280,7 @@ pub const WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPM |
| 1280 | pub const CW_USEDEFAULT = @bitCast(i32, @as(u32, 0x80000000)); | 1280 | pub const CW_USEDEFAULT = @bitCast(i32, @as(u32, 0x80000000)); |
| 1281 | 1281 | ||
| 1282 | pub extern "user32" fn CreateWindowExA(dwExStyle: DWORD, lpClassName: [*:0]const u8, lpWindowName: [*:0]const u8, dwStyle: DWORD, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?LPVOID) callconv(WINAPI) ?HWND; | 1282 | pub extern "user32" fn CreateWindowExA(dwExStyle: DWORD, lpClassName: [*:0]const u8, lpWindowName: [*:0]const u8, dwStyle: DWORD, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?LPVOID) callconv(WINAPI) ?HWND; |
| 1283 | pub fn createWindowExA(dwExStyle: u32, lpClassName: [*:0]const u8, lpWindowName: [*:0]const u8, dwStyle: u32, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?*c_void) !HWND { | 1283 | pub fn createWindowExA(dwExStyle: u32, lpClassName: [*:0]const u8, lpWindowName: [*:0]const u8, dwStyle: u32, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?*anyopaque) !HWND { |
| 1284 | const window = CreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWindParent, hMenu, hInstance, lpParam); | 1284 | const window = CreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWindParent, hMenu, hInstance, lpParam); |
| 1285 | if (window) |win| return win; | 1285 | if (window) |win| return win; |
| 1286 | 1286 | ||
| ... | @@ -1293,7 +1293,7 @@ pub fn createWindowExA(dwExStyle: u32, lpClassName: [*:0]const u8, lpWindowName: | ... | @@ -1293,7 +1293,7 @@ pub fn createWindowExA(dwExStyle: u32, lpClassName: [*:0]const u8, lpWindowName: |
| 1293 | 1293 | ||
| 1294 | pub extern "user32" fn CreateWindowExW(dwExStyle: DWORD, lpClassName: [*:0]const u16, lpWindowName: [*:0]const u16, dwStyle: DWORD, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?LPVOID) callconv(WINAPI) ?HWND; | 1294 | pub extern "user32" fn CreateWindowExW(dwExStyle: DWORD, lpClassName: [*:0]const u16, lpWindowName: [*:0]const u16, dwStyle: DWORD, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?LPVOID) callconv(WINAPI) ?HWND; |
| 1295 | pub var pfnCreateWindowExW: @TypeOf(CreateWindowExW) = undefined; | 1295 | pub var pfnCreateWindowExW: @TypeOf(CreateWindowExW) = undefined; |
| 1296 | pub fn createWindowExW(dwExStyle: u32, lpClassName: [*:0]const u16, lpWindowName: [*:0]const u16, dwStyle: u32, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?*c_void) !HWND { | 1296 | pub fn createWindowExW(dwExStyle: u32, lpClassName: [*:0]const u16, lpWindowName: [*:0]const u16, dwStyle: u32, X: i32, Y: i32, nWidth: i32, nHeight: i32, hWindParent: ?HWND, hMenu: ?HMENU, hInstance: HINSTANCE, lpParam: ?*anyopaque) !HWND { |
| 1297 | const function = selectSymbol(CreateWindowExW, pfnCreateWindowExW, .win2k); | 1297 | const function = selectSymbol(CreateWindowExW, pfnCreateWindowExW, .win2k); |
| 1298 | const window = function(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWindParent, hMenu, hInstance, lpParam); | 1298 | const window = function(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWindParent, hMenu, hInstance, lpParam); |
| 1299 | if (window) |win| return win; | 1299 | if (window) |win| return win; |
lib/std/os/windows/ws2_32.zig+13-13| ... | @@ -1095,7 +1095,7 @@ pub const addrinfoexA = extern struct { | ... | @@ -1095,7 +1095,7 @@ pub const addrinfoexA = extern struct { |
| 1095 | ai_addrlen: usize, | 1095 | ai_addrlen: usize, |
| 1096 | ai_canonname: [*:0]u8, | 1096 | ai_canonname: [*:0]u8, |
| 1097 | ai_addr: *sockaddr, | 1097 | ai_addr: *sockaddr, |
| 1098 | ai_blob: *c_void, | 1098 | ai_blob: *anyopaque, |
| 1099 | ai_bloblen: usize, | 1099 | ai_bloblen: usize, |
| 1100 | ai_provider: *GUID, | 1100 | ai_provider: *GUID, |
| 1101 | ai_next: *addrinfoexA, | 1101 | ai_next: *addrinfoexA, |
| ... | @@ -1167,9 +1167,9 @@ pub const pollfd = extern struct { | ... | @@ -1167,9 +1167,9 @@ pub const pollfd = extern struct { |
| 1167 | }; | 1167 | }; |
| 1168 | 1168 | ||
| 1169 | pub const TRANSMIT_FILE_BUFFERS = extern struct { | 1169 | pub const TRANSMIT_FILE_BUFFERS = extern struct { |
| 1170 | Head: *c_void, | 1170 | Head: *anyopaque, |
| 1171 | HeadLength: u32, | 1171 | HeadLength: u32, |
| 1172 | Tail: *c_void, | 1172 | Tail: *anyopaque, |
| 1173 | TailLength: u32, | 1173 | TailLength: u32, |
| 1174 | }; | 1174 | }; |
| 1175 | 1175 | ||
| ... | @@ -1186,7 +1186,7 @@ pub const LPFN_TRANSMITFILE = fn ( | ... | @@ -1186,7 +1186,7 @@ pub const LPFN_TRANSMITFILE = fn ( |
| 1186 | pub const LPFN_ACCEPTEX = fn ( | 1186 | pub const LPFN_ACCEPTEX = fn ( |
| 1187 | sListenSocket: SOCKET, | 1187 | sListenSocket: SOCKET, |
| 1188 | sAcceptSocket: SOCKET, | 1188 | sAcceptSocket: SOCKET, |
| 1189 | lpOutputBuffer: *c_void, | 1189 | lpOutputBuffer: *anyopaque, |
| 1190 | dwReceiveDataLength: u32, | 1190 | dwReceiveDataLength: u32, |
| 1191 | dwLocalAddressLength: u32, | 1191 | dwLocalAddressLength: u32, |
| 1192 | dwRemoteAddressLength: u32, | 1192 | dwRemoteAddressLength: u32, |
| ... | @@ -1195,7 +1195,7 @@ pub const LPFN_ACCEPTEX = fn ( | ... | @@ -1195,7 +1195,7 @@ pub const LPFN_ACCEPTEX = fn ( |
| 1195 | ) callconv(WINAPI) BOOL; | 1195 | ) callconv(WINAPI) BOOL; |
| 1196 | 1196 | ||
| 1197 | pub const LPFN_GETACCEPTEXSOCKADDRS = fn ( | 1197 | pub const LPFN_GETACCEPTEXSOCKADDRS = fn ( |
| 1198 | lpOutputBuffer: *c_void, | 1198 | lpOutputBuffer: *anyopaque, |
| 1199 | dwReceiveDataLength: u32, | 1199 | dwReceiveDataLength: u32, |
| 1200 | dwLocalAddressLength: u32, | 1200 | dwLocalAddressLength: u32, |
| 1201 | dwRemoteAddressLength: u32, | 1201 | dwRemoteAddressLength: u32, |
| ... | @@ -2017,9 +2017,9 @@ pub extern "ws2_32" fn WSAHtons( | ... | @@ -2017,9 +2017,9 @@ pub extern "ws2_32" fn WSAHtons( |
| 2017 | pub extern "ws2_32" fn WSAIoctl( | 2017 | pub extern "ws2_32" fn WSAIoctl( |
| 2018 | s: SOCKET, | 2018 | s: SOCKET, |
| 2019 | dwIoControlCode: u32, | 2019 | dwIoControlCode: u32, |
| 2020 | lpvInBuffer: ?*const c_void, | 2020 | lpvInBuffer: ?*const anyopaque, |
| 2021 | cbInBuffer: u32, | 2021 | cbInBuffer: u32, |
| 2022 | lpvOutbuffer: ?*c_void, | 2022 | lpvOutbuffer: ?*anyopaque, |
| 2023 | cbOutbuffer: u32, | 2023 | cbOutbuffer: u32, |
| 2024 | lpcbBytesReturned: *u32, | 2024 | lpcbBytesReturned: *u32, |
| 2025 | lpOverlapped: ?*OVERLAPPED, | 2025 | lpOverlapped: ?*OVERLAPPED, |
| ... | @@ -2216,7 +2216,7 @@ pub extern "mswsock" fn TransmitFile( | ... | @@ -2216,7 +2216,7 @@ pub extern "mswsock" fn TransmitFile( |
| 2216 | pub extern "mswsock" fn AcceptEx( | 2216 | pub extern "mswsock" fn AcceptEx( |
| 2217 | sListenSocket: SOCKET, | 2217 | sListenSocket: SOCKET, |
| 2218 | sAcceptSocket: SOCKET, | 2218 | sAcceptSocket: SOCKET, |
| 2219 | lpOutputBuffer: *c_void, | 2219 | lpOutputBuffer: *anyopaque, |
| 2220 | dwReceiveDataLength: u32, | 2220 | dwReceiveDataLength: u32, |
| 2221 | dwLocalAddressLength: u32, | 2221 | dwLocalAddressLength: u32, |
| 2222 | dwRemoteAddressLength: u32, | 2222 | dwRemoteAddressLength: u32, |
| ... | @@ -2225,7 +2225,7 @@ pub extern "mswsock" fn AcceptEx( | ... | @@ -2225,7 +2225,7 @@ pub extern "mswsock" fn AcceptEx( |
| 2225 | ) callconv(WINAPI) BOOL; | 2225 | ) callconv(WINAPI) BOOL; |
| 2226 | 2226 | ||
| 2227 | pub extern "mswsock" fn GetAcceptExSockaddrs( | 2227 | pub extern "mswsock" fn GetAcceptExSockaddrs( |
| 2228 | lpOutputBuffer: *c_void, | 2228 | lpOutputBuffer: *anyopaque, |
| 2229 | dwReceiveDataLength: u32, | 2229 | dwReceiveDataLength: u32, |
| 2230 | dwLocalAddressLength: u32, | 2230 | dwLocalAddressLength: u32, |
| 2231 | dwRemoteAddressLength: u32, | 2231 | dwRemoteAddressLength: u32, |
| ... | @@ -2242,13 +2242,13 @@ pub extern "ws2_32" fn WSAProviderCompleteAsyncCall( | ... | @@ -2242,13 +2242,13 @@ pub extern "ws2_32" fn WSAProviderCompleteAsyncCall( |
| 2242 | 2242 | ||
| 2243 | pub extern "mswsock" fn EnumProtocolsA( | 2243 | pub extern "mswsock" fn EnumProtocolsA( |
| 2244 | lpiProtocols: ?*i32, | 2244 | lpiProtocols: ?*i32, |
| 2245 | lpProtocolBuffer: *c_void, | 2245 | lpProtocolBuffer: *anyopaque, |
| 2246 | lpdwBufferLength: *u32, | 2246 | lpdwBufferLength: *u32, |
| 2247 | ) callconv(WINAPI) i32; | 2247 | ) callconv(WINAPI) i32; |
| 2248 | 2248 | ||
| 2249 | pub extern "mswsock" fn EnumProtocolsW( | 2249 | pub extern "mswsock" fn EnumProtocolsW( |
| 2250 | lpiProtocols: ?*i32, | 2250 | lpiProtocols: ?*i32, |
| 2251 | lpProtocolBuffer: *c_void, | 2251 | lpProtocolBuffer: *anyopaque, |
| 2252 | lpdwBufferLength: *u32, | 2252 | lpdwBufferLength: *u32, |
| 2253 | ) callconv(WINAPI) i32; | 2253 | ) callconv(WINAPI) i32; |
| 2254 | 2254 | ||
| ... | @@ -2259,7 +2259,7 @@ pub extern "mswsock" fn GetAddressByNameA( | ... | @@ -2259,7 +2259,7 @@ pub extern "mswsock" fn GetAddressByNameA( |
| 2259 | lpiProtocols: ?*i32, | 2259 | lpiProtocols: ?*i32, |
| 2260 | dwResolution: u32, | 2260 | dwResolution: u32, |
| 2261 | lpServiceAsyncInfo: ?*SERVICE_ASYNC_INFO, | 2261 | lpServiceAsyncInfo: ?*SERVICE_ASYNC_INFO, |
| 2262 | lpCsaddrBuffer: *c_void, | 2262 | lpCsaddrBuffer: *anyopaque, |
| 2263 | lpAliasBuffer: ?[*:0]const u8, | 2263 | lpAliasBuffer: ?[*:0]const u8, |
| 2264 | lpdwAliasBufferLength: *u32, | 2264 | lpdwAliasBufferLength: *u32, |
| 2265 | ) callconv(WINAPI) i32; | 2265 | ) callconv(WINAPI) i32; |
| ... | @@ -2271,7 +2271,7 @@ pub extern "mswsock" fn GetAddressByNameW( | ... | @@ -2271,7 +2271,7 @@ pub extern "mswsock" fn GetAddressByNameW( |
| 2271 | lpiProtocols: ?*i32, | 2271 | lpiProtocols: ?*i32, |
| 2272 | dwResolution: u32, | 2272 | dwResolution: u32, |
| 2273 | lpServiceAsyncInfo: ?*SERVICE_ASYNC_INFO, | 2273 | lpServiceAsyncInfo: ?*SERVICE_ASYNC_INFO, |
| 2274 | lpCsaddrBuffer: *c_void, | 2274 | lpCsaddrBuffer: *anyopaque, |
| 2275 | ldwBufferLEngth: *u32, | 2275 | ldwBufferLEngth: *u32, |
| 2276 | lpAliasBuffer: ?[*:0]u16, | 2276 | lpAliasBuffer: ?[*:0]u16, |
| 2277 | lpdwAliasBufferLength: *u32, | 2277 | lpdwAliasBufferLength: *u32, |
lib/std/rand.zig+3-3| ... | @@ -29,8 +29,8 @@ pub const Xoshiro256 = @import("rand/Xoshiro256.zig"); | ... | @@ -29,8 +29,8 @@ pub const Xoshiro256 = @import("rand/Xoshiro256.zig"); |
| 29 | pub const Sfc64 = @import("rand/Sfc64.zig"); | 29 | pub const Sfc64 = @import("rand/Sfc64.zig"); |
| 30 | 30 | ||
| 31 | pub const Random = struct { | 31 | pub const Random = struct { |
| 32 | ptr: *c_void, | 32 | ptr: *anyopaque, |
| 33 | fillFn: fn (ptr: *c_void, buf: []u8) void, | 33 | fillFn: fn (ptr: *anyopaque, buf: []u8) void, |
| 34 | 34 | ||
| 35 | pub fn init(pointer: anytype, comptime fillFn: fn (ptr: @TypeOf(pointer), buf: []u8) void) Random { | 35 | pub fn init(pointer: anytype, comptime fillFn: fn (ptr: @TypeOf(pointer), buf: []u8) void) Random { |
| 36 | const Ptr = @TypeOf(pointer); | 36 | const Ptr = @TypeOf(pointer); |
| ... | @@ -38,7 +38,7 @@ pub const Random = struct { | ... | @@ -38,7 +38,7 @@ pub const Random = struct { |
| 38 | assert(@typeInfo(Ptr).Pointer.size == .One); // Must be a single-item pointer | 38 | assert(@typeInfo(Ptr).Pointer.size == .One); // Must be a single-item pointer |
| 39 | assert(@typeInfo(@typeInfo(Ptr).Pointer.child) == .Struct); // Must point to a struct | 39 | assert(@typeInfo(@typeInfo(Ptr).Pointer.child) == .Struct); // Must point to a struct |
| 40 | const gen = struct { | 40 | const gen = struct { |
| 41 | fn fill(ptr: *c_void, buf: []u8) void { | 41 | fn fill(ptr: *anyopaque, buf: []u8) void { |
| 42 | const alignment = @typeInfo(Ptr).Pointer.alignment; | 42 | const alignment = @typeInfo(Ptr).Pointer.alignment; |
| 43 | const self = @ptrCast(Ptr, @alignCast(alignment, ptr)); | 43 | const self = @ptrCast(Ptr, @alignCast(alignment, ptr)); |
| 44 | fillFn(self, buf); | 44 | fillFn(self, buf); |
lib/std/special/compiler_rt/emutls.zig+12-12| ... | @@ -20,7 +20,7 @@ comptime { | ... | @@ -20,7 +20,7 @@ comptime { |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | /// public entrypoint for generated code using EmulatedTLS | 22 | /// public entrypoint for generated code using EmulatedTLS |
| 23 | pub fn __emutls_get_address(control: *emutls_control) callconv(.C) *c_void { | 23 | pub fn __emutls_get_address(control: *emutls_control) callconv(.C) *anyopaque { |
| 24 | return control.getPointer(); | 24 | return control.getPointer(); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| ... | @@ -47,7 +47,7 @@ const simple_allocator = struct { | ... | @@ -47,7 +47,7 @@ const simple_allocator = struct { |
| 47 | pub fn advancedAlloc(alignment: u29, size: usize) [*]u8 { | 47 | pub fn advancedAlloc(alignment: u29, size: usize) [*]u8 { |
| 48 | const minimal_alignment = std.math.max(@alignOf(usize), alignment); | 48 | const minimal_alignment = std.math.max(@alignOf(usize), alignment); |
| 49 | 49 | ||
| 50 | var aligned_ptr: ?*c_void = undefined; | 50 | var aligned_ptr: ?*anyopaque = undefined; |
| 51 | if (std.c.posix_memalign(&aligned_ptr, minimal_alignment, size) != 0) { | 51 | if (std.c.posix_memalign(&aligned_ptr, minimal_alignment, size) != 0) { |
| 52 | abort(); | 52 | abort(); |
| 53 | } | 53 | } |
| ... | @@ -57,7 +57,7 @@ const simple_allocator = struct { | ... | @@ -57,7 +57,7 @@ const simple_allocator = struct { |
| 57 | 57 | ||
| 58 | /// Resize a slice. | 58 | /// Resize a slice. |
| 59 | pub fn reallocSlice(comptime T: type, slice: []T, len: usize) []T { | 59 | pub fn reallocSlice(comptime T: type, slice: []T, len: usize) []T { |
| 60 | var c_ptr: *c_void = @ptrCast(*c_void, slice.ptr); | 60 | var c_ptr: *anyopaque = @ptrCast(*anyopaque, slice.ptr); |
| 61 | var new_array: [*]T = @ptrCast([*]T, @alignCast( | 61 | var new_array: [*]T = @ptrCast([*]T, @alignCast( |
| 62 | @alignOf(T), | 62 | @alignOf(T), |
| 63 | std.c.realloc(c_ptr, @sizeOf(T) * len) orelse abort(), | 63 | std.c.realloc(c_ptr, @sizeOf(T) * len) orelse abort(), |
| ... | @@ -67,14 +67,14 @@ const simple_allocator = struct { | ... | @@ -67,14 +67,14 @@ const simple_allocator = struct { |
| 67 | 67 | ||
| 68 | /// Free a memory chunk allocated with simple_allocator. | 68 | /// Free a memory chunk allocated with simple_allocator. |
| 69 | pub fn free(ptr: anytype) void { | 69 | pub fn free(ptr: anytype) void { |
| 70 | std.c.free(@ptrCast(*c_void, ptr)); | 70 | std.c.free(@ptrCast(*anyopaque, ptr)); |
| 71 | } | 71 | } |
| 72 | }; | 72 | }; |
| 73 | 73 | ||
| 74 | /// Simple array of ?ObjectPointer with automatic resizing and | 74 | /// Simple array of ?ObjectPointer with automatic resizing and |
| 75 | /// automatic storage allocation. | 75 | /// automatic storage allocation. |
| 76 | const ObjectArray = struct { | 76 | const ObjectArray = struct { |
| 77 | const ObjectPointer = *c_void; | 77 | const ObjectPointer = *anyopaque; |
| 78 | 78 | ||
| 79 | // content of the array | 79 | // content of the array |
| 80 | slots: []?ObjectPointer, | 80 | slots: []?ObjectPointer, |
| ... | @@ -143,7 +143,7 @@ const ObjectArray = struct { | ... | @@ -143,7 +143,7 @@ const ObjectArray = struct { |
| 143 | @memset(data, 0, size); | 143 | @memset(data, 0, size); |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | self.slots[index] = @ptrCast(*c_void, data); | 146 | self.slots[index] = @ptrCast(*anyopaque, data); |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | return self.slots[index].?; | 149 | return self.slots[index].?; |
| ... | @@ -189,7 +189,7 @@ const current_thread_storage = struct { | ... | @@ -189,7 +189,7 @@ const current_thread_storage = struct { |
| 189 | 189 | ||
| 190 | /// Set casted thread specific value. | 190 | /// Set casted thread specific value. |
| 191 | fn setspecific(new: ?*ObjectArray) void { | 191 | fn setspecific(new: ?*ObjectArray) void { |
| 192 | if (std.c.pthread_setspecific(current_thread_storage.key, @ptrCast(*c_void, new)) != 0) { | 192 | if (std.c.pthread_setspecific(current_thread_storage.key, @ptrCast(*anyopaque, new)) != 0) { |
| 193 | abort(); | 193 | abort(); |
| 194 | } | 194 | } |
| 195 | } | 195 | } |
| ... | @@ -202,7 +202,7 @@ const current_thread_storage = struct { | ... | @@ -202,7 +202,7 @@ const current_thread_storage = struct { |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | /// Invoked by pthread specific destructor. the passed argument is the ObjectArray pointer. | 204 | /// Invoked by pthread specific destructor. the passed argument is the ObjectArray pointer. |
| 205 | fn deinit(arrayPtr: *c_void) callconv(.C) void { | 205 | fn deinit(arrayPtr: *anyopaque) callconv(.C) void { |
| 206 | var array = @ptrCast( | 206 | var array = @ptrCast( |
| 207 | *ObjectArray, | 207 | *ObjectArray, |
| 208 | @alignCast(@alignOf(ObjectArray), arrayPtr), | 208 | @alignCast(@alignOf(ObjectArray), arrayPtr), |
| ... | @@ -228,11 +228,11 @@ const emutls_control = extern struct { | ... | @@ -228,11 +228,11 @@ const emutls_control = extern struct { |
| 228 | index: usize, | 228 | index: usize, |
| 229 | 229 | ||
| 230 | // object address, when in single thread env (not used) | 230 | // object address, when in single thread env (not used) |
| 231 | address: *c_void, | 231 | address: *anyopaque, |
| 232 | }, | 232 | }, |
| 233 | 233 | ||
| 234 | // null or non-zero initial value for the object | 234 | // null or non-zero initial value for the object |
| 235 | default_value: ?*c_void, | 235 | default_value: ?*anyopaque, |
| 236 | 236 | ||
| 237 | // global Mutex used to serialize control.index initialization. | 237 | // global Mutex used to serialize control.index initialization. |
| 238 | var mutex: std.c.pthread_mutex_t = std.c.PTHREAD_MUTEX_INITIALIZER; | 238 | var mutex: std.c.pthread_mutex_t = std.c.PTHREAD_MUTEX_INITIALIZER; |
| ... | @@ -292,12 +292,12 @@ const emutls_control = extern struct { | ... | @@ -292,12 +292,12 @@ const emutls_control = extern struct { |
| 292 | .size = @sizeOf(T), | 292 | .size = @sizeOf(T), |
| 293 | .alignment = @alignOf(T), | 293 | .alignment = @alignOf(T), |
| 294 | .object = .{ .index = 0 }, | 294 | .object = .{ .index = 0 }, |
| 295 | .default_value = @ptrCast(?*c_void, default_value), | 295 | .default_value = @ptrCast(?*anyopaque, default_value), |
| 296 | }; | 296 | }; |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | /// Get the pointer on allocated storage for emutls variable. | 299 | /// Get the pointer on allocated storage for emutls variable. |
| 300 | pub fn getPointer(self: *emutls_control) *c_void { | 300 | pub fn getPointer(self: *emutls_control) *anyopaque { |
| 301 | // ensure current_thread_storage initialization is done | 301 | // ensure current_thread_storage initialization is done |
| 302 | current_thread_storage.init_once.call(); | 302 | current_thread_storage.init_once.call(); |
| 303 | 303 |
lib/std/start_windows_tls.zig+4-4| ... | @@ -31,10 +31,10 @@ comptime { | ... | @@ -31,10 +31,10 @@ comptime { |
| 31 | //}; | 31 | //}; |
| 32 | // This is the workaround because we can't do @ptrToInt at comptime like that. | 32 | // This is the workaround because we can't do @ptrToInt at comptime like that. |
| 33 | pub const IMAGE_TLS_DIRECTORY = extern struct { | 33 | pub const IMAGE_TLS_DIRECTORY = extern struct { |
| 34 | StartAddressOfRawData: *c_void, | 34 | StartAddressOfRawData: *anyopaque, |
| 35 | EndAddressOfRawData: *c_void, | 35 | EndAddressOfRawData: *anyopaque, |
| 36 | AddressOfIndex: *c_void, | 36 | AddressOfIndex: *anyopaque, |
| 37 | AddressOfCallBacks: *c_void, | 37 | AddressOfCallBacks: *anyopaque, |
| 38 | SizeOfZeroFill: u32, | 38 | SizeOfZeroFill: u32, |
| 39 | Characteristics: u32, | 39 | Characteristics: u32, |
| 40 | }; | 40 | }; |
lib/std/zig/c_builtins.zig+11-11| ... | @@ -129,7 +129,7 @@ pub inline fn __builtin_strcmp(s1: [*c]const u8, s2: [*c]const u8) c_int { | ... | @@ -129,7 +129,7 @@ pub inline fn __builtin_strcmp(s1: [*c]const u8, s2: [*c]const u8) c_int { |
| 129 | return @as(c_int, std.cstr.cmp(s1, s2)); | 129 | return @as(c_int, std.cstr.cmp(s1, s2)); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | pub inline fn __builtin_object_size(ptr: ?*const c_void, ty: c_int) usize { | 132 | pub inline fn __builtin_object_size(ptr: ?*const anyopaque, ty: c_int) usize { |
| 133 | _ = ptr; | 133 | _ = ptr; |
| 134 | // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html | 134 | // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html |
| 135 | // If it is not possible to determine which objects ptr points to at compile time, | 135 | // If it is not possible to determine which objects ptr points to at compile time, |
| ... | @@ -141,36 +141,36 @@ pub inline fn __builtin_object_size(ptr: ?*const c_void, ty: c_int) usize { | ... | @@ -141,36 +141,36 @@ pub inline fn __builtin_object_size(ptr: ?*const c_void, ty: c_int) usize { |
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | pub inline fn __builtin___memset_chk( | 143 | pub inline fn __builtin___memset_chk( |
| 144 | dst: ?*c_void, | 144 | dst: ?*anyopaque, |
| 145 | val: c_int, | 145 | val: c_int, |
| 146 | len: usize, | 146 | len: usize, |
| 147 | remaining: usize, | 147 | remaining: usize, |
| 148 | ) ?*c_void { | 148 | ) ?*anyopaque { |
| 149 | if (len > remaining) @panic("std.c.builtins.memset_chk called with len > remaining"); | 149 | if (len > remaining) @panic("std.c.builtins.memset_chk called with len > remaining"); |
| 150 | return __builtin_memset(dst, val, len); | 150 | return __builtin_memset(dst, val, len); |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | pub inline fn __builtin_memset(dst: ?*c_void, val: c_int, len: usize) ?*c_void { | 153 | pub inline fn __builtin_memset(dst: ?*anyopaque, val: c_int, len: usize) ?*anyopaque { |
| 154 | const dst_cast = @ptrCast([*c]u8, dst); | 154 | const dst_cast = @ptrCast([*c]u8, dst); |
| 155 | @memset(dst_cast, @bitCast(u8, @truncate(i8, val)), len); | 155 | @memset(dst_cast, @bitCast(u8, @truncate(i8, val)), len); |
| 156 | return dst; | 156 | return dst; |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | pub inline fn __builtin___memcpy_chk( | 159 | pub inline fn __builtin___memcpy_chk( |
| 160 | noalias dst: ?*c_void, | 160 | noalias dst: ?*anyopaque, |
| 161 | noalias src: ?*const c_void, | 161 | noalias src: ?*const anyopaque, |
| 162 | len: usize, | 162 | len: usize, |
| 163 | remaining: usize, | 163 | remaining: usize, |
| 164 | ) ?*c_void { | 164 | ) ?*anyopaque { |
| 165 | if (len > remaining) @panic("std.c.builtins.memcpy_chk called with len > remaining"); | 165 | if (len > remaining) @panic("std.c.builtins.memcpy_chk called with len > remaining"); |
| 166 | return __builtin_memcpy(dst, src, len); | 166 | return __builtin_memcpy(dst, src, len); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | pub inline fn __builtin_memcpy( | 169 | pub inline fn __builtin_memcpy( |
| 170 | noalias dst: ?*c_void, | 170 | noalias dst: ?*anyopaque, |
| 171 | noalias src: ?*const c_void, | 171 | noalias src: ?*const anyopaque, |
| 172 | len: usize, | 172 | len: usize, |
| 173 | ) ?*c_void { | 173 | ) ?*anyopaque { |
| 174 | const dst_cast = @ptrCast([*c]u8, dst); | 174 | const dst_cast = @ptrCast([*c]u8, dst); |
| 175 | const src_cast = @ptrCast([*c]const u8, src); | 175 | const src_cast = @ptrCast([*c]const u8, src); |
| 176 | 176 | ||
| ... | @@ -232,4 +232,4 @@ pub inline fn __builtin_isinf_sign(x: anytype) c_int { | ... | @@ -232,4 +232,4 @@ pub inline fn __builtin_isinf_sign(x: anytype) c_int { |
| 232 | // It is used in a run-translated-c test and a test-translate-c test to ensure that non-implemented | 232 | // It is used in a run-translated-c test and a test-translate-c test to ensure that non-implemented |
| 233 | // builtins are correctly demoted. If you implement __builtin_alloca_with_align, please update the | 233 | // builtins are correctly demoted. If you implement __builtin_alloca_with_align, please update the |
| 234 | // run-translated-c test and the test-translate-c test to use a different non-implemented builtin. | 234 | // run-translated-c test and the test-translate-c test to use a different non-implemented builtin. |
| 235 | // pub fn __builtin_alloca_with_align(size: usize, alignment: usize) callconv(.Inline) *c_void {} | 235 | // pub fn __builtin_alloca_with_align(size: usize, alignment: usize) callconv(.Inline) *anyopaque {} |
lib/std/zig/c_translation.zig+12-12| ... | @@ -110,15 +110,15 @@ test "cast" { | ... | @@ -110,15 +110,15 @@ test "cast" { |
| 110 | try testing.expectEqual(@intToPtr(*u8, 2), cast(*u8, @intToPtr(*const u8, 2))); | 110 | try testing.expectEqual(@intToPtr(*u8, 2), cast(*u8, @intToPtr(*const u8, 2))); |
| 111 | try testing.expectEqual(@intToPtr(*u8, 2), cast(*u8, @intToPtr(*volatile u8, 2))); | 111 | try testing.expectEqual(@intToPtr(*u8, 2), cast(*u8, @intToPtr(*volatile u8, 2))); |
| 112 | 112 | ||
| 113 | try testing.expectEqual(@intToPtr(?*c_void, 2), cast(?*c_void, @intToPtr(*u8, 2))); | 113 | try testing.expectEqual(@intToPtr(?*anyopaque, 2), cast(?*anyopaque, @intToPtr(*u8, 2))); |
| 114 | 114 | ||
| 115 | var foo: c_int = -1; | 115 | var foo: c_int = -1; |
| 116 | try testing.expect(cast(*c_void, -1) == @intToPtr(*c_void, @bitCast(usize, @as(isize, -1)))); | 116 | try testing.expect(cast(*anyopaque, -1) == @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -1)))); |
| 117 | try testing.expect(cast(*c_void, foo) == @intToPtr(*c_void, @bitCast(usize, @as(isize, -1)))); | 117 | try testing.expect(cast(*anyopaque, foo) == @intToPtr(*anyopaque, @bitCast(usize, @as(isize, -1)))); |
| 118 | try testing.expect(cast(?*c_void, -1) == @intToPtr(?*c_void, @bitCast(usize, @as(isize, -1)))); | 118 | try testing.expect(cast(?*anyopaque, -1) == @intToPtr(?*anyopaque, @bitCast(usize, @as(isize, -1)))); |
| 119 | try testing.expect(cast(?*c_void, foo) == @intToPtr(?*c_void, @bitCast(usize, @as(isize, -1)))); | 119 | try testing.expect(cast(?*anyopaque, foo) == @intToPtr(?*anyopaque, @bitCast(usize, @as(isize, -1)))); |
| 120 | 120 | ||
| 121 | const FnPtr = ?fn (*c_void) void; | 121 | const FnPtr = ?fn (*anyopaque) void; |
| 122 | try testing.expect(cast(FnPtr, 0) == @intToPtr(FnPtr, @as(usize, 0))); | 122 | try testing.expect(cast(FnPtr, 0) == @intToPtr(FnPtr, @as(usize, 0))); |
| 123 | try testing.expect(cast(FnPtr, foo) == @intToPtr(FnPtr, @bitCast(usize, @as(isize, -1)))); | 123 | try testing.expect(cast(FnPtr, foo) == @intToPtr(FnPtr, @bitCast(usize, @as(isize, -1)))); |
| 124 | } | 124 | } |
| ... | @@ -133,13 +133,13 @@ pub fn sizeof(target: anytype) usize { | ... | @@ -133,13 +133,13 @@ pub fn sizeof(target: anytype) usize { |
| 133 | // We cannot distinguish those types in Zig, so use pointer size. | 133 | // We cannot distinguish those types in Zig, so use pointer size. |
| 134 | return @sizeOf(T); | 134 | return @sizeOf(T); |
| 135 | }, | 135 | }, |
| 136 | .Null => return @sizeOf(*c_void), | 136 | .Null => return @sizeOf(*anyopaque), |
| 137 | .Void => { | 137 | .Void => { |
| 138 | // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. | 138 | // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. |
| 139 | return 1; | 139 | return 1; |
| 140 | }, | 140 | }, |
| 141 | .Opaque => { | 141 | .Opaque => { |
| 142 | if (T == c_void) { | 142 | if (T == anyopaque) { |
| 143 | // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. | 143 | // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. |
| 144 | return 1; | 144 | return 1; |
| 145 | } else { | 145 | } else { |
| ... | @@ -175,7 +175,7 @@ pub fn sizeof(target: anytype) usize { | ... | @@ -175,7 +175,7 @@ pub fn sizeof(target: anytype) usize { |
| 175 | // When zero sized pointers are removed, this case will no | 175 | // When zero sized pointers are removed, this case will no |
| 176 | // longer be reachable and can be deleted. | 176 | // longer be reachable and can be deleted. |
| 177 | if (@sizeOf(T) == 0) { | 177 | if (@sizeOf(T) == 0) { |
| 178 | return @sizeOf(*c_void); | 178 | return @sizeOf(*anyopaque); |
| 179 | } | 179 | } |
| 180 | return @sizeOf(T); | 180 | return @sizeOf(T); |
| 181 | }, | 181 | }, |
| ... | @@ -195,7 +195,7 @@ pub fn sizeof(target: anytype) usize { | ... | @@ -195,7 +195,7 @@ pub fn sizeof(target: anytype) usize { |
| 195 | test "sizeof" { | 195 | test "sizeof" { |
| 196 | const S = extern struct { a: u32 }; | 196 | const S = extern struct { a: u32 }; |
| 197 | 197 | ||
| 198 | const ptr_size = @sizeOf(*c_void); | 198 | const ptr_size = @sizeOf(*anyopaque); |
| 199 | 199 | ||
| 200 | try testing.expect(sizeof(u32) == 4); | 200 | try testing.expect(sizeof(u32) == 4); |
| 201 | try testing.expect(sizeof(@as(u32, 2)) == 4); | 201 | try testing.expect(sizeof(@as(u32, 2)) == 4); |
| ... | @@ -215,7 +215,7 @@ test "sizeof" { | ... | @@ -215,7 +215,7 @@ test "sizeof" { |
| 215 | try testing.expect(sizeof([*c]u32) == ptr_size); | 215 | try testing.expect(sizeof([*c]u32) == ptr_size); |
| 216 | try testing.expect(sizeof(?*u32) == ptr_size); | 216 | try testing.expect(sizeof(?*u32) == ptr_size); |
| 217 | try testing.expect(sizeof(?[*]u32) == ptr_size); | 217 | try testing.expect(sizeof(?[*]u32) == ptr_size); |
| 218 | try testing.expect(sizeof(*c_void) == ptr_size); | 218 | try testing.expect(sizeof(*anyopaque) == ptr_size); |
| 219 | try testing.expect(sizeof(*void) == ptr_size); | 219 | try testing.expect(sizeof(*void) == ptr_size); |
| 220 | try testing.expect(sizeof(null) == ptr_size); | 220 | try testing.expect(sizeof(null) == ptr_size); |
| 221 | 221 | ||
| ... | @@ -230,7 +230,7 @@ test "sizeof" { | ... | @@ -230,7 +230,7 @@ test "sizeof" { |
| 230 | try testing.expect(sizeof(sizeof) == @sizeOf(@TypeOf(sizeof))); | 230 | try testing.expect(sizeof(sizeof) == @sizeOf(@TypeOf(sizeof))); |
| 231 | 231 | ||
| 232 | try testing.expect(sizeof(void) == 1); | 232 | try testing.expect(sizeof(void) == 1); |
| 233 | try testing.expect(sizeof(c_void) == 1); | 233 | try testing.expect(sizeof(anyopaque) == 1); |
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | pub const CIntLiteralRadix = enum { decimal, octal, hexadecimal }; | 236 | pub const CIntLiteralRadix = enum { decimal, octal, hexadecimal }; |
lib/std/zig/parser_test.zig+23| ... | @@ -87,6 +87,29 @@ test "zig fmt: rewrite @byteOffsetOf to @offsetOf" { | ... | @@ -87,6 +87,29 @@ test "zig fmt: rewrite @byteOffsetOf to @offsetOf" { |
| 87 | ); | 87 | ); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | // TODO Remove this after zig 0.10.0 is released. | ||
| 91 | test "zig fmt: rewrite c_void to anyopaque" { | ||
| 92 | try testTransform( | ||
| 93 | \\const Foo = struct { | ||
| 94 | \\ c_void: *c_void, | ||
| 95 | \\}; | ||
| 96 | \\ | ||
| 97 | \\fn foo(a: ?*c_void) !*c_void { | ||
| 98 | \\ return a orelse unreachable; | ||
| 99 | \\} | ||
| 100 | \\ | ||
| 101 | , | ||
| 102 | \\const Foo = struct { | ||
| 103 | \\ c_void: *anyopaque, | ||
| 104 | \\}; | ||
| 105 | \\ | ||
| 106 | \\fn foo(a: ?*anyopaque) !*anyopaque { | ||
| 107 | \\ return a orelse unreachable; | ||
| 108 | \\} | ||
| 109 | \\ | ||
| 110 | ); | ||
| 111 | } | ||
| 112 | |||
| 90 | test "zig fmt: simple top level comptime block" { | 113 | test "zig fmt: simple top level comptime block" { |
| 91 | try testCanonical( | 114 | try testCanonical( |
| 92 | \\// line comment | 115 | \\// line comment |
lib/std/zig/render.zig+22-5| ... | @@ -183,7 +183,21 @@ fn renderExpression(gpa: Allocator, ais: *Ais, tree: Ast, node: Ast.Node.Index, | ... | @@ -183,7 +183,21 @@ fn renderExpression(gpa: Allocator, ais: *Ais, tree: Ast, node: Ast.Node.Index, |
| 183 | const node_tags = tree.nodes.items(.tag); | 183 | const node_tags = tree.nodes.items(.tag); |
| 184 | const datas = tree.nodes.items(.data); | 184 | const datas = tree.nodes.items(.data); |
| 185 | switch (node_tags[node]) { | 185 | switch (node_tags[node]) { |
| 186 | .identifier, | 186 | // TODO remove this c_void -> anyopaque rewrite after the 0.10.0 release. |
| 187 | // Also get rid of renderSpace() as it will no longer be necessary. | ||
| 188 | .identifier => { | ||
| 189 | const token_index = main_tokens[node]; | ||
| 190 | |||
| 191 | const lexeme = tokenSliceForRender(tree, token_index); | ||
| 192 | if (mem.eql(u8, lexeme, "c_void")) { | ||
| 193 | try ais.writer().writeAll("anyopaque"); | ||
| 194 | } else { | ||
| 195 | try ais.writer().writeAll(lexeme); | ||
| 196 | } | ||
| 197 | |||
| 198 | return renderSpace(ais, tree, token_index, lexeme.len, space); | ||
| 199 | }, | ||
| 200 | |||
| 187 | .integer_literal, | 201 | .integer_literal, |
| 188 | .float_literal, | 202 | .float_literal, |
| 189 | .char_literal, | 203 | .char_literal, |
| ... | @@ -2284,13 +2298,16 @@ const Space = enum { | ... | @@ -2284,13 +2298,16 @@ const Space = enum { |
| 2284 | }; | 2298 | }; |
| 2285 | 2299 | ||
| 2286 | fn renderToken(ais: *Ais, tree: Ast, token_index: Ast.TokenIndex, space: Space) Error!void { | 2300 | fn renderToken(ais: *Ais, tree: Ast, token_index: Ast.TokenIndex, space: Space) Error!void { |
| 2301 | const lexeme = tokenSliceForRender(tree, token_index); | ||
| 2302 | try ais.writer().writeAll(lexeme); | ||
| 2303 | try renderSpace(ais, tree, token_index, lexeme.len, space); | ||
| 2304 | } | ||
| 2305 | |||
| 2306 | fn renderSpace(ais: *Ais, tree: Ast, token_index: Ast.TokenIndex, lexeme_len: usize, space: Space) Error!void { | ||
| 2287 | const token_tags = tree.tokens.items(.tag); | 2307 | const token_tags = tree.tokens.items(.tag); |
| 2288 | const token_starts = tree.tokens.items(.start); | 2308 | const token_starts = tree.tokens.items(.start); |
| 2289 | 2309 | ||
| 2290 | const token_start = token_starts[token_index]; | 2310 | const token_start = token_starts[token_index]; |
| 2291 | const lexeme = tokenSliceForRender(tree, token_index); | ||
| 2292 | |||
| 2293 | try ais.writer().writeAll(lexeme); | ||
| 2294 | 2311 | ||
| 2295 | if (space == .skip) return; | 2312 | if (space == .skip) return; |
| 2296 | 2313 | ||
| ... | @@ -2298,7 +2315,7 @@ fn renderToken(ais: *Ais, tree: Ast, token_index: Ast.TokenIndex, space: Space) | ... | @@ -2298,7 +2315,7 @@ fn renderToken(ais: *Ais, tree: Ast, token_index: Ast.TokenIndex, space: Space) |
| 2298 | try ais.writer().writeByte(','); | 2315 | try ais.writer().writeByte(','); |
| 2299 | } | 2316 | } |
| 2300 | 2317 | ||
| 2301 | const comment = try renderComments(ais, tree, token_start + lexeme.len, token_starts[token_index + 1]); | 2318 | const comment = try renderComments(ais, tree, token_start + lexeme_len, token_starts[token_index + 1]); |
| 2302 | switch (space) { | 2319 | switch (space) { |
| 2303 | .none => {}, | 2320 | .none => {}, |
| 2304 | .space => if (!comment) try ais.writer().writeByte(' '), | 2321 | .space => if (!comment) try ais.writer().writeByte(' '), |
src/AstGen.zig+2-2| ... | @@ -7597,6 +7597,7 @@ fn calleeExpr( | ... | @@ -7597,6 +7597,7 @@ fn calleeExpr( |
| 7597 | const primitives = std.ComptimeStringMap(Zir.Inst.Ref, .{ | 7597 | const primitives = std.ComptimeStringMap(Zir.Inst.Ref, .{ |
| 7598 | .{ "anyerror", .anyerror_type }, | 7598 | .{ "anyerror", .anyerror_type }, |
| 7599 | .{ "anyframe", .anyframe_type }, | 7599 | .{ "anyframe", .anyframe_type }, |
| 7600 | .{ "anyopaque", .anyopaque_type }, | ||
| 7600 | .{ "bool", .bool_type }, | 7601 | .{ "bool", .bool_type }, |
| 7601 | .{ "c_int", .c_int_type }, | 7602 | .{ "c_int", .c_int_type }, |
| 7602 | .{ "c_long", .c_long_type }, | 7603 | .{ "c_long", .c_long_type }, |
| ... | @@ -7607,7 +7608,6 @@ const primitives = std.ComptimeStringMap(Zir.Inst.Ref, .{ | ... | @@ -7607,7 +7608,6 @@ const primitives = std.ComptimeStringMap(Zir.Inst.Ref, .{ |
| 7607 | .{ "c_ulong", .c_ulong_type }, | 7608 | .{ "c_ulong", .c_ulong_type }, |
| 7608 | .{ "c_ulonglong", .c_ulonglong_type }, | 7609 | .{ "c_ulonglong", .c_ulonglong_type }, |
| 7609 | .{ "c_ushort", .c_ushort_type }, | 7610 | .{ "c_ushort", .c_ushort_type }, |
| 7610 | .{ "c_void", .c_void_type }, | ||
| 7611 | .{ "comptime_float", .comptime_float_type }, | 7611 | .{ "comptime_float", .comptime_float_type }, |
| 7612 | .{ "comptime_int", .comptime_int_type }, | 7612 | .{ "comptime_int", .comptime_int_type }, |
| 7613 | .{ "f128", .f128_type }, | 7613 | .{ "f128", .f128_type }, |
| ... | @@ -8324,7 +8324,7 @@ fn rvalue( | ... | @@ -8324,7 +8324,7 @@ fn rvalue( |
| 8324 | as_ty | @enumToInt(Zir.Inst.Ref.f32_type), | 8324 | as_ty | @enumToInt(Zir.Inst.Ref.f32_type), |
| 8325 | as_ty | @enumToInt(Zir.Inst.Ref.f64_type), | 8325 | as_ty | @enumToInt(Zir.Inst.Ref.f64_type), |
| 8326 | as_ty | @enumToInt(Zir.Inst.Ref.f128_type), | 8326 | as_ty | @enumToInt(Zir.Inst.Ref.f128_type), |
| 8327 | as_ty | @enumToInt(Zir.Inst.Ref.c_void_type), | 8327 | as_ty | @enumToInt(Zir.Inst.Ref.anyopaque_type), |
| 8328 | as_ty | @enumToInt(Zir.Inst.Ref.bool_type), | 8328 | as_ty | @enumToInt(Zir.Inst.Ref.bool_type), |
| 8329 | as_ty | @enumToInt(Zir.Inst.Ref.void_type), | 8329 | as_ty | @enumToInt(Zir.Inst.Ref.void_type), |
| 8330 | as_ty | @enumToInt(Zir.Inst.Ref.type_type), | 8330 | as_ty | @enumToInt(Zir.Inst.Ref.type_type), |
src/Sema.zig+4-4| ... | @@ -12354,9 +12354,9 @@ fn coerce( | ... | @@ -12354,9 +12354,9 @@ fn coerce( |
| 12354 | } | 12354 | } |
| 12355 | } | 12355 | } |
| 12356 | 12356 | ||
| 12357 | // cast from *T and [*]T to *c_void | 12357 | // cast from *T and [*]T to *anyopaque |
| 12358 | // but don't do it if the source type is a double pointer | 12358 | // but don't do it if the source type is a double pointer |
| 12359 | if (dest_info.pointee_type.tag() == .c_void and inst_ty.zigTypeTag() == .Pointer and | 12359 | if (dest_info.pointee_type.tag() == .anyopaque and inst_ty.zigTypeTag() == .Pointer and |
| 12360 | inst_ty.childType().zigTypeTag() != .Pointer) | 12360 | inst_ty.childType().zigTypeTag() != .Pointer) |
| 12361 | { | 12361 | { |
| 12362 | return sema.coerceCompatiblePtrs(block, dest_ty, inst, inst_src); | 12362 | return sema.coerceCompatiblePtrs(block, dest_ty, inst, inst_src); |
| ... | @@ -14809,7 +14809,7 @@ fn typeHasOnePossibleValue( | ... | @@ -14809,7 +14809,7 @@ fn typeHasOnePossibleValue( |
| 14809 | .const_slice_u8, | 14809 | .const_slice_u8, |
| 14810 | .const_slice, | 14810 | .const_slice, |
| 14811 | .mut_slice, | 14811 | .mut_slice, |
| 14812 | .c_void, | 14812 | .anyopaque, |
| 14813 | .optional, | 14813 | .optional, |
| 14814 | .optional_single_mut_pointer, | 14814 | .optional_single_mut_pointer, |
| 14815 | .optional_single_const_pointer, | 14815 | .optional_single_const_pointer, |
| ... | @@ -15026,7 +15026,7 @@ pub fn addType(sema: *Sema, ty: Type) !Air.Inst.Ref { | ... | @@ -15026,7 +15026,7 @@ pub fn addType(sema: *Sema, ty: Type) !Air.Inst.Ref { |
| 15026 | .f32 => return .f32_type, | 15026 | .f32 => return .f32_type, |
| 15027 | .f64 => return .f64_type, | 15027 | .f64 => return .f64_type, |
| 15028 | .f128 => return .f128_type, | 15028 | .f128 => return .f128_type, |
| 15029 | .c_void => return .c_void_type, | 15029 | .anyopaque => return .anyopaque_type, |
| 15030 | .bool => return .bool_type, | 15030 | .bool => return .bool_type, |
| 15031 | .void => return .void_type, | 15031 | .void => return .void_type, |
| 15032 | .type => return .type_type, | 15032 | .type => return .type_type, |
src/Zir.zig+3-3| ... | @@ -1632,7 +1632,7 @@ pub const Inst = struct { | ... | @@ -1632,7 +1632,7 @@ pub const Inst = struct { |
| 1632 | f32_type, | 1632 | f32_type, |
| 1633 | f64_type, | 1633 | f64_type, |
| 1634 | f128_type, | 1634 | f128_type, |
| 1635 | c_void_type, | 1635 | anyopaque_type, |
| 1636 | bool_type, | 1636 | bool_type, |
| 1637 | void_type, | 1637 | void_type, |
| 1638 | type_type, | 1638 | type_type, |
| ... | @@ -1805,9 +1805,9 @@ pub const Inst = struct { | ... | @@ -1805,9 +1805,9 @@ pub const Inst = struct { |
| 1805 | .ty = Type.initTag(.type), | 1805 | .ty = Type.initTag(.type), |
| 1806 | .val = Value.initTag(.f128_type), | 1806 | .val = Value.initTag(.f128_type), |
| 1807 | }, | 1807 | }, |
| 1808 | .c_void_type = .{ | 1808 | .anyopaque_type = .{ |
| 1809 | .ty = Type.initTag(.type), | 1809 | .ty = Type.initTag(.type), |
| 1810 | .val = Value.initTag(.c_void_type), | 1810 | .val = Value.initTag(.anyopaque_type), |
| 1811 | }, | 1811 | }, |
| 1812 | .bool_type = .{ | 1812 | .bool_type = .{ |
| 1813 | .ty = Type.initTag(.type), | 1813 | .ty = Type.initTag(.type), |
src/clang.zig+6-6| ... | @@ -9,7 +9,7 @@ pub const SourceLocation = extern struct { | ... | @@ -9,7 +9,7 @@ pub const SourceLocation = extern struct { |
| 9 | }; | 9 | }; |
| 10 | 10 | ||
| 11 | pub const QualType = extern struct { | 11 | pub const QualType = extern struct { |
| 12 | ptr: ?*c_void, | 12 | ptr: ?*anyopaque, |
| 13 | 13 | ||
| 14 | pub const getCanonicalType = ZigClangQualType_getCanonicalType; | 14 | pub const getCanonicalType = ZigClangQualType_getCanonicalType; |
| 15 | extern fn ZigClangQualType_getCanonicalType(QualType) QualType; | 15 | extern fn ZigClangQualType_getCanonicalType(QualType) QualType; |
| ... | @@ -37,7 +37,7 @@ pub const QualType = extern struct { | ... | @@ -37,7 +37,7 @@ pub const QualType = extern struct { |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | pub const APValueLValueBase = extern struct { | 39 | pub const APValueLValueBase = extern struct { |
| 40 | Ptr: ?*c_void, | 40 | Ptr: ?*anyopaque, |
| 41 | CallIndex: c_uint, | 41 | CallIndex: c_uint, |
| 42 | Version: c_uint, | 42 | Version: c_uint, |
| 43 | 43 | ||
| ... | @@ -85,7 +85,7 @@ pub const APValue = extern struct { | ... | @@ -85,7 +85,7 @@ pub const APValue = extern struct { |
| 85 | pub const ExprEvalResult = extern struct { | 85 | pub const ExprEvalResult = extern struct { |
| 86 | HasSideEffects: bool, | 86 | HasSideEffects: bool, |
| 87 | HasUndefinedBehavior: bool, | 87 | HasUndefinedBehavior: bool, |
| 88 | SmallVectorImpl: ?*c_void, | 88 | SmallVectorImpl: ?*anyopaque, |
| 89 | Val: APValue, | 89 | Val: APValue, |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
| ... | @@ -161,7 +161,7 @@ pub const ASTUnit = opaque { | ... | @@ -161,7 +161,7 @@ pub const ASTUnit = opaque { |
| 161 | extern fn ZigClangASTUnit_getSourceManager(*ASTUnit) *SourceManager; | 161 | extern fn ZigClangASTUnit_getSourceManager(*ASTUnit) *SourceManager; |
| 162 | 162 | ||
| 163 | pub const visitLocalTopLevelDecls = ZigClangASTUnit_visitLocalTopLevelDecls; | 163 | pub const visitLocalTopLevelDecls = ZigClangASTUnit_visitLocalTopLevelDecls; |
| 164 | extern fn ZigClangASTUnit_visitLocalTopLevelDecls(*ASTUnit, context: ?*c_void, Fn: ?fn (?*c_void, *const Decl) callconv(.C) bool) bool; | 164 | extern fn ZigClangASTUnit_visitLocalTopLevelDecls(*ASTUnit, context: ?*anyopaque, Fn: ?fn (?*anyopaque, *const Decl) callconv(.C) bool) bool; |
| 165 | 165 | ||
| 166 | pub const getLocalPreprocessingEntities_begin = ZigClangASTUnit_getLocalPreprocessingEntities_begin; | 166 | pub const getLocalPreprocessingEntities_begin = ZigClangASTUnit_getLocalPreprocessingEntities_begin; |
| 167 | extern fn ZigClangASTUnit_getLocalPreprocessingEntities_begin(*ASTUnit) PreprocessingRecord.iterator; | 167 | extern fn ZigClangASTUnit_getLocalPreprocessingEntities_begin(*ASTUnit) PreprocessingRecord.iterator; |
| ... | @@ -418,7 +418,7 @@ pub const EnumDecl = opaque { | ... | @@ -418,7 +418,7 @@ pub const EnumDecl = opaque { |
| 418 | extern fn ZigClangEnumDecl_enumerator_end(*const EnumDecl) enumerator_iterator; | 418 | extern fn ZigClangEnumDecl_enumerator_end(*const EnumDecl) enumerator_iterator; |
| 419 | 419 | ||
| 420 | pub const enumerator_iterator = extern struct { | 420 | pub const enumerator_iterator = extern struct { |
| 421 | ptr: *c_void, | 421 | ptr: *anyopaque, |
| 422 | 422 | ||
| 423 | pub const next = ZigClangEnumDecl_enumerator_iterator_next; | 423 | pub const next = ZigClangEnumDecl_enumerator_iterator_next; |
| 424 | extern fn ZigClangEnumDecl_enumerator_iterator_next(enumerator_iterator) enumerator_iterator; | 424 | extern fn ZigClangEnumDecl_enumerator_iterator_next(enumerator_iterator) enumerator_iterator; |
| ... | @@ -778,7 +778,7 @@ pub const RecordDecl = opaque { | ... | @@ -778,7 +778,7 @@ pub const RecordDecl = opaque { |
| 778 | extern fn ZigClangRecordDecl_field_end(*const RecordDecl) field_iterator; | 778 | extern fn ZigClangRecordDecl_field_end(*const RecordDecl) field_iterator; |
| 779 | 779 | ||
| 780 | pub const field_iterator = extern struct { | 780 | pub const field_iterator = extern struct { |
| 781 | ptr: *c_void, | 781 | ptr: *anyopaque, |
| 782 | 782 | ||
| 783 | pub const next = ZigClangRecordDecl_field_iterator_next; | 783 | pub const next = ZigClangRecordDecl_field_iterator_next; |
| 784 | extern fn ZigClangRecordDecl_field_iterator_next(field_iterator) field_iterator; | 784 | extern fn ZigClangRecordDecl_field_iterator_next(field_iterator) field_iterator; |
src/crash_report.zig+1-1| ... | @@ -179,7 +179,7 @@ pub fn attachSegfaultHandler() void { | ... | @@ -179,7 +179,7 @@ pub fn attachSegfaultHandler() void { |
| 179 | os.sigaction(os.SIG.BUS, &act, null); | 179 | os.sigaction(os.SIG.BUS, &act, null); |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const c_void) callconv(.C) noreturn { | 182 | fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const anyopaque) callconv(.C) noreturn { |
| 183 | // TODO: use alarm() here to prevent infinite loops | 183 | // TODO: use alarm() here to prevent infinite loops |
| 184 | PanicSwitch.preDispatch(); | 184 | PanicSwitch.preDispatch(); |
| 185 | 185 |
src/stage1/all_types.hpp+1-1| ... | @@ -2076,7 +2076,7 @@ struct CodeGen { | ... | @@ -2076,7 +2076,7 @@ struct CodeGen { |
| 2076 | ZigType *entry_bool; | 2076 | ZigType *entry_bool; |
| 2077 | ZigType *entry_c_int[CIntTypeCount]; | 2077 | ZigType *entry_c_int[CIntTypeCount]; |
| 2078 | ZigType *entry_c_longdouble; | 2078 | ZigType *entry_c_longdouble; |
| 2079 | ZigType *entry_c_void; | 2079 | ZigType *entry_anyopaque; |
| 2080 | ZigType *entry_u8; | 2080 | ZigType *entry_u8; |
| 2081 | ZigType *entry_u16; | 2081 | ZigType *entry_u16; |
| 2082 | ZigType *entry_u32; | 2082 | ZigType *entry_u32; |
src/stage1/codegen.cpp+3-3| ... | @@ -9014,9 +9014,9 @@ static void define_builtin_types(CodeGen *g) { | ... | @@ -9014,9 +9014,9 @@ static void define_builtin_types(CodeGen *g) { |
| 9014 | g->builtin_types.entry_i64 = get_int_type(g, true, 64); | 9014 | g->builtin_types.entry_i64 = get_int_type(g, true, 64); |
| 9015 | 9015 | ||
| 9016 | { | 9016 | { |
| 9017 | g->builtin_types.entry_c_void = get_opaque_type(g, nullptr, nullptr, "c_void", | 9017 | g->builtin_types.entry_anyopaque = get_opaque_type(g, nullptr, nullptr, "anyopaque", |
| 9018 | buf_create_from_str("c_void")); | 9018 | buf_create_from_str("anyopaque")); |
| 9019 | g->primitive_type_table.put(&g->builtin_types.entry_c_void->name, g->builtin_types.entry_c_void); | 9019 | g->primitive_type_table.put(&g->builtin_types.entry_anyopaque->name, g->builtin_types.entry_anyopaque); |
| 9020 | } | 9020 | } |
| 9021 | 9021 | ||
| 9022 | { | 9022 | { |
src/stage1/ir.cpp+3-3| ... | @@ -7884,18 +7884,18 @@ static Stage1AirInst *ir_analyze_cast(IrAnalyze *ira, Scope *scope, AstNode *sou | ... | @@ -7884,18 +7884,18 @@ static Stage1AirInst *ir_analyze_cast(IrAnalyze *ira, Scope *scope, AstNode *sou |
| 7884 | } | 7884 | } |
| 7885 | } | 7885 | } |
| 7886 | 7886 | ||
| 7887 | // cast from *T and [*]T to *c_void and ?*c_void | 7887 | // cast from *T and [*]T to *anyopaque and ?*anyopaque |
| 7888 | // but don't do it if the actual type is a double pointer | 7888 | // but don't do it if the actual type is a double pointer |
| 7889 | if (is_pointery_and_elem_is_not_pointery(actual_type)) { | 7889 | if (is_pointery_and_elem_is_not_pointery(actual_type)) { |
| 7890 | ZigType *dest_ptr_type = nullptr; | 7890 | ZigType *dest_ptr_type = nullptr; |
| 7891 | if (wanted_type->id == ZigTypeIdPointer && | 7891 | if (wanted_type->id == ZigTypeIdPointer && |
| 7892 | actual_type->id != ZigTypeIdOptional && | 7892 | actual_type->id != ZigTypeIdOptional && |
| 7893 | wanted_type->data.pointer.child_type == ira->codegen->builtin_types.entry_c_void) | 7893 | wanted_type->data.pointer.child_type == ira->codegen->builtin_types.entry_anyopaque) |
| 7894 | { | 7894 | { |
| 7895 | dest_ptr_type = wanted_type; | 7895 | dest_ptr_type = wanted_type; |
| 7896 | } else if (wanted_type->id == ZigTypeIdOptional && | 7896 | } else if (wanted_type->id == ZigTypeIdOptional && |
| 7897 | wanted_type->data.maybe.child_type->id == ZigTypeIdPointer && | 7897 | wanted_type->data.maybe.child_type->id == ZigTypeIdPointer && |
| 7898 | wanted_type->data.maybe.child_type->data.pointer.child_type == ira->codegen->builtin_types.entry_c_void) | 7898 | wanted_type->data.maybe.child_type->data.pointer.child_type == ira->codegen->builtin_types.entry_anyopaque) |
| 7899 | { | 7899 | { |
| 7900 | dest_ptr_type = wanted_type->data.maybe.child_type; | 7900 | dest_ptr_type = wanted_type->data.maybe.child_type; |
| 7901 | } | 7901 | } |
src/tracy.zig+8-8| ... | @@ -284,14 +284,14 @@ extern fn ___tracy_emit_zone_name(ctx: ___tracy_c_zone_context, txt: [*]const u8 | ... | @@ -284,14 +284,14 @@ extern fn ___tracy_emit_zone_name(ctx: ___tracy_c_zone_context, txt: [*]const u8 |
| 284 | extern fn ___tracy_emit_zone_color(ctx: ___tracy_c_zone_context, color: u32) void; | 284 | extern fn ___tracy_emit_zone_color(ctx: ___tracy_c_zone_context, color: u32) void; |
| 285 | extern fn ___tracy_emit_zone_value(ctx: ___tracy_c_zone_context, value: u64) void; | 285 | extern fn ___tracy_emit_zone_value(ctx: ___tracy_c_zone_context, value: u64) void; |
| 286 | extern fn ___tracy_emit_zone_end(ctx: ___tracy_c_zone_context) void; | 286 | extern fn ___tracy_emit_zone_end(ctx: ___tracy_c_zone_context) void; |
| 287 | extern fn ___tracy_emit_memory_alloc(ptr: *const c_void, size: usize, secure: c_int) void; | 287 | extern fn ___tracy_emit_memory_alloc(ptr: *const anyopaque, size: usize, secure: c_int) void; |
| 288 | extern fn ___tracy_emit_memory_alloc_callstack(ptr: *const c_void, size: usize, depth: c_int, secure: c_int) void; | 288 | extern fn ___tracy_emit_memory_alloc_callstack(ptr: *const anyopaque, size: usize, depth: c_int, secure: c_int) void; |
| 289 | extern fn ___tracy_emit_memory_free(ptr: *const c_void, secure: c_int) void; | 289 | extern fn ___tracy_emit_memory_free(ptr: *const anyopaque, secure: c_int) void; |
| 290 | extern fn ___tracy_emit_memory_free_callstack(ptr: *const c_void, depth: c_int, secure: c_int) void; | 290 | extern fn ___tracy_emit_memory_free_callstack(ptr: *const anyopaque, depth: c_int, secure: c_int) void; |
| 291 | extern fn ___tracy_emit_memory_alloc_named(ptr: *const c_void, size: usize, secure: c_int, name: [*:0]const u8) void; | 291 | extern fn ___tracy_emit_memory_alloc_named(ptr: *const anyopaque, size: usize, secure: c_int, name: [*:0]const u8) void; |
| 292 | extern fn ___tracy_emit_memory_alloc_callstack_named(ptr: *const c_void, size: usize, depth: c_int, secure: c_int, name: [*:0]const u8) void; | 292 | extern fn ___tracy_emit_memory_alloc_callstack_named(ptr: *const anyopaque, size: usize, depth: c_int, secure: c_int, name: [*:0]const u8) void; |
| 293 | extern fn ___tracy_emit_memory_free_named(ptr: *const c_void, secure: c_int, name: [*:0]const u8) void; | 293 | extern fn ___tracy_emit_memory_free_named(ptr: *const anyopaque, secure: c_int, name: [*:0]const u8) void; |
| 294 | extern fn ___tracy_emit_memory_free_callstack_named(ptr: *const c_void, depth: c_int, secure: c_int, name: [*:0]const u8) void; | 294 | extern fn ___tracy_emit_memory_free_callstack_named(ptr: *const anyopaque, depth: c_int, secure: c_int, name: [*:0]const u8) void; |
| 295 | extern fn ___tracy_emit_message(txt: [*]const u8, size: usize, callstack: c_int) void; | 295 | extern fn ___tracy_emit_message(txt: [*]const u8, size: usize, callstack: c_int) void; |
| 296 | extern fn ___tracy_emit_messageL(txt: [*:0]const u8, callstack: c_int) void; | 296 | extern fn ___tracy_emit_messageL(txt: [*:0]const u8, callstack: c_int) void; |
| 297 | extern fn ___tracy_emit_messageC(txt: [*]const u8, size: usize, color: u32, callstack: c_int) void; | 297 | extern fn ___tracy_emit_messageC(txt: [*]const u8, size: usize, color: u32, callstack: c_int) void; |
src/translate_c.zig+8-8| ... | @@ -448,13 +448,13 @@ fn prepopulateGlobalNameTable(ast_unit: *clang.ASTUnit, c: *Context) !void { | ... | @@ -448,13 +448,13 @@ fn prepopulateGlobalNameTable(ast_unit: *clang.ASTUnit, c: *Context) !void { |
| 448 | } | 448 | } |
| 449 | } | 449 | } |
| 450 | 450 | ||
| 451 | fn declVisitorNamesOnlyC(context: ?*c_void, decl: *const clang.Decl) callconv(.C) bool { | 451 | fn declVisitorNamesOnlyC(context: ?*anyopaque, decl: *const clang.Decl) callconv(.C) bool { |
| 452 | const c = @ptrCast(*Context, @alignCast(@alignOf(Context), context)); | 452 | const c = @ptrCast(*Context, @alignCast(@alignOf(Context), context)); |
| 453 | declVisitorNamesOnly(c, decl) catch return false; | 453 | declVisitorNamesOnly(c, decl) catch return false; |
| 454 | return true; | 454 | return true; |
| 455 | } | 455 | } |
| 456 | 456 | ||
| 457 | fn declVisitorC(context: ?*c_void, decl: *const clang.Decl) callconv(.C) bool { | 457 | fn declVisitorC(context: ?*anyopaque, decl: *const clang.Decl) callconv(.C) bool { |
| 458 | const c = @ptrCast(*Context, @alignCast(@alignOf(Context), context)); | 458 | const c = @ptrCast(*Context, @alignCast(@alignOf(Context), context)); |
| 459 | declVisitor(c, decl) catch return false; | 459 | declVisitor(c, decl) catch return false; |
| 460 | return true; | 460 | return true; |
| ... | @@ -698,7 +698,7 @@ fn visitFnDecl(c: *Context, fn_decl: *const clang.FunctionDecl) Error!void { | ... | @@ -698,7 +698,7 @@ fn visitFnDecl(c: *Context, fn_decl: *const clang.FunctionDecl) Error!void { |
| 698 | // add return statement if the function didn't have one | 698 | // add return statement if the function didn't have one |
| 699 | blk: { | 699 | blk: { |
| 700 | const maybe_body = try block_scope.complete(c); | 700 | const maybe_body = try block_scope.complete(c); |
| 701 | if (fn_ty.getNoReturnAttr() or isCVoid(return_qt) or maybe_body.isNoreturn(false)) { | 701 | if (fn_ty.getNoReturnAttr() or isAnyopaque(return_qt) or maybe_body.isNoreturn(false)) { |
| 702 | proto_node.data.body = maybe_body; | 702 | proto_node.data.body = maybe_body; |
| 703 | break :blk; | 703 | break :blk; |
| 704 | } | 704 | } |
| ... | @@ -4618,7 +4618,7 @@ fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clan | ... | @@ -4618,7 +4618,7 @@ fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clan |
| 4618 | .Builtin => { | 4618 | .Builtin => { |
| 4619 | const builtin_ty = @ptrCast(*const clang.BuiltinType, ty); | 4619 | const builtin_ty = @ptrCast(*const clang.BuiltinType, ty); |
| 4620 | return Tag.type.create(c.arena, switch (builtin_ty.getKind()) { | 4620 | return Tag.type.create(c.arena, switch (builtin_ty.getKind()) { |
| 4621 | .Void => "c_void", | 4621 | .Void => "anyopaque", |
| 4622 | .Bool => "bool", | 4622 | .Bool => "bool", |
| 4623 | .Char_U, .UChar, .Char_S, .Char8 => "u8", | 4623 | .Char_U, .UChar, .Char_S, .Char8 => "u8", |
| 4624 | .SChar => "i8", | 4624 | .SChar => "i8", |
| ... | @@ -4822,7 +4822,7 @@ fn qualTypeWasDemotedToOpaque(c: *Context, qt: clang.QualType) bool { | ... | @@ -4822,7 +4822,7 @@ fn qualTypeWasDemotedToOpaque(c: *Context, qt: clang.QualType) bool { |
| 4822 | } | 4822 | } |
| 4823 | } | 4823 | } |
| 4824 | 4824 | ||
| 4825 | fn isCVoid(qt: clang.QualType) bool { | 4825 | fn isAnyopaque(qt: clang.QualType) bool { |
| 4826 | const ty = qt.getTypePtr(); | 4826 | const ty = qt.getTypePtr(); |
| 4827 | if (ty.getTypeClass() == .Builtin) { | 4827 | if (ty.getTypeClass() == .Builtin) { |
| 4828 | const builtin_ty = @ptrCast(*const clang.BuiltinType, ty); | 4828 | const builtin_ty = @ptrCast(*const clang.BuiltinType, ty); |
| ... | @@ -4955,8 +4955,8 @@ fn finishTransFnProto( | ... | @@ -4955,8 +4955,8 @@ fn finishTransFnProto( |
| 4955 | break :blk Tag.noreturn_type.init(); | 4955 | break :blk Tag.noreturn_type.init(); |
| 4956 | } else { | 4956 | } else { |
| 4957 | const return_qt = fn_ty.getReturnType(); | 4957 | const return_qt = fn_ty.getReturnType(); |
| 4958 | if (isCVoid(return_qt)) { | 4958 | if (isAnyopaque(return_qt)) { |
| 4959 | // convert primitive c_void to actual void (only for return type) | 4959 | // convert primitive anyopaque to actual void (only for return type) |
| 4960 | break :blk Tag.void_type.init(); | 4960 | break :blk Tag.void_type.init(); |
| 4961 | } else { | 4961 | } else { |
| 4962 | break :blk transQualType(c, scope, return_qt, source_loc) catch |err| switch (err) { | 4962 | break :blk transQualType(c, scope, return_qt, source_loc) catch |err| switch (err) { |
| ... | @@ -6096,7 +6096,7 @@ fn parseCSpecifierQualifierList(c: *Context, m: *MacroCtx, scope: *Scope, allow_ | ... | @@ -6096,7 +6096,7 @@ fn parseCSpecifierQualifierList(c: *Context, m: *MacroCtx, scope: *Scope, allow_ |
| 6096 | return try Tag.identifier.create(c.arena, mangled_name); | 6096 | return try Tag.identifier.create(c.arena, mangled_name); |
| 6097 | } | 6097 | } |
| 6098 | }, | 6098 | }, |
| 6099 | .Keyword_void => return try Tag.type.create(c.arena, "c_void"), | 6099 | .Keyword_void => return try Tag.type.create(c.arena, "anyopaque"), |
| 6100 | .Keyword_bool => return try Tag.type.create(c.arena, "bool"), | 6100 | .Keyword_bool => return try Tag.type.create(c.arena, "bool"), |
| 6101 | .Keyword_char, | 6101 | .Keyword_char, |
| 6102 | .Keyword_int, | 6102 | .Keyword_int, |
src/type.zig+13-13| ... | @@ -68,7 +68,7 @@ pub const Type = extern union { | ... | @@ -68,7 +68,7 @@ pub const Type = extern union { |
| 68 | .error_set_merged, | 68 | .error_set_merged, |
| 69 | => return .ErrorSet, | 69 | => return .ErrorSet, |
| 70 | 70 | ||
| 71 | .c_void, .@"opaque" => return .Opaque, | 71 | .anyopaque, .@"opaque" => return .Opaque, |
| 72 | .bool => return .Bool, | 72 | .bool => return .Bool, |
| 73 | .void => return .Void, | 73 | .void => return .Void, |
| 74 | .type => return .Type, | 74 | .type => return .Type, |
| ... | @@ -764,7 +764,7 @@ pub const Type = extern union { | ... | @@ -764,7 +764,7 @@ pub const Type = extern union { |
| 764 | .c_longlong, | 764 | .c_longlong, |
| 765 | .c_ulonglong, | 765 | .c_ulonglong, |
| 766 | .c_longdouble, | 766 | .c_longdouble, |
| 767 | .c_void, | 767 | .anyopaque, |
| 768 | .f16, | 768 | .f16, |
| 769 | .f32, | 769 | .f32, |
| 770 | .f64, | 770 | .f64, |
| ... | @@ -965,7 +965,7 @@ pub const Type = extern union { | ... | @@ -965,7 +965,7 @@ pub const Type = extern union { |
| 965 | .c_longlong, | 965 | .c_longlong, |
| 966 | .c_ulonglong, | 966 | .c_ulonglong, |
| 967 | .c_longdouble, | 967 | .c_longdouble, |
| 968 | .c_void, | 968 | .anyopaque, |
| 969 | .f16, | 969 | .f16, |
| 970 | .f32, | 970 | .f32, |
| 971 | .f64, | 971 | .f64, |
| ... | @@ -1257,7 +1257,7 @@ pub const Type = extern union { | ... | @@ -1257,7 +1257,7 @@ pub const Type = extern union { |
| 1257 | .c_longlong, | 1257 | .c_longlong, |
| 1258 | .c_ulonglong, | 1258 | .c_ulonglong, |
| 1259 | .c_longdouble, | 1259 | .c_longdouble, |
| 1260 | .c_void, | 1260 | .anyopaque, |
| 1261 | .f16, | 1261 | .f16, |
| 1262 | .f32, | 1262 | .f32, |
| 1263 | .f64, | 1263 | .f64, |
| ... | @@ -1365,7 +1365,7 @@ pub const Type = extern union { | ... | @@ -1365,7 +1365,7 @@ pub const Type = extern union { |
| 1365 | .f32, | 1365 | .f32, |
| 1366 | .f64, | 1366 | .f64, |
| 1367 | .f128, | 1367 | .f128, |
| 1368 | .c_void, | 1368 | .anyopaque, |
| 1369 | .bool, | 1369 | .bool, |
| 1370 | .void, | 1370 | .void, |
| 1371 | .anyerror, | 1371 | .anyerror, |
| ... | @@ -1476,7 +1476,7 @@ pub const Type = extern union { | ... | @@ -1476,7 +1476,7 @@ pub const Type = extern union { |
| 1476 | .c_longlong => return Value.initTag(.c_longlong_type), | 1476 | .c_longlong => return Value.initTag(.c_longlong_type), |
| 1477 | .c_ulonglong => return Value.initTag(.c_ulonglong_type), | 1477 | .c_ulonglong => return Value.initTag(.c_ulonglong_type), |
| 1478 | .c_longdouble => return Value.initTag(.c_longdouble_type), | 1478 | .c_longdouble => return Value.initTag(.c_longdouble_type), |
| 1479 | .c_void => return Value.initTag(.c_void_type), | 1479 | .anyopaque => return Value.initTag(.anyopaque_type), |
| 1480 | .f16 => return Value.initTag(.f16_type), | 1480 | .f16 => return Value.initTag(.f16_type), |
| 1481 | .f32 => return Value.initTag(.f32_type), | 1481 | .f32 => return Value.initTag(.f32_type), |
| 1482 | .f64 => return Value.initTag(.f64_type), | 1482 | .f64 => return Value.initTag(.f64_type), |
| ... | @@ -1653,7 +1653,7 @@ pub const Type = extern union { | ... | @@ -1653,7 +1653,7 @@ pub const Type = extern union { |
| 1653 | return payload.error_set.hasCodeGenBits() or payload.payload.hasCodeGenBits(); | 1653 | return payload.error_set.hasCodeGenBits() or payload.payload.hasCodeGenBits(); |
| 1654 | }, | 1654 | }, |
| 1655 | 1655 | ||
| 1656 | .c_void, | 1656 | .anyopaque, |
| 1657 | .void, | 1657 | .void, |
| 1658 | .type, | 1658 | .type, |
| 1659 | .comptime_int, | 1659 | .comptime_int, |
| ... | @@ -1897,7 +1897,7 @@ pub const Type = extern union { | ... | @@ -1897,7 +1897,7 @@ pub const Type = extern union { |
| 1897 | 1897 | ||
| 1898 | .empty_struct, | 1898 | .empty_struct, |
| 1899 | .void, | 1899 | .void, |
| 1900 | .c_void, | 1900 | .anyopaque, |
| 1901 | => return 0, | 1901 | => return 0, |
| 1902 | 1902 | ||
| 1903 | .empty_struct_literal, | 1903 | .empty_struct_literal, |
| ... | @@ -1942,7 +1942,7 @@ pub const Type = extern union { | ... | @@ -1942,7 +1942,7 @@ pub const Type = extern union { |
| 1942 | .extern_options => unreachable, // missing call to resolveTypeFields | 1942 | .extern_options => unreachable, // missing call to resolveTypeFields |
| 1943 | .type_info => unreachable, // missing call to resolveTypeFields | 1943 | .type_info => unreachable, // missing call to resolveTypeFields |
| 1944 | 1944 | ||
| 1945 | .c_void, | 1945 | .anyopaque, |
| 1946 | .type, | 1946 | .type, |
| 1947 | .comptime_int, | 1947 | .comptime_int, |
| 1948 | .comptime_float, | 1948 | .comptime_float, |
| ... | @@ -2116,7 +2116,7 @@ pub const Type = extern union { | ... | @@ -2116,7 +2116,7 @@ pub const Type = extern union { |
| 2116 | .fn_naked_noreturn_no_args => unreachable, // represents machine code; not a pointer | 2116 | .fn_naked_noreturn_no_args => unreachable, // represents machine code; not a pointer |
| 2117 | .fn_ccc_void_no_args => unreachable, // represents machine code; not a pointer | 2117 | .fn_ccc_void_no_args => unreachable, // represents machine code; not a pointer |
| 2118 | .function => unreachable, // represents machine code; not a pointer | 2118 | .function => unreachable, // represents machine code; not a pointer |
| 2119 | .c_void => unreachable, | 2119 | .anyopaque => unreachable, |
| 2120 | .void => unreachable, | 2120 | .void => unreachable, |
| 2121 | .type => unreachable, | 2121 | .type => unreachable, |
| 2122 | .comptime_int => unreachable, | 2122 | .comptime_int => unreachable, |
| ... | @@ -3283,7 +3283,7 @@ pub const Type = extern union { | ... | @@ -3283,7 +3283,7 @@ pub const Type = extern union { |
| 3283 | .const_slice_u8, | 3283 | .const_slice_u8, |
| 3284 | .const_slice, | 3284 | .const_slice, |
| 3285 | .mut_slice, | 3285 | .mut_slice, |
| 3286 | .c_void, | 3286 | .anyopaque, |
| 3287 | .optional, | 3287 | .optional, |
| 3288 | .optional_single_mut_pointer, | 3288 | .optional_single_mut_pointer, |
| 3289 | .optional_single_const_pointer, | 3289 | .optional_single_const_pointer, |
| ... | @@ -3860,7 +3860,7 @@ pub const Type = extern union { | ... | @@ -3860,7 +3860,7 @@ pub const Type = extern union { |
| 3860 | f32, | 3860 | f32, |
| 3861 | f64, | 3861 | f64, |
| 3862 | f128, | 3862 | f128, |
| 3863 | c_void, | 3863 | anyopaque, |
| 3864 | bool, | 3864 | bool, |
| 3865 | void, | 3865 | void, |
| 3866 | type, | 3866 | type, |
| ... | @@ -3975,7 +3975,7 @@ pub const Type = extern union { | ... | @@ -3975,7 +3975,7 @@ pub const Type = extern union { |
| 3975 | .f32, | 3975 | .f32, |
| 3976 | .f64, | 3976 | .f64, |
| 3977 | .f128, | 3977 | .f128, |
| 3978 | .c_void, | 3978 | .anyopaque, |
| 3979 | .bool, | 3979 | .bool, |
| 3980 | .void, | 3980 | .void, |
| 3981 | .type, | 3981 | .type, |
src/value.zig+5-5| ... | @@ -48,7 +48,7 @@ pub const Value = extern union { | ... | @@ -48,7 +48,7 @@ pub const Value = extern union { |
| 48 | f32_type, | 48 | f32_type, |
| 49 | f64_type, | 49 | f64_type, |
| 50 | f128_type, | 50 | f128_type, |
| 51 | c_void_type, | 51 | anyopaque_type, |
| 52 | bool_type, | 52 | bool_type, |
| 53 | void_type, | 53 | void_type, |
| 54 | type_type, | 54 | type_type, |
| ... | @@ -204,7 +204,7 @@ pub const Value = extern union { | ... | @@ -204,7 +204,7 @@ pub const Value = extern union { |
| 204 | .f32_type, | 204 | .f32_type, |
| 205 | .f64_type, | 205 | .f64_type, |
| 206 | .f128_type, | 206 | .f128_type, |
| 207 | .c_void_type, | 207 | .anyopaque_type, |
| 208 | .bool_type, | 208 | .bool_type, |
| 209 | .void_type, | 209 | .void_type, |
| 210 | .type_type, | 210 | .type_type, |
| ... | @@ -395,7 +395,7 @@ pub const Value = extern union { | ... | @@ -395,7 +395,7 @@ pub const Value = extern union { |
| 395 | .f32_type, | 395 | .f32_type, |
| 396 | .f64_type, | 396 | .f64_type, |
| 397 | .f128_type, | 397 | .f128_type, |
| 398 | .c_void_type, | 398 | .anyopaque_type, |
| 399 | .bool_type, | 399 | .bool_type, |
| 400 | .void_type, | 400 | .void_type, |
| 401 | .type_type, | 401 | .type_type, |
| ... | @@ -625,7 +625,7 @@ pub const Value = extern union { | ... | @@ -625,7 +625,7 @@ pub const Value = extern union { |
| 625 | .f32_type => return out_stream.writeAll("f32"), | 625 | .f32_type => return out_stream.writeAll("f32"), |
| 626 | .f64_type => return out_stream.writeAll("f64"), | 626 | .f64_type => return out_stream.writeAll("f64"), |
| 627 | .f128_type => return out_stream.writeAll("f128"), | 627 | .f128_type => return out_stream.writeAll("f128"), |
| 628 | .c_void_type => return out_stream.writeAll("c_void"), | 628 | .anyopaque_type => return out_stream.writeAll("anyopaque"), |
| 629 | .bool_type => return out_stream.writeAll("bool"), | 629 | .bool_type => return out_stream.writeAll("bool"), |
| 630 | .void_type => return out_stream.writeAll("void"), | 630 | .void_type => return out_stream.writeAll("void"), |
| 631 | .type_type => return out_stream.writeAll("type"), | 631 | .type_type => return out_stream.writeAll("type"), |
| ... | @@ -804,7 +804,7 @@ pub const Value = extern union { | ... | @@ -804,7 +804,7 @@ pub const Value = extern union { |
| 804 | .f32_type => Type.initTag(.f32), | 804 | .f32_type => Type.initTag(.f32), |
| 805 | .f64_type => Type.initTag(.f64), | 805 | .f64_type => Type.initTag(.f64), |
| 806 | .f128_type => Type.initTag(.f128), | 806 | .f128_type => Type.initTag(.f128), |
| 807 | .c_void_type => Type.initTag(.c_void), | 807 | .anyopaque_type => Type.initTag(.anyopaque), |
| 808 | .bool_type => Type.initTag(.bool), | 808 | .bool_type => Type.initTag(.bool), |
| 809 | .void_type => Type.initTag(.void), | 809 | .void_type => Type.initTag(.void), |
| 810 | .type_type => Type.initTag(.type), | 810 | .type_type => Type.initTag(.type), |
test/behavior/async_fn.zig+2-2| ... | @@ -1631,9 +1631,9 @@ test "nosuspend resume async function calls" { | ... | @@ -1631,9 +1631,9 @@ test "nosuspend resume async function calls" { |
| 1631 | try expectEqual(@as(i32, 42), (try await frame_d).b); | 1631 | try expectEqual(@as(i32, 42), (try await frame_d).b); |
| 1632 | } | 1632 | } |
| 1633 | 1633 | ||
| 1634 | test "avoid forcing frame alignment resolution implicit cast to *c_void" { | 1634 | test "avoid forcing frame alignment resolution implicit cast to *anyopaque" { |
| 1635 | const S = struct { | 1635 | const S = struct { |
| 1636 | var x: ?*c_void = null; | 1636 | var x: ?*anyopaque = null; |
| 1637 | 1637 | ||
| 1638 | fn foo() bool { | 1638 | fn foo() bool { |
| 1639 | suspend { | 1639 | suspend { |
test/behavior/bugs/2578.zig+1-1| ... | @@ -5,7 +5,7 @@ const Foo = struct { | ... | @@ -5,7 +5,7 @@ const Foo = struct { |
| 5 | var foo: Foo = undefined; | 5 | var foo: Foo = undefined; |
| 6 | const t = &foo; | 6 | const t = &foo; |
| 7 | 7 | ||
| 8 | fn bar(pointer: ?*c_void) void { | 8 | fn bar(pointer: ?*anyopaque) void { |
| 9 | _ = pointer; | 9 | _ = pointer; |
| 10 | } | 10 | } |
| 11 | 11 |
test/behavior/cast_llvm.zig+10-10| ... | @@ -31,14 +31,14 @@ fn expectFloatToInt(comptime F: type, f: F, comptime I: type, i: I) !void { | ... | @@ -31,14 +31,14 @@ fn expectFloatToInt(comptime F: type, f: F, comptime I: type, i: I) !void { |
| 31 | try expect(@floatToInt(I, f) == i); | 31 | try expect(@floatToInt(I, f) == i); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | test "implicit cast from [*]T to ?*c_void" { | 34 | test "implicit cast from [*]T to ?*anyopaque" { |
| 35 | var a = [_]u8{ 3, 2, 1 }; | 35 | var a = [_]u8{ 3, 2, 1 }; |
| 36 | var runtime_zero: usize = 0; | 36 | var runtime_zero: usize = 0; |
| 37 | incrementVoidPtrArray(a[runtime_zero..].ptr, 3); | 37 | incrementVoidPtrArray(a[runtime_zero..].ptr, 3); |
| 38 | try expect(std.mem.eql(u8, &a, &[_]u8{ 4, 3, 2 })); | 38 | try expect(std.mem.eql(u8, &a, &[_]u8{ 4, 3, 2 })); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | fn incrementVoidPtrArray(array: ?*c_void, len: usize) void { | 41 | fn incrementVoidPtrArray(array: ?*anyopaque, len: usize) void { |
| 42 | var n: usize = 0; | 42 | var n: usize = 0; |
| 43 | while (n < len) : (n += 1) { | 43 | while (n < len) : (n += 1) { |
| 44 | @ptrCast([*]u8, array.?)[n] += 1; | 44 | @ptrCast([*]u8, array.?)[n] += 1; |
| ... | @@ -50,18 +50,18 @@ test "compile time int to ptr of function" { | ... | @@ -50,18 +50,18 @@ test "compile time int to ptr of function" { |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | pub const FUNCTION_CONSTANT = @intToPtr(PFN_void, maxInt(usize)); | 52 | pub const FUNCTION_CONSTANT = @intToPtr(PFN_void, maxInt(usize)); |
| 53 | pub const PFN_void = fn (*c_void) callconv(.C) void; | 53 | pub const PFN_void = fn (*anyopaque) callconv(.C) void; |
| 54 | 54 | ||
| 55 | fn foobar(func: PFN_void) !void { | 55 | fn foobar(func: PFN_void) !void { |
| 56 | try std.testing.expect(@ptrToInt(func) == maxInt(usize)); | 56 | try std.testing.expect(@ptrToInt(func) == maxInt(usize)); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | test "implicit ptr to *c_void" { | 59 | test "implicit ptr to *anyopaque" { |
| 60 | var a: u32 = 1; | 60 | var a: u32 = 1; |
| 61 | var ptr: *align(@alignOf(u32)) c_void = &a; | 61 | var ptr: *align(@alignOf(u32)) anyopaque = &a; |
| 62 | var b: *u32 = @ptrCast(*u32, ptr); | 62 | var b: *u32 = @ptrCast(*u32, ptr); |
| 63 | try expect(b.* == 1); | 63 | try expect(b.* == 1); |
| 64 | var ptr2: ?*align(@alignOf(u32)) c_void = &a; | 64 | var ptr2: ?*align(@alignOf(u32)) anyopaque = &a; |
| 65 | var c: *u32 = @ptrCast(*u32, ptr2.?); | 65 | var c: *u32 = @ptrCast(*u32, ptr2.?); |
| 66 | try expect(c.* == 1); | 66 | try expect(c.* == 1); |
| 67 | } | 67 | } |
| ... | @@ -135,13 +135,13 @@ test "implicit cast from *[N]T to ?[*]T" { | ... | @@ -135,13 +135,13 @@ test "implicit cast from *[N]T to ?[*]T" { |
| 135 | try expect(std.mem.eql(u16, x.?[0..4], y[0..4])); | 135 | try expect(std.mem.eql(u16, x.?[0..4], y[0..4])); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | test "implicit cast from *T to ?*c_void" { | 138 | test "implicit cast from *T to ?*anyopaque" { |
| 139 | var a: u8 = 1; | 139 | var a: u8 = 1; |
| 140 | incrementVoidPtrValue(&a); | 140 | incrementVoidPtrValue(&a); |
| 141 | try std.testing.expect(a == 2); | 141 | try std.testing.expect(a == 2); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | fn incrementVoidPtrValue(value: ?*c_void) void { | 144 | fn incrementVoidPtrValue(value: ?*anyopaque) void { |
| 145 | @ptrCast(*u8, value.?).* += 1; | 145 | @ptrCast(*u8, value.?).* += 1; |
| 146 | } | 146 | } |
| 147 | 147 | ||
| ... | @@ -188,8 +188,8 @@ test "cast between [*c]T and ?[*:0]T on fn parameter" { | ... | @@ -188,8 +188,8 @@ test "cast between [*c]T and ?[*:0]T on fn parameter" { |
| 188 | 188 | ||
| 189 | var global_struct: struct { f0: usize } = undefined; | 189 | var global_struct: struct { f0: usize } = undefined; |
| 190 | test "assignment to optional pointer result loc" { | 190 | test "assignment to optional pointer result loc" { |
| 191 | var foo: struct { ptr: ?*c_void } = .{ .ptr = &global_struct }; | 191 | var foo: struct { ptr: ?*anyopaque } = .{ .ptr = &global_struct }; |
| 192 | try expect(foo.ptr.? == @ptrCast(*c_void, &global_struct)); | 192 | try expect(foo.ptr.? == @ptrCast(*anyopaque, &global_struct)); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | test "cast between *[N]void and []void" { | 195 | test "cast between *[N]void and []void" { |
test/behavior/ptrcast_stage1.zig+2-2| ... | @@ -64,10 +64,10 @@ test "comptime ptrcast keeps larger alignment" { | ... | @@ -64,10 +64,10 @@ test "comptime ptrcast keeps larger alignment" { |
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | test "implicit optional pointer to optional c_void pointer" { | 67 | test "implicit optional pointer to optional anyopaque pointer" { |
| 68 | var buf: [4]u8 = "aoeu".*; | 68 | var buf: [4]u8 = "aoeu".*; |
| 69 | var x: ?[*]u8 = &buf; | 69 | var x: ?[*]u8 = &buf; |
| 70 | var y: ?*c_void = x; | 70 | var y: ?*anyopaque = x; |
| 71 | var z = @ptrCast(*[4]u8, y); | 71 | var z = @ptrCast(*[4]u8, y); |
| 72 | try expect(std.mem.eql(u8, z, "aoeu")); | 72 | try expect(std.mem.eql(u8, z, "aoeu")); |
| 73 | } | 73 | } |
test/behavior/translate_c_macros_stage1.zig+1-1| ... | @@ -22,5 +22,5 @@ test "reference to a struct type" { | ... | @@ -22,5 +22,5 @@ test "reference to a struct type" { |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | test "cast negative integer to pointer" { | 24 | test "cast negative integer to pointer" { |
| 25 | try expectEqual(@intToPtr(?*c_void, @bitCast(usize, @as(isize, -1))), h.MAP_FAILED); | 25 | try expectEqual(@intToPtr(?*anyopaque, @bitCast(usize, @as(isize, -1))), h.MAP_FAILED); |
| 26 | } | 26 | } |
test/behavior/type_info.zig+3-3| ... | @@ -227,13 +227,13 @@ fn testUnion() !void { | ... | @@ -227,13 +227,13 @@ fn testUnion() !void { |
| 227 | try expect(notag_union_info.Union.fields[1].alignment == @alignOf(u32)); | 227 | try expect(notag_union_info.Union.fields[1].alignment == @alignOf(u32)); |
| 228 | 228 | ||
| 229 | const TestExternUnion = extern union { | 229 | const TestExternUnion = extern union { |
| 230 | foo: *c_void, | 230 | foo: *anyopaque, |
| 231 | }; | 231 | }; |
| 232 | 232 | ||
| 233 | const extern_union_info = @typeInfo(TestExternUnion); | 233 | const extern_union_info = @typeInfo(TestExternUnion); |
| 234 | try expect(extern_union_info.Union.layout == .Extern); | 234 | try expect(extern_union_info.Union.layout == .Extern); |
| 235 | try expect(extern_union_info.Union.tag_type == null); | 235 | try expect(extern_union_info.Union.tag_type == null); |
| 236 | try expect(extern_union_info.Union.fields[0].field_type == *c_void); | 236 | try expect(extern_union_info.Union.fields[0].field_type == *anyopaque); |
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | test "type info: struct info" { | 239 | test "type info: struct info" { |
| ... | @@ -407,7 +407,7 @@ test "data field is a compile-time value" { | ... | @@ -407,7 +407,7 @@ test "data field is a compile-time value" { |
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | test "sentinel of opaque pointer type" { | 409 | test "sentinel of opaque pointer type" { |
| 410 | const c_void_info = @typeInfo(*c_void); | 410 | const c_void_info = @typeInfo(*anyopaque); |
| 411 | try expect(c_void_info.Pointer.sentinel == null); | 411 | try expect(c_void_info.Pointer.sentinel == null); |
| 412 | } | 412 | } |
| 413 | 413 |
test/compare_output.zig+2-2| ... | @@ -179,7 +179,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { | ... | @@ -179,7 +179,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 179 | cases.addC("expose function pointer to C land", | 179 | cases.addC("expose function pointer to C land", |
| 180 | \\const c = @cImport(@cInclude("stdlib.h")); | 180 | \\const c = @cImport(@cInclude("stdlib.h")); |
| 181 | \\ | 181 | \\ |
| 182 | \\export fn compare_fn(a: ?*const c_void, b: ?*const c_void) c_int { | 182 | \\export fn compare_fn(a: ?*const anyopaque, b: ?*const anyopaque) c_int { |
| 183 | \\ const a_int = @ptrCast(*const i32, @alignCast(@alignOf(i32), a)); | 183 | \\ const a_int = @ptrCast(*const i32, @alignCast(@alignOf(i32), a)); |
| 184 | \\ const b_int = @ptrCast(*const i32, @alignCast(@alignOf(i32), b)); | 184 | \\ const b_int = @ptrCast(*const i32, @alignCast(@alignOf(i32), b)); |
| 185 | \\ if (a_int.* < b_int.*) { | 185 | \\ if (a_int.* < b_int.*) { |
| ... | @@ -194,7 +194,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { | ... | @@ -194,7 +194,7 @@ pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 194 | \\pub export fn main() c_int { | 194 | \\pub export fn main() c_int { |
| 195 | \\ var array = [_]u32{ 1, 7, 3, 2, 0, 9, 4, 8, 6, 5 }; | 195 | \\ var array = [_]u32{ 1, 7, 3, 2, 0, 9, 4, 8, 6, 5 }; |
| 196 | \\ | 196 | \\ |
| 197 | \\ c.qsort(@ptrCast(?*c_void, &array), @intCast(c_ulong, array.len), @sizeOf(i32), compare_fn); | 197 | \\ c.qsort(@ptrCast(?*anyopaque, &array), @intCast(c_ulong, array.len), @sizeOf(i32), compare_fn); |
| 198 | \\ | 198 | \\ |
| 199 | \\ for (array) |item, i| { | 199 | \\ for (array) |item, i| { |
| 200 | \\ if (item != i) { | 200 | \\ if (item != i) { |
test/compile_errors.zig+18-18| ... | @@ -3058,10 +3058,10 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -3058,10 +3058,10 @@ pub fn addCases(ctx: *TestContext) !void { |
| 3058 | "tmp.zig:1:15: error: parameter of type 'anytype' not allowed in function with calling convention 'C'", | 3058 | "tmp.zig:1:15: error: parameter of type 'anytype' not allowed in function with calling convention 'C'", |
| 3059 | }); | 3059 | }); |
| 3060 | 3060 | ||
| 3061 | ctx.objErrStage1("C pointer to c_void", | 3061 | ctx.objErrStage1("C pointer to anyopaque", |
| 3062 | \\export fn a() void { | 3062 | \\export fn a() void { |
| 3063 | \\ var x: *c_void = undefined; | 3063 | \\ var x: *anyopaque = undefined; |
| 3064 | \\ var y: [*c]c_void = x; | 3064 | \\ var y: [*c]anyopaque = x; |
| 3065 | \\ _ = y; | 3065 | \\ _ = y; |
| 3066 | \\} | 3066 | \\} |
| 3067 | , &[_][]const u8{ | 3067 | , &[_][]const u8{ |
| ... | @@ -3305,7 +3305,7 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -3305,7 +3305,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 3305 | 3305 | ||
| 3306 | ctx.objErrStage1("compile log a pointer to an opaque value", | 3306 | ctx.objErrStage1("compile log a pointer to an opaque value", |
| 3307 | \\export fn entry() void { | 3307 | \\export fn entry() void { |
| 3308 | \\ @compileLog(@ptrCast(*const c_void, &entry)); | 3308 | \\ @compileLog(@ptrCast(*const anyopaque, &entry)); |
| 3309 | \\} | 3309 | \\} |
| 3310 | , &[_][]const u8{ | 3310 | , &[_][]const u8{ |
| 3311 | "tmp.zig:2:5: error: found compile log statement", | 3311 | "tmp.zig:2:5: error: found compile log statement", |
| ... | @@ -3465,16 +3465,16 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -3465,16 +3465,16 @@ pub fn addCases(ctx: *TestContext) !void { |
| 3465 | "tmp.zig:2:11: error: use of undeclared identifier 'SymbolThatDoesNotExist'", | 3465 | "tmp.zig:2:11: error: use of undeclared identifier 'SymbolThatDoesNotExist'", |
| 3466 | }); | 3466 | }); |
| 3467 | 3467 | ||
| 3468 | ctx.objErrStage1("don't implicit cast double pointer to *c_void", | 3468 | ctx.objErrStage1("don't implicit cast double pointer to *anyopaque", |
| 3469 | \\export fn entry() void { | 3469 | \\export fn entry() void { |
| 3470 | \\ var a: u32 = 1; | 3470 | \\ var a: u32 = 1; |
| 3471 | \\ var ptr: *align(@alignOf(u32)) c_void = &a; | 3471 | \\ var ptr: *align(@alignOf(u32)) anyopaque = &a; |
| 3472 | \\ var b: *u32 = @ptrCast(*u32, ptr); | 3472 | \\ var b: *u32 = @ptrCast(*u32, ptr); |
| 3473 | \\ var ptr2: *c_void = &b; | 3473 | \\ var ptr2: *anyopaque = &b; |
| 3474 | \\ _ = ptr2; | 3474 | \\ _ = ptr2; |
| 3475 | \\} | 3475 | \\} |
| 3476 | , &[_][]const u8{ | 3476 | , &[_][]const u8{ |
| 3477 | "tmp.zig:5:26: error: expected type '*c_void', found '**u32'", | 3477 | "tmp.zig:5:29: error: expected type '*anyopaque', found '**u32'", |
| 3478 | }); | 3478 | }); |
| 3479 | 3479 | ||
| 3480 | ctx.objErrStage1("runtime index into comptime type slice", | 3480 | ctx.objErrStage1("runtime index into comptime type slice", |
| ... | @@ -4045,9 +4045,9 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -4045,9 +4045,9 @@ pub fn addCases(ctx: *TestContext) !void { |
| 4045 | "tmp.zig:8:9: error: integer value '256' cannot be stored in type 'u8'", | 4045 | "tmp.zig:8:9: error: integer value '256' cannot be stored in type 'u8'", |
| 4046 | }); | 4046 | }); |
| 4047 | 4047 | ||
| 4048 | ctx.objErrStage1("use c_void as return type of fn ptr", | 4048 | ctx.objErrStage1("use anyopaque as return type of fn ptr", |
| 4049 | \\export fn entry() void { | 4049 | \\export fn entry() void { |
| 4050 | \\ const a: fn () c_void = undefined; | 4050 | \\ const a: fn () anyopaque = undefined; |
| 4051 | \\ _ = a; | 4051 | \\ _ = a; |
| 4052 | \\} | 4052 | \\} |
| 4053 | , &[_][]const u8{ | 4053 | , &[_][]const u8{ |
| ... | @@ -7469,10 +7469,10 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -7469,10 +7469,10 @@ pub fn addCases(ctx: *TestContext) !void { |
| 7469 | \\extern fn bar(d: *Derp) void; | 7469 | \\extern fn bar(d: *Derp) void; |
| 7470 | \\export fn foo() void { | 7470 | \\export fn foo() void { |
| 7471 | \\ var x = @as(u8, 1); | 7471 | \\ var x = @as(u8, 1); |
| 7472 | \\ bar(@ptrCast(*c_void, &x)); | 7472 | \\ bar(@ptrCast(*anyopaque, &x)); |
| 7473 | \\} | 7473 | \\} |
| 7474 | , &[_][]const u8{ | 7474 | , &[_][]const u8{ |
| 7475 | "tmp.zig:5:9: error: expected type '*Derp', found '*c_void'", | 7475 | "tmp.zig:5:9: error: expected type '*Derp', found '*anyopaque'", |
| 7476 | }); | 7476 | }); |
| 7477 | 7477 | ||
| 7478 | ctx.objErrStage1("non-const variables of things that require const variables", | 7478 | ctx.objErrStage1("non-const variables of things that require const variables", |
| ... | @@ -8765,10 +8765,10 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -8765,10 +8765,10 @@ pub fn addCases(ctx: *TestContext) !void { |
| 8765 | 8765 | ||
| 8766 | ctx.objErrStage1("integer underflow error", | 8766 | ctx.objErrStage1("integer underflow error", |
| 8767 | \\export fn entry() void { | 8767 | \\export fn entry() void { |
| 8768 | \\ _ = @intToPtr(*c_void, ~@as(usize, @import("std").math.maxInt(usize)) - 1); | 8768 | \\ _ = @intToPtr(*anyopaque, ~@as(usize, @import("std").math.maxInt(usize)) - 1); |
| 8769 | \\} | 8769 | \\} |
| 8770 | , &[_][]const u8{ | 8770 | , &[_][]const u8{ |
| 8771 | ":2:75: error: operation caused overflow", | 8771 | ":2:78: error: operation caused overflow", |
| 8772 | }); | 8772 | }); |
| 8773 | 8773 | ||
| 8774 | { | 8774 | { |
| ... | @@ -8864,14 +8864,14 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -8864,14 +8864,14 @@ pub fn addCases(ctx: *TestContext) !void { |
| 8864 | "tmp.zig:8:12: error: negation of type 'u32'", | 8864 | "tmp.zig:8:12: error: negation of type 'u32'", |
| 8865 | }); | 8865 | }); |
| 8866 | 8866 | ||
| 8867 | ctx.objErrStage1("Issue #5618: coercion of ?*c_void to *c_void must fail.", | 8867 | ctx.objErrStage1("Issue #5618: coercion of ?*anyopaque to *anyopaque must fail.", |
| 8868 | \\export fn foo() void { | 8868 | \\export fn foo() void { |
| 8869 | \\ var u: ?*c_void = null; | 8869 | \\ var u: ?*anyopaque = null; |
| 8870 | \\ var v: *c_void = undefined; | 8870 | \\ var v: *anyopaque = undefined; |
| 8871 | \\ v = u; | 8871 | \\ v = u; |
| 8872 | \\} | 8872 | \\} |
| 8873 | , &[_][]const u8{ | 8873 | , &[_][]const u8{ |
| 8874 | "tmp.zig:4:9: error: expected type '*c_void', found '?*c_void'", | 8874 | "tmp.zig:4:9: error: expected type '*anyopaque', found '?*anyopaque'", |
| 8875 | }); | 8875 | }); |
| 8876 | 8876 | ||
| 8877 | ctx.objErrStage1("Issue #6823: don't allow .* to be followed by **", | 8877 | ctx.objErrStage1("Issue #6823: don't allow .* to be followed by **", |
test/stage1/c_abi/main.zig+3-3| ... | @@ -97,13 +97,13 @@ export fn zig_f64(x: f64) void { | ... | @@ -97,13 +97,13 @@ export fn zig_f64(x: f64) void { |
| 97 | expect(x == 56.78) catch @panic("test failure"); | 97 | expect(x == 56.78) catch @panic("test failure"); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | extern fn c_ptr(*c_void) void; | 100 | extern fn c_ptr(*anyopaque) void; |
| 101 | 101 | ||
| 102 | test "C ABI pointer" { | 102 | test "C ABI pointer" { |
| 103 | c_ptr(@intToPtr(*c_void, 0xdeadbeef)); | 103 | c_ptr(@intToPtr(*anyopaque, 0xdeadbeef)); |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | export fn zig_ptr(x: *c_void) void { | 106 | export fn zig_ptr(x: *anyopaque) void { |
| 107 | expect(@ptrToInt(x) == 0xdeadbeef) catch @panic("test failure"); | 107 | expect(@ptrToInt(x) == 0xdeadbeef) catch @panic("test failure"); |
| 108 | } | 108 | } |
| 109 | 109 |
test/translate_c.zig+25-25| ... | @@ -99,7 +99,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -99,7 +99,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 99 | \\ .b = @import("std").mem.zeroes(struct_Bar), | 99 | \\ .b = @import("std").mem.zeroes(struct_Bar), |
| 100 | \\}; | 100 | \\}; |
| 101 | , | 101 | , |
| 102 | \\pub const PTR = ?*c_void; | 102 | \\pub const PTR = ?*anyopaque; |
| 103 | }); | 103 | }); |
| 104 | 104 | ||
| 105 | cases.add("scoped record", | 105 | cases.add("scoped record", |
| ... | @@ -199,8 +199,8 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -199,8 +199,8 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 199 | \\#define SYS_BASE_CACHED 0 | 199 | \\#define SYS_BASE_CACHED 0 |
| 200 | \\#define MEM_PHYSICAL_TO_K0(x) (void*)((uint32_t)(x) + SYS_BASE_CACHED) | 200 | \\#define MEM_PHYSICAL_TO_K0(x) (void*)((uint32_t)(x) + SYS_BASE_CACHED) |
| 201 | , &[_][]const u8{ | 201 | , &[_][]const u8{ |
| 202 | \\pub inline fn MEM_PHYSICAL_TO_K0(x: anytype) ?*c_void { | 202 | \\pub inline fn MEM_PHYSICAL_TO_K0(x: anytype) ?*anyopaque { |
| 203 | \\ return @import("std").zig.c_translation.cast(?*c_void, @import("std").zig.c_translation.cast(u32, x) + SYS_BASE_CACHED); | 203 | \\ return @import("std").zig.c_translation.cast(?*anyopaque, @import("std").zig.c_translation.cast(u32, x) + SYS_BASE_CACHED); |
| 204 | \\} | 204 | \\} |
| 205 | }); | 205 | }); |
| 206 | 206 | ||
| ... | @@ -511,9 +511,9 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -511,9 +511,9 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 511 | \\void ((f1)) (void *L); | 511 | \\void ((f1)) (void *L); |
| 512 | \\void (((f2))) (void *L); | 512 | \\void (((f2))) (void *L); |
| 513 | , &[_][]const u8{ | 513 | , &[_][]const u8{ |
| 514 | \\pub extern fn f0(L: ?*c_void) void; | 514 | \\pub extern fn f0(L: ?*anyopaque) void; |
| 515 | \\pub extern fn f1(L: ?*c_void) void; | 515 | \\pub extern fn f1(L: ?*anyopaque) void; |
| 516 | \\pub extern fn f2(L: ?*c_void) void; | 516 | \\pub extern fn f2(L: ?*anyopaque) void; |
| 517 | }); | 517 | }); |
| 518 | 518 | ||
| 519 | cases.add("array initializer w/ typedef", | 519 | cases.add("array initializer w/ typedef", |
| ... | @@ -812,7 +812,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -812,7 +812,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 812 | \\typedef void Foo; | 812 | \\typedef void Foo; |
| 813 | \\Foo fun(Foo *a); | 813 | \\Foo fun(Foo *a); |
| 814 | , &[_][]const u8{ | 814 | , &[_][]const u8{ |
| 815 | \\pub const Foo = c_void; | 815 | \\pub const Foo = anyopaque; |
| 816 | , | 816 | , |
| 817 | \\pub extern fn fun(a: ?*Foo) Foo; | 817 | \\pub extern fn fun(a: ?*Foo) Foo; |
| 818 | }); | 818 | }); |
| ... | @@ -837,7 +837,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -837,7 +837,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 837 | , &[_][]const u8{ | 837 | , &[_][]const u8{ |
| 838 | \\pub extern fn foo() void; | 838 | \\pub extern fn foo() void; |
| 839 | \\pub export fn bar() void { | 839 | \\pub export fn bar() void { |
| 840 | \\ var func_ptr: ?*c_void = @ptrCast(?*c_void, foo); | 840 | \\ var func_ptr: ?*anyopaque = @ptrCast(?*anyopaque, foo); |
| 841 | \\ var typed_func_ptr: ?fn () callconv(.C) void = @intToPtr(?fn () callconv(.C) void, @intCast(c_ulong, @ptrToInt(func_ptr))); | 841 | \\ var typed_func_ptr: ?fn () callconv(.C) void = @intToPtr(?fn () callconv(.C) void, @intCast(c_ulong, @ptrToInt(func_ptr))); |
| 842 | \\ _ = typed_func_ptr; | 842 | \\ _ = typed_func_ptr; |
| 843 | \\} | 843 | \\} |
| ... | @@ -1264,9 +1264,9 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -1264,9 +1264,9 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 1264 | \\ return x; | 1264 | \\ return x; |
| 1265 | \\} | 1265 | \\} |
| 1266 | , &[_][]const u8{ | 1266 | , &[_][]const u8{ |
| 1267 | \\pub export fn foo() ?*c_void { | 1267 | \\pub export fn foo() ?*anyopaque { |
| 1268 | \\ var x: [*c]c_ushort = undefined; | 1268 | \\ var x: [*c]c_ushort = undefined; |
| 1269 | \\ return @ptrCast(?*c_void, x); | 1269 | \\ return @ptrCast(?*anyopaque, x); |
| 1270 | \\} | 1270 | \\} |
| 1271 | }); | 1271 | }); |
| 1272 | 1272 | ||
| ... | @@ -1410,7 +1410,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -1410,7 +1410,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 1410 | \\} | 1410 | \\} |
| 1411 | , &[_][]const u8{ | 1411 | , &[_][]const u8{ |
| 1412 | \\pub export fn test_ptr_cast() void { | 1412 | \\pub export fn test_ptr_cast() void { |
| 1413 | \\ var p: ?*c_void = undefined; | 1413 | \\ var p: ?*anyopaque = undefined; |
| 1414 | \\ { | 1414 | \\ { |
| 1415 | \\ var to_char: [*c]u8 = @ptrCast([*c]u8, @alignCast(@import("std").meta.alignment(u8), p)); | 1415 | \\ var to_char: [*c]u8 = @ptrCast([*c]u8, @alignCast(@import("std").meta.alignment(u8), p)); |
| 1416 | \\ _ = to_char; | 1416 | \\ _ = to_char; |
| ... | @@ -1448,7 +1448,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -1448,7 +1448,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 1448 | \\pub export fn while_none_bool() c_int { | 1448 | \\pub export fn while_none_bool() c_int { |
| 1449 | \\ var a: c_int = undefined; | 1449 | \\ var a: c_int = undefined; |
| 1450 | \\ var b: f32 = undefined; | 1450 | \\ var b: f32 = undefined; |
| 1451 | \\ var c: ?*c_void = undefined; | 1451 | \\ var c: ?*anyopaque = undefined; |
| 1452 | \\ while (a != 0) return 0; | 1452 | \\ while (a != 0) return 0; |
| 1453 | \\ while (b != 0) return 1; | 1453 | \\ while (b != 0) return 1; |
| 1454 | \\ while (c != null) return 2; | 1454 | \\ while (c != null) return 2; |
| ... | @@ -1470,7 +1470,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -1470,7 +1470,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 1470 | \\pub export fn for_none_bool() c_int { | 1470 | \\pub export fn for_none_bool() c_int { |
| 1471 | \\ var a: c_int = undefined; | 1471 | \\ var a: c_int = undefined; |
| 1472 | \\ var b: f32 = undefined; | 1472 | \\ var b: f32 = undefined; |
| 1473 | \\ var c: ?*c_void = undefined; | 1473 | \\ var c: ?*anyopaque = undefined; |
| 1474 | \\ while (a != 0) return 0; | 1474 | \\ while (a != 0) return 0; |
| 1475 | \\ while (b != 0) return 1; | 1475 | \\ while (b != 0) return 1; |
| 1476 | \\ while (c != null) return 2; | 1476 | \\ while (c != null) return 2; |
| ... | @@ -1551,7 +1551,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -1551,7 +1551,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 1551 | \\pub export fn foo() c_int { | 1551 | \\pub export fn foo() c_int { |
| 1552 | \\ var a: c_int = undefined; | 1552 | \\ var a: c_int = undefined; |
| 1553 | \\ var b: f32 = undefined; | 1553 | \\ var b: f32 = undefined; |
| 1554 | \\ var c: ?*c_void = undefined; | 1554 | \\ var c: ?*anyopaque = undefined; |
| 1555 | \\ return @boolToInt(!(a == @as(c_int, 0))); | 1555 | \\ return @boolToInt(!(a == @as(c_int, 0))); |
| 1556 | \\ return @boolToInt(!(a != 0)); | 1556 | \\ return @boolToInt(!(a != 0)); |
| 1557 | \\ return @boolToInt(!(b != 0)); | 1557 | \\ return @boolToInt(!(b != 0)); |
| ... | @@ -2200,7 +2200,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -2200,7 +2200,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 2200 | cases.add("restrict -> noalias", | 2200 | cases.add("restrict -> noalias", |
| 2201 | \\void foo(void *restrict bar, void *restrict); | 2201 | \\void foo(void *restrict bar, void *restrict); |
| 2202 | , &[_][]const u8{ | 2202 | , &[_][]const u8{ |
| 2203 | \\pub extern fn foo(noalias bar: ?*c_void, noalias ?*c_void) void; | 2203 | \\pub extern fn foo(noalias bar: ?*anyopaque, noalias ?*anyopaque) void; |
| 2204 | }); | 2204 | }); |
| 2205 | 2205 | ||
| 2206 | cases.add("assign", | 2206 | cases.add("assign", |
| ... | @@ -2362,7 +2362,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -2362,7 +2362,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 2362 | ++ " " ++ default_enum_type ++ | 2362 | ++ " " ++ default_enum_type ++ |
| 2363 | \\; | 2363 | \\; |
| 2364 | \\pub const SomeTypedef = c_int; | 2364 | \\pub const SomeTypedef = c_int; |
| 2365 | \\pub export fn and_or_non_bool(arg_a: c_int, arg_b: f32, arg_c: ?*c_void) c_int { | 2365 | \\pub export fn and_or_non_bool(arg_a: c_int, arg_b: f32, arg_c: ?*anyopaque) c_int { |
| 2366 | \\ var a = arg_a; | 2366 | \\ var a = arg_a; |
| 2367 | \\ var b = arg_b; | 2367 | \\ var b = arg_b; |
| 2368 | \\ var c = arg_c; | 2368 | \\ var c = arg_c; |
| ... | @@ -2686,7 +2686,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -2686,7 +2686,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 2686 | \\pub const enum_SomeEnum = | 2686 | \\pub const enum_SomeEnum = |
| 2687 | ++ " " ++ default_enum_type ++ | 2687 | ++ " " ++ default_enum_type ++ |
| 2688 | \\; | 2688 | \\; |
| 2689 | \\pub export fn if_none_bool(arg_a: c_int, arg_b: f32, arg_c: ?*c_void, arg_d: enum_SomeEnum) c_int { | 2689 | \\pub export fn if_none_bool(arg_a: c_int, arg_b: f32, arg_c: ?*anyopaque, arg_d: enum_SomeEnum) c_int { |
| 2690 | \\ var a = arg_a; | 2690 | \\ var a = arg_a; |
| 2691 | \\ var b = arg_b; | 2691 | \\ var b = arg_b; |
| 2692 | \\ var c = arg_c; | 2692 | \\ var c = arg_c; |
| ... | @@ -3089,7 +3089,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -3089,7 +3089,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 3089 | \\pub extern fn fn_f64(x: f64) void; | 3089 | \\pub extern fn fn_f64(x: f64) void; |
| 3090 | \\pub extern fn fn_char(x: u8) void; | 3090 | \\pub extern fn fn_char(x: u8) void; |
| 3091 | \\pub extern fn fn_bool(x: bool) void; | 3091 | \\pub extern fn fn_bool(x: bool) void; |
| 3092 | \\pub extern fn fn_ptr(x: ?*c_void) void; | 3092 | \\pub extern fn fn_ptr(x: ?*anyopaque) void; |
| 3093 | \\pub export fn call() void { | 3093 | \\pub export fn call() void { |
| 3094 | \\ fn_int(@floatToInt(c_int, 3.0)); | 3094 | \\ fn_int(@floatToInt(c_int, 3.0)); |
| 3095 | \\ fn_int(@floatToInt(c_int, 3.0)); | 3095 | \\ fn_int(@floatToInt(c_int, 3.0)); |
| ... | @@ -3105,7 +3105,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -3105,7 +3105,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 3105 | \\ fn_bool(@as(c_int, 0) != 0); | 3105 | \\ fn_bool(@as(c_int, 0) != 0); |
| 3106 | \\ fn_bool(@ptrToInt(fn_int) != 0); | 3106 | \\ fn_bool(@ptrToInt(fn_int) != 0); |
| 3107 | \\ fn_int(@intCast(c_int, @ptrToInt(fn_int))); | 3107 | \\ fn_int(@intCast(c_int, @ptrToInt(fn_int))); |
| 3108 | \\ fn_ptr(@intToPtr(?*c_void, @as(c_int, 42))); | 3108 | \\ fn_ptr(@intToPtr(?*anyopaque, @as(c_int, 42))); |
| 3109 | \\} | 3109 | \\} |
| 3110 | }); | 3110 | }); |
| 3111 | 3111 | ||
| ... | @@ -3161,12 +3161,12 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -3161,12 +3161,12 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 3161 | \\#define BAZ (uint32_t)(2) | 3161 | \\#define BAZ (uint32_t)(2) |
| 3162 | \\#define a 2 | 3162 | \\#define a 2 |
| 3163 | , &[_][]const u8{ | 3163 | , &[_][]const u8{ |
| 3164 | \\pub inline fn FOO(bar: anytype) @TypeOf(baz(@import("std").zig.c_translation.cast(?*c_void, baz))) { | 3164 | \\pub inline fn FOO(bar: anytype) @TypeOf(baz(@import("std").zig.c_translation.cast(?*anyopaque, baz))) { |
| 3165 | \\ _ = bar; | 3165 | \\ _ = bar; |
| 3166 | \\ return baz(@import("std").zig.c_translation.cast(?*c_void, baz)); | 3166 | \\ return baz(@import("std").zig.c_translation.cast(?*anyopaque, baz)); |
| 3167 | \\} | 3167 | \\} |
| 3168 | , | 3168 | , |
| 3169 | \\pub const BAR = @import("std").zig.c_translation.cast(?*c_void, a); | 3169 | \\pub const BAR = @import("std").zig.c_translation.cast(?*anyopaque, a); |
| 3170 | , | 3170 | , |
| 3171 | \\pub const BAZ = @import("std").zig.c_translation.cast(u32, @as(c_int, 2)); | 3171 | \\pub const BAZ = @import("std").zig.c_translation.cast(u32, @as(c_int, 2)); |
| 3172 | }); | 3172 | }); |
| ... | @@ -3404,7 +3404,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -3404,7 +3404,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 3404 | \\#define NULL ((void*)0) | 3404 | \\#define NULL ((void*)0) |
| 3405 | \\#define FOO ((int)0x8000) | 3405 | \\#define FOO ((int)0x8000) |
| 3406 | , &[_][]const u8{ | 3406 | , &[_][]const u8{ |
| 3407 | \\pub const NULL = @import("std").zig.c_translation.cast(?*c_void, @as(c_int, 0)); | 3407 | \\pub const NULL = @import("std").zig.c_translation.cast(?*anyopaque, @as(c_int, 0)); |
| 3408 | , | 3408 | , |
| 3409 | \\pub const FOO = @import("std").zig.c_translation.cast(c_int, @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8000, .hexadecimal)); | 3409 | \\pub const FOO = @import("std").zig.c_translation.cast(c_int, @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8000, .hexadecimal)); |
| 3410 | }); | 3410 | }); |
| ... | @@ -3623,8 +3623,8 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -3623,8 +3623,8 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 3623 | \\typedef long long LONG_PTR; | 3623 | \\typedef long long LONG_PTR; |
| 3624 | \\#define INVALID_HANDLE_VALUE ((void *)(LONG_PTR)-1) | 3624 | \\#define INVALID_HANDLE_VALUE ((void *)(LONG_PTR)-1) |
| 3625 | , &[_][]const u8{ | 3625 | , &[_][]const u8{ |
| 3626 | \\pub const MAP_FAILED = @import("std").zig.c_translation.cast(?*c_void, -@as(c_int, 1)); | 3626 | \\pub const MAP_FAILED = @import("std").zig.c_translation.cast(?*anyopaque, -@as(c_int, 1)); |
| 3627 | \\pub const INVALID_HANDLE_VALUE = @import("std").zig.c_translation.cast(?*c_void, @import("std").zig.c_translation.cast(LONG_PTR, -@as(c_int, 1))); | 3627 | \\pub const INVALID_HANDLE_VALUE = @import("std").zig.c_translation.cast(?*anyopaque, @import("std").zig.c_translation.cast(LONG_PTR, -@as(c_int, 1))); |
| 3628 | }); | 3628 | }); |
| 3629 | 3629 | ||
| 3630 | cases.add("discard unused local variables and function parameters", | 3630 | cases.add("discard unused local variables and function parameters", |