aboutsummaryrefslogtreecommitdiffstats
path: root/Utils.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-03-18 22:31:16 +0800
committerchriseth <c@ethdev.com>2015-03-18 22:32:17 +0800
commitd1f9e14476e0a05cb5ddd2b10f8fd5e6f618996a (patch)
tree0b2083d3a6f303a7de96bc4682b1d5e1518e5f52 /Utils.h
parented757ba5bf1090ba8a9a5e3e6a29da8785afb861 (diff)
downloaddexon-solidity-d1f9e14476e0a05cb5ddd2b10f8fd5e6f618996a.tar.gz
dexon-solidity-d1f9e14476e0a05cb5ddd2b10f8fd5e6f618996a.tar.zst
dexon-solidity-d1f9e14476e0a05cb5ddd2b10f8fd5e6f618996a.zip
Exception-throwing assert.
Diffstat (limited to 'Utils.h')
-rw-r--r--Utils.h29
1 files changed, 2 insertions, 27 deletions
diff --git a/Utils.h b/Utils.h
index 1411f66b..05c5fa6f 100644
--- a/Utils.h
+++ b/Utils.h
@@ -22,34 +22,9 @@
#pragma once
-#include <string>
-#include <libsolidity/Exceptions.h>
-
-namespace dev
-{
-namespace solidity
-{
+#include <libdevcore/Assertions.h>
/// Assertion that throws an InternalCompilerError containing the given description if it is not met.
#define solAssert(CONDITION, DESCRIPTION) \
- ::dev::solidity::solAssertAux(CONDITION, DESCRIPTION, __LINE__, __FILE__, ETH_FUNC)
-
-inline void solAssertAux(bool _condition, std::string const& _errorDescription, unsigned _line,
- char const* _file, char const* _function)
-{
- if (!_condition)
- ::boost::throw_exception( InternalCompilerError()
- << errinfo_comment(_errorDescription)
- << ::boost::throw_function(_function)
- << ::boost::throw_file(_file)
- << ::boost::throw_line(_line));
-}
-
-inline void solAssertAux(void const* _pointer, std::string const& _errorDescription, unsigned _line,
- char const* _file, char const* _function)
-{
- solAssertAux(_pointer != nullptr, _errorDescription, _line, _file, _function);
-}
+ assertThrow(CONDITION, ::dev::solidity::InternalCompilerError, DESCRIPTION)
-}
-}