JSON: Do not use throw when exception is disabled.
llvm-svn: 130575
diff --git a/polly/lib/JSON/json_value.cpp b/polly/lib/JSON/json_value.cpp
index 573205f..34acce9 100644
--- a/polly/lib/JSON/json_value.cpp
+++ b/polly/lib/JSON/json_value.cpp
@@ -15,7 +15,12 @@
#define JSON_ASSERT_UNREACHABLE assert( false )
#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw
-#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );
+// Do not use throw when exception is disable.
+#if JSON_USE_EXCEPTION
+# define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );
+#else
+# define JSON_ASSERT_MESSAGE( condition, message ) JSON_ASSERT( condition ) // @todo <= provide the message
+#endif
namespace Json {