| ... | ... | @@ -142,7 +142,7 @@ pub const LinuxDynLib = struct { |
| 142 | 142 | self.* = undefined; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | | pub fn lookup(self: *LinuxDynLib, comptime T: type, name: []const u8) ?T { |
| 145 | pub fn lookup(self: *LinuxDynLib, comptime T: type, name: [:0]const u8) ?T { |
| 146 | 146 | if (self.elf_lib.lookup("", name)) |symbol| { |
| 147 | 147 | return @intToPtr(T, symbol); |
| 148 | 148 | } else { |
| ... | ... | @@ -292,7 +292,7 @@ pub const WindowsDynLib = struct { |
| 292 | 292 | self.* = undefined; |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | | pub fn lookup(self: *DlDynlib, comptime T: type, name: [:0]const u8) ?T { |
| 295 | pub fn lookup(self: *WindowsDynLib, comptime T: type, name: [:0]const u8) ?T { |
| 296 | 296 | if (windows.kernel32.GetProcAddress(self.dll, name.ptr)) |addr| { |
| 297 | 297 | return @ptrCast(T, addr); |
| 298 | 298 | } else { |
| ... | ... | @@ -324,7 +324,7 @@ pub const DlDynlib = struct { |
| 324 | 324 | self.* = undefined; |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | | pub fn lookup(self: *DlDynlib, comptime T: type, name: [*:0]const u8) ?T { |
| 327 | pub fn lookup(self: *DlDynlib, comptime T: type, name: [:0]const u8) ?T { |
| 328 | 328 | // dlsym (and other dl-functions) secretly take shadow parameter - return address on stack |
| 329 | 329 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66826 |
| 330 | 330 | if (@call(.{ .modifier = .never_tail }, system.dlsym, .{ self.handle, name.ptr })) |symbol| { |