aboutsummaryrefslogtreecommitdiffstats
path: root/ruby_assert.h
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-02 06:41:43 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-02 06:41:43 +0000
commite505a3382ae9aad7e75dfeec332ce29a9a16c217 (patch)
tree613d71d1dd394d548e7760814dd84e712d5fa63e /ruby_assert.h
parent3ff43ea93b8c0fc8dbeb9571c7361a91d8e078b5 (diff)
downloadruby-e505a3382ae9aad7e75dfeec332ce29a9a16c217.tar.gz
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 3383e4fc6c..185d2e5f5f 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