summaryrefslogtreecommitdiffstats
path: root/dwarf_wrappers.h
diff options
context:
space:
mode:
Diffstat (limited to 'dwarf_wrappers.h')
-rw-r--r--dwarf_wrappers.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/dwarf_wrappers.h b/dwarf_wrappers.h
index 043c2957..c498de05 100644
--- a/dwarf_wrappers.h
+++ b/dwarf_wrappers.h
@@ -15,6 +15,7 @@
// NB: "rc == 0" means OK in this case
void dwfl_assert(const std::string& desc, int rc);
+// Throw error if pointer is NULL.
template <typename T>
void dwfl_assert(const std::string& desc, T* ptr)
{
@@ -22,6 +23,7 @@ void dwfl_assert(const std::string& desc, T* ptr)
dwfl_assert(desc, -1);
}
+// Throw error if pointer is NULL
template <typename T>
void dwfl_assert(const std::string& desc, const T* ptr)
{
@@ -29,9 +31,13 @@ void dwfl_assert(const std::string& desc, const T* ptr)
dwfl_assert(desc, -1);
}
+// Throw error if condition is false
+void dwfl_assert(const std::string& desc, bool condition);
+
// NB: "rc == 0" means OK in this case
void dwarf_assert(const std::string& desc, int rc);
+// Throw error if pointer is NULL
template <typename T>
void dwarf_assert(const std::string& desc, T* ptr)
{