| ... | ... | @@ -295,18 +295,12 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { |
| 295 | 295 | "o", &digest, final_def_basename, |
| 296 | 296 | }); |
| 297 | 297 | |
| 298 | | const target_defines = switch (target.cpu.arch) { |
| 299 | | .thumb => "#define DEF_ARM32\n", |
| 300 | | .aarch64 => "#define DEF_ARM64\n", |
| 301 | | .x86 => "#define DEF_I386\n", |
| 302 | | .x86_64 => "#define DEF_X64\n", |
| 303 | | else => unreachable, |
| 304 | | }; |
| 305 | | |
| 306 | 298 | const aro = @import("aro"); |
| 307 | 299 | var aro_comp = aro.Compilation.init(gpa, std.fs.cwd()); |
| 308 | 300 | defer aro_comp.deinit(); |
| 309 | 301 | |
| 302 | aro_comp.target = target; |
| 303 | |
| 310 | 304 | const include_dir = try comp.dirs.zig_lib.join(arena, &.{ "libc", "mingw", "def-include" }); |
| 311 | 305 | |
| 312 | 306 | if (comp.verbose_cc) print: { |
| ... | ... | @@ -321,7 +315,6 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { |
| 321 | 315 | try aro_comp.include_dirs.append(gpa, include_dir); |
| 322 | 316 | |
| 323 | 317 | const builtin_macros = try aro_comp.generateBuiltinMacros(.include_system_defines); |
| 324 | | const user_macros = try aro_comp.addSourceFromBuffer("<command line>", target_defines); |
| 325 | 318 | const def_file_source = try aro_comp.addSourceFromPath(def_file_path); |
| 326 | 319 | |
| 327 | 320 | var pp = aro.Preprocessor.init(&aro_comp); |
| ... | ... | @@ -329,7 +322,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { |
| 329 | 322 | pp.linemarkers = .none; |
| 330 | 323 | pp.preserve_whitespace = true; |
| 331 | 324 | |
| 332 | | try pp.preprocessSources(&.{ def_file_source, builtin_macros, user_macros }); |
| 325 | try pp.preprocessSources(&.{ def_file_source, builtin_macros }); |
| 333 | 326 | |
| 334 | 327 | for (aro_comp.diagnostics.list.items) |diagnostic| { |
| 335 | 328 | if (diagnostic.kind == .@"fatal error" or diagnostic.kind == .@"error") { |