mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Fix MinGW-related portability issues.
Create and use FMT* macros that are equivalent to the PRI* macros that inttypes.h defines. This allows uniform use of the Unix-specific format specifiers, e.g. "%zu", as well as avoiding Windows-specific definitions of e.g. PRIu64. Add ffs()/ffsl() support for compiling with gcc. Extract compatibility definitions of ENOENT, EINVAL, EAGAIN, EPERM, ENOMEM, and ENORANGE into include/msvc_compat/windows_extra.h and use the file for tests as well as for core jemalloc code.
This commit is contained in:
@@ -1543,13 +1543,13 @@ TEST_BEGIN(test_gen_rand_64)
|
||||
}
|
||||
r = gen_rand64(ctx);
|
||||
assert_u64_eq(r, array64[i],
|
||||
"Mismatch at array64[%d]=%"PRIx64", gen=%"PRIx64, i,
|
||||
"Mismatch at array64[%d]=%"FMTx64", gen=%"FMTx64, i,
|
||||
array64[i], r);
|
||||
}
|
||||
for (i = 0; i < COUNT_2; i++) {
|
||||
r = gen_rand64(ctx);
|
||||
assert_u64_eq(r, array64_2[i],
|
||||
"Mismatch at array64_2[%d]=%"PRIx64" gen=%"PRIx64"", i,
|
||||
"Mismatch at array64_2[%d]=%"FMTx64" gen=%"FMTx64"", i,
|
||||
array64_2[i], r);
|
||||
}
|
||||
fini_gen_rand(ctx);
|
||||
@@ -1580,13 +1580,13 @@ TEST_BEGIN(test_by_array_64)
|
||||
}
|
||||
r = gen_rand64(ctx);
|
||||
assert_u64_eq(r, array64[i],
|
||||
"Mismatch at array64[%d]=%"PRIx64" gen=%"PRIx64, i,
|
||||
"Mismatch at array64[%d]=%"FMTx64" gen=%"FMTx64, i,
|
||||
array64[i], r);
|
||||
}
|
||||
for (i = 0; i < COUNT_2; i++) {
|
||||
r = gen_rand64(ctx);
|
||||
assert_u64_eq(r, array64_2[i],
|
||||
"Mismatch at array64_2[%d]=%"PRIx64" gen=%"PRIx64, i,
|
||||
"Mismatch at array64_2[%d]=%"FMTx64" gen=%"FMTx64, i,
|
||||
array64_2[i], r);
|
||||
}
|
||||
fini_gen_rand(ctx);
|
||||
|
||||
Reference in New Issue
Block a user