summaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
Diffstat (limited to 'src/support')
-rw-r--r--src/support/debug.cpp4
-rw-r--r--src/support/debug.h10
-rw-r--r--src/support/threads.h3
3 files changed, 15 insertions, 2 deletions
diff --git a/src/support/debug.cpp b/src/support/debug.cpp
index 15b708d5e..da006e9c0 100644
--- a/src/support/debug.cpp
+++ b/src/support/debug.cpp
@@ -20,6 +20,8 @@
#include <set>
#include <string>
+#ifndef NDEBUG
+
static bool debugEnabled = false;
static std::set<std::string> debugTypesEnabled;
@@ -49,3 +51,5 @@ void wasm::setDebugEnabled(const char* types) {
start += type_size + 1;
}
}
+
+#endif
diff --git a/src/support/debug.h b/src/support/debug.h
index 960082d1a..edb19ebda 100644
--- a/src/support/debug.h
+++ b/src/support/debug.h
@@ -44,14 +44,20 @@ void setDebugEnabled(const char* types);
#else
+// We have an option to build with assertions disabled
+// BYN_ASSERTIONS_ENABLED=OFF, but we currently don't recommend using and we
+// don't test with it.
+#error "binaryen is currently designed to be built with assertions enabled."
+#error "remove these #errors if you want to build without them anyway."
+
#define BYN_DEBUG_WITH_TYPE(...) \
do { \
} while (false)
#define BYN_TRACE_WITH_TYPE(...) \
do { \
} while (false)
-#define isDebugEnabled() (false)
-#define setDebugEnabled()
+#define isDebugEnabled(type) (false)
+#define setDebugEnabled(types)
#endif
diff --git a/src/support/threads.h b/src/support/threads.h
index 8cfa79c87..8a04f78bd 100644
--- a/src/support/threads.h
+++ b/src/support/threads.h
@@ -29,6 +29,8 @@
#include <thread>
#include <vector>
+#include "compiler-support.h"
+
namespace wasm {
// The work state of a helper thread - is there more to do,
@@ -124,6 +126,7 @@ public:
void verify() {
auto before = created.fetch_add(1);
+ WASM_UNUSED(before);
assert(before == 0);
}
};