coff: do not pull in std.log into coff.zig definitions

This commit is contained in:
Jakub Konka 2022-08-26 14:13:57 +02:00
parent 9038528187
commit 02e6960966
2 changed files with 33 additions and 40 deletions

View file

@ -841,10 +841,7 @@ pub const Coff = struct {
if (self.is_image) { if (self.is_image) {
self.coff_header_offset = coff_header_offset + 4; self.coff_header_offset = coff_header_offset + 4;
const coff_header = self.getCoffHeader(); const coff_header = self.getCoffHeader();
if (coff_header.size_of_optional_header == 0) { if (coff_header.size_of_optional_header == 0) return error.MissingPEHeader;
std.log.err("Required PE header missing for image file", .{});
return error.MissingPEHeader;
}
} }
// JK: we used to check for architecture here and throw an error if not x86 or derivative. // JK: we used to check for architecture here and throw an error if not x86 or derivative.

View file

@ -1,5 +1,4 @@
const std = @import("std"); const std = @import("std");
const builtin = @import("builtin");
const tests = @import("tests.zig"); const tests = @import("tests.zig");
const nl = std.cstr.line_sep; const nl = std.cstr.line_sep;
@ -1684,8 +1683,6 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {
// TODO: add isnan check for long double once bitfield support is added // TODO: add isnan check for long double once bitfield support is added
// (needed for x86_64-windows-gnu) // (needed for x86_64-windows-gnu)
// TODO: add isinf check for long double once std.math.isInf supports c_longdouble // TODO: add isinf check for long double once std.math.isInf supports c_longdouble
// TODO https://github.com/ziglang/zig/issues/12630
if (!(builtin.zig_backend == .stage2_llvm and builtin.target.os.tag == .windows)) {
cases.add("NAN and INFINITY", cases.add("NAN and INFINITY",
\\#include <math.h> \\#include <math.h>
\\#include <stdint.h> \\#include <stdint.h>
@ -1718,7 +1715,6 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {
\\ return 0; \\ return 0;
\\} \\}
, ""); , "");
}
cases.add("signed array subscript. Issue #8556", cases.add("signed array subscript. Issue #8556",
\\#include <stdint.h> \\#include <stdint.h>