[前][次][番号順一覧][スレッド一覧]

ruby-changes:49430

From: shyouhei <ko1@a...>
Date: Tue, 2 Jan 2018 15:59:30 +0900 (JST)
Subject: [ruby-changes:49430] shyouhei:r61546 (trunk): string literal longer than 509 characters is a C99ism

shyouhei	2018-01-02 15:41:43 +0900 (Tue, 02 Jan 2018)

  New Revision: 61546

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61546

  Log:
    string literal longer than 509 characters is a C99ism
    
    Should avoid such thing.

  Modified files:
    trunk/ruby_assert.h
Index: ruby_assert.h
===================================================================
--- ruby_assert.h	(revision 61545)
+++ ruby_assert.h	(revision 61546)
@@ -33,8 +33,14 @@ NORETURN(void rb_assert_failure(const ch https://github.com/ruby/ruby/blob/trunk/ruby_assert.h#L33
 #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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]