summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorGravatar bunnei2018-04-27 11:09:56 -0400
committerGravatar GitHub2018-04-27 11:09:56 -0400
commitacede1f1d3309e629b1ddc55ad22f920fe50f681 (patch)
tree899731d5c75a7b40a8aa72f5e115f86e10078745 /src/common
parentMerge pull request #380 from ogniK5377/service-impl (diff)
parentgeneral: Convert assertion macros over to be fmt-compatible (diff)
downloadyuzu-acede1f1d3309e629b1ddc55ad22f920fe50f681.tar.gz
yuzu-acede1f1d3309e629b1ddc55ad22f920fe50f681.tar.xz
yuzu-acede1f1d3309e629b1ddc55ad22f920fe50f681.zip
Merge pull request #409 from lioncash/assert
general: Convert assertion macros over to be fmt-compatible
Diffstat (limited to '')
-rw-r--r--src/common/assert.h5
-rw-r--r--src/common/file_util.cpp6
2 files changed, 6 insertions, 5 deletions
diff --git a/src/common/assert.h b/src/common/assert.h
index 655446f34..3ee07f6a2 100644
--- a/src/common/assert.h
+++ b/src/common/assert.h
@@ -30,14 +30,15 @@ __declspec(noinline, noreturn)
30#define ASSERT(_a_) \ 30#define ASSERT(_a_) \
31 do \ 31 do \
32 if (!(_a_)) { \ 32 if (!(_a_)) { \
33 assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \ 33 assert_noinline_call([] { NGLOG_CRITICAL(Debug, "Assertion Failed!"); }); \
34 } \ 34 } \
35 while (0) 35 while (0)
36 36
37#define ASSERT_MSG(_a_, ...) \ 37#define ASSERT_MSG(_a_, ...) \
38 do \ 38 do \
39 if (!(_a_)) { \ 39 if (!(_a_)) { \
40 assert_noinline_call([&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \ 40 assert_noinline_call( \
41 [&] { NGLOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \
41 } \ 42 } \
42 while (0) 43 while (0)
43 44
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index 37f9e996c..cd852bfd8 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -653,12 +653,12 @@ static const std::string GetUserDirectory(const std::string& envvar) {
653 else if (envvar == "XDG_CACHE_HOME") 653 else if (envvar == "XDG_CACHE_HOME")
654 subdirectory = DIR_SEP ".cache"; 654 subdirectory = DIR_SEP ".cache";
655 else 655 else
656 ASSERT_MSG(false, "Unknown XDG variable %s.", envvar.c_str()); 656 ASSERT_MSG(false, "Unknown XDG variable {}.", envvar);
657 user_dir = GetHomeDirectory() + subdirectory; 657 user_dir = GetHomeDirectory() + subdirectory;
658 } 658 }
659 659
660 ASSERT_MSG(!user_dir.empty(), "User directory %s musn’t be empty.", envvar.c_str()); 660 ASSERT_MSG(!user_dir.empty(), "User directory {} mustn’t be empty.", envvar);
661 ASSERT_MSG(user_dir[0] == '/', "User directory %s must be absolute.", envvar.c_str()); 661 ASSERT_MSG(user_dir[0] == '/', "User directory {} must be absolute.", envvar);
662 662
663 return user_dir; 663 return user_dir;
664} 664}