summaryrefslogtreecommitdiff
path: root/ruby_assert.h
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-02 06:41:43 (GMT)
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-02 06:41:43 (GMT)
commitf6f1cfcbe7b15fa834de17ae014718b9e0bde3c7 (patch)
tree613d71d1dd394d548e7760814dd84e712d5fa63e /ruby_assert.h
parent76091d43881866f78824b88d48840afce9862bb8 (diff)
string literal longer than 509 characters is a C99ism
Should avoid such thing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_assert.h')
-rw-r--r--ruby_assert.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/ruby_assert.h b/ruby_assert.h
index 3383e4f..185d2e5 100644
--- a/ruby_assert.h
+++ b/ruby_assert.h
@@ -33,8 +33,14 @@ NORETURN(void rb_assert_failure(const char *, int, const char *, const char *));
#define RUBY_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(!RUBY_NDEBUG+0, expr, #expr)
#define RUBY_ASSERT_WHEN(cond, expr) RUBY_ASSERT_MESG_WHEN(cond, expr, #expr)
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
+/* C89 compilers are required to support strings of only 509 chars. */
+/* can't use RUBY_ASSERT for such compilers. */
+#include <assert.h>
+#else
#undef assert
#define assert RUBY_ASSERT
+#endif
#ifndef RUBY_NDEBUG
# ifdef NDEBUG