mirror of https://github.com/libAthena/athena.git
Merge pull request #71 from lioncash/fmt
Global: Remove compatibility formatting define for size_t
This commit is contained in:
commit
ed83cc0f5e
|
@ -1,5 +1,7 @@
|
||||||
#include "test.hpp"
|
#include "test.hpp"
|
||||||
#include "athena/MemoryWriter.hpp"
|
|
||||||
|
#include <athena/MemoryWriter.hpp>
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#define EXPECTED_BYTES 281
|
#define EXPECTED_BYTES 281
|
||||||
|
|
||||||
|
@ -13,11 +15,14 @@ int main(int argc, const char** argv) {
|
||||||
athena::io::MemoryCopyWriter w(nullptr, binSize);
|
athena::io::MemoryCopyWriter w(nullptr, binSize);
|
||||||
atInt64 pos = w.position();
|
atInt64 pos = w.position();
|
||||||
file.write(w);
|
file.write(w);
|
||||||
bool pass = !w.hasError() && w.position() - pos == binSize && binSize == EXPECTED_BYTES;
|
|
||||||
if (pass)
|
const bool pass = !w.hasError() && w.position() - pos == binSize && binSize == EXPECTED_BYTES;
|
||||||
printf("[PASS] %" PRISize " bytes written\n", size_t(w.position() - pos));
|
if (pass) {
|
||||||
else
|
fmt::print(fmt("[PASS] {} bytes written\n"), size_t(w.position() - pos));
|
||||||
printf("[FAIL] %" PRISize " bytes written; %" PRISize " bytes sized; %d bytes expected\n",
|
} else {
|
||||||
size_t(w.position() - pos), binSize, EXPECTED_BYTES);
|
fmt::print(fmt("[FAIL] {} bytes written; {} bytes sized; {} bytes expected\n"), size_t(w.position() - pos), binSize,
|
||||||
|
EXPECTED_BYTES);
|
||||||
|
}
|
||||||
|
|
||||||
return pass ? 0 : 1;
|
return pass ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,14 +30,8 @@
|
||||||
#if !defined(S_ISLNK)
|
#if !defined(S_ISLNK)
|
||||||
#define S_ISLNK(m) 0
|
#define S_ISLNK(m) 0
|
||||||
#endif
|
#endif
|
||||||
|
#endif // _MSC_VER
|
||||||
|
|
||||||
#define PRISize "Iu"
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define PRISize "zu"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#ifndef AT_PRETTY_FUNCTION
|
#ifndef AT_PRETTY_FUNCTION
|
||||||
# if defined(__PRETTY_FUNCTION__) || defined(__GNUC__)
|
# if defined(__PRETTY_FUNCTION__) || defined(__GNUC__)
|
||||||
|
|
Loading…
Reference in New Issue