Skip to content

Commit 3b9ac3d

Browse files
authored
defineCMacro -> module.addCMacro (#1)
1 parent 3247ffb commit 3b9ac3d

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

build.zig

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,31 @@ pub fn build(b: *std.Build) void {
5656
zstd.addAssemblyFile(upstream.path("lib/decompress/huf_decompress_amd64.S"));
5757
}
5858
} else {
59-
zstd.defineCMacro("ZSTD_DISABLE_ASM", null);
59+
zstd.root_module.addCMacro("ZSTD_DISABLE_ASM", "");
6060
}
6161

62-
zstd.defineCMacro("ZSTD_LEGACY_SUPPORT", b.fmt("{d}", .{legacy_support}));
63-
if (disable_assembly) zstd.defineCMacro("ZSTD_DISABLE_ASM", null);
64-
if (huf_force_decompress_x1) zstd.defineCMacro("HUF_FORCE_DECOMPRESS_X1", null);
65-
if (huf_force_decompress_x2) zstd.defineCMacro("HUF_FORCE_DECOMPRESS_X2", null);
66-
if (force_decompress_sequences_short) zstd.defineCMacro("ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT", null);
67-
if (force_decompress_sequences_long) zstd.defineCMacro("ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG", null);
68-
if (no_inline) zstd.defineCMacro("ZSTD_NO_INLINE", null);
69-
if (strip_error_strings) zstd.defineCMacro("ZSTD_STRIP_ERROR_STRINGS", null);
62+
zstd.root_module.addCMacro("ZSTD_LEGACY_SUPPORT", b.fmt("{d}", .{legacy_support}));
63+
if (disable_assembly) zstd.root_module.addCMacro("ZSTD_DISABLE_ASM", "");
64+
if (huf_force_decompress_x1) zstd.root_module.addCMacro("HUF_FORCE_DECOMPRESS_X1", "");
65+
if (huf_force_decompress_x2) zstd.root_module.addCMacro("HUF_FORCE_DECOMPRESS_X2", "");
66+
if (force_decompress_sequences_short) zstd.root_module.addCMacro("ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT", "");
67+
if (force_decompress_sequences_long) zstd.root_module.addCMacro("ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG", "");
68+
if (no_inline) zstd.root_module.addCMacro("ZSTD_NO_INLINE", "");
69+
if (strip_error_strings) zstd.root_module.addCMacro("ZSTD_STRIP_ERROR_STRINGS", "");
7070
if (exclude_compressors_dfast_and_up) {
71-
zstd.defineCMacro("ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR", null);
72-
zstd.defineCMacro("ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR", null);
73-
zstd.defineCMacro("ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR", null);
74-
zstd.defineCMacro("ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR", null);
75-
zstd.defineCMacro("ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR", null);
76-
zstd.defineCMacro("ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR", null);
71+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR", "");
72+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR", "");
73+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR", "");
74+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR", "");
75+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR", "");
76+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR", "");
7777
}
7878
if (exclude_compressors_greedy_and_up) {
79-
zstd.defineCMacro("ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR", null);
80-
zstd.defineCMacro("ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR", null);
81-
zstd.defineCMacro("ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR", null);
82-
zstd.defineCMacro("ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR", null);
83-
zstd.defineCMacro("ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR", null);
79+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_GREEDY_BLOCK_COMPRESSOR", "");
80+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_LAZY2_BLOCK_COMPRESSOR", "");
81+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR", "");
82+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR", "");
83+
zstd.root_module.addCMacro("ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR", "");
8484
}
8585

8686
{

0 commit comments

Comments
 (0)