diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-10-17 17:01:08 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-10-17 17:01:08 +0200 |
| commit | c1387dc5920baf8f0f539a3ef490e0c6fcfb5e2d (patch) | |
| tree | a81660ab3fa1195f7fc5f3b40e6f5450b267ad76 /src | |
| parent | 4aa3a3610279082969e4c2eb0196ddddd025557a (diff) | |
assert: simplify header
Diffstat (limited to 'src')
| -rw-r--r-- | src/assert.cc | 20 | ||||
| -rw-r--r-- | src/assert.hh | 13 |
2 files changed, 12 insertions, 21 deletions
diff --git a/src/assert.cc b/src/assert.cc index 0c4e85f3..d906a48c 100644 --- a/src/assert.cc +++ b/src/assert.cc @@ -1,21 +1,23 @@ #include "assert.hh" +#include "exception.hh" + namespace Kakoune { -assert_failed::assert_failed(const String& message) +struct assert_failed : logic_error { - m_message = message; -} + assert_failed(const String& message) + : m_message(message) {} -String assert_failed::description() const -{ - return m_message; -} + String description() const override { return m_message; } +private: + String m_message; +}; -void on_assert_failed(const String& message) +void on_assert_failed(const char* message) { - int res = system(("xmessage -buttons 'quit:0,ignore:1' '" + message + "'").c_str()); + int res = system(("xmessage -buttons 'quit:0,ignore:1' '"_str + message + "'").c_str()); switch (res) { case 0: diff --git a/src/assert.hh b/src/assert.hh index 0ec5db90..182b58a4 100644 --- a/src/assert.hh +++ b/src/assert.hh @@ -1,21 +1,10 @@ #ifndef assert_hh_INCLUDED #define assert_hh_INCLUDED -#include "exception.hh" - namespace Kakoune { -struct assert_failed : logic_error -{ - assert_failed(const String& message); - String description() const override; - -private: - String m_message; -}; - -void on_assert_failed(const String& message); +void on_assert_failed(const char* message); } |
