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

ruby-changes:42882

From: usa <ko1@a...>
Date: Mon, 9 May 2016 06:23:40 +0900 (JST)
Subject: [ruby-changes:42882] usa:r54956 (trunk): * include/ruby/{defines, ruby}.h: need to define function attributes

usa	2016-05-09 07:20:05 +0900 (Mon, 09 May 2016)

  New Revision: 54956

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

  Log:
    * include/ruby/{defines,ruby}.h: need to define function attributes
      alternatives in defines.h instead of ruby.h, because they are used
      in oniguruma.h and the header used without including ruby.h at
      encoding library sources.

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/defines.h
    trunk/include/ruby/ruby.h
Index: include/ruby/defines.h
===================================================================
--- include/ruby/defines.h	(revision 54955)
+++ include/ruby/defines.h	(revision 54956)
@@ -22,6 +22,46 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/include/ruby/defines.h#L22
 #include RUBY_EXTCONF_H
 #endif
 
+/* function attributes */
+#ifndef CONSTFUNC
+# define CONSTFUNC(x) x
+#endif
+#ifndef PUREFUNC
+# define PUREFUNC(x) x
+#endif
+#define NORETURN_STYLE_NEW 1
+#ifndef NORETURN
+# define NORETURN(x) x
+#endif
+#ifndef DEPRECATED
+# define DEPRECATED(x) x
+#endif
+#ifndef DEPRECATED_BY
+# define DEPRECATED_BY(n,x) DEPRECATED(x)
+#endif
+#ifndef DEPRECATED_TYPE
+# define DEPRECATED_TYPE(mesg, decl) decl
+#endif
+#ifndef NOINLINE
+# define NOINLINE(x) x
+#endif
+
+/* likely */
+#if __GNUC__ >= 3
+#define RB_LIKELY(x)   (__builtin_expect(!!(x), 1))
+#define RB_UNLIKELY(x) (__builtin_expect(!!(x), 0))
+#else /* __GNUC__ >= 3 */
+#define RB_LIKELY(x)   (x)
+#define RB_UNLIKELY(x) (x)
+#endif /* __GNUC__ >= 3 */
+
+#ifdef __GNUC__
+#define PRINTF_ARGS(decl, string_index, first_to_check) \
+  decl __attribute__((format(printf, string_index, first_to_check)))
+#else
+#define PRINTF_ARGS(decl, string_index, first_to_check) decl
+#endif
+
 /* AC_INCLUDES_DEFAULT */
 #include <stdio.h>
 #ifdef HAVE_SYS_TYPES_H
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 54955)
+++ include/ruby/ruby.h	(revision 54956)
@@ -35,28 +35,6 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L35
 
 #include "defines.h"
 
-#define NORETURN_STYLE_NEW 1
-#ifndef CONSTFUNC
-# define CONSTFUNC(x) x
-#endif
-#ifndef PUREFUNC
-# define PUREFUNC(x) x
-#endif
-#ifndef NORETURN
-# define NORETURN(x) x
-#endif
-#ifndef DEPRECATED
-# define DEPRECATED(x) x
-#endif
-#ifndef DEPRECATED_BY
-# define DEPRECATED_BY(n,x) DEPRECATED(x)
-#endif
-#ifndef DEPRECATED_TYPE
-# define DEPRECATED_TYPE(mesg, decl) decl
-#endif
-#ifndef NOINLINE
-# define NOINLINE(x) x
-#endif
 #ifndef ASSUME
 # ifdef UNREACHABLE
 #   define ASSUME(x) (RB_LIKELY(!!(x)) ? (void)0 : UNREACHABLE)
@@ -68,22 +46,6 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L46
 # define UNREACHABLE ((void)0)	/* unreachable */
 #endif
 
-/* likely */
-#if __GNUC__ >= 3
-#define RB_LIKELY(x)   (__builtin_expect(!!(x), 1))
-#define RB_UNLIKELY(x) (__builtin_expect(!!(x), 0))
-#else /* __GNUC__ >= 3 */
-#define RB_LIKELY(x)   (x)
-#define RB_UNLIKELY(x) (x)
-#endif /* __GNUC__ >= 3 */
-
-#ifdef __GNUC__
-#define PRINTF_ARGS(decl, string_index, first_to_check) \
-  decl __attribute__((format(printf, string_index, first_to_check)))
-#else
-#define PRINTF_ARGS(decl, string_index, first_to_check) decl
-#endif
-
 #define RUBY_MACRO_SELECT(base, n) TOKEN_PASTE(base, n)
 
 #ifdef HAVE_INTRINSICS_H
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54955)
+++ ChangeLog	(revision 54956)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon May  9 07:18:06 2016  NAKAMURA Usaku  <usa@r...>
+
+	* include/ruby/{defines,ruby}.h: need to define function attributes
+	  alternatives in defines.h instead of ruby.h, because they are used
+	  in oniguruma.h and the header used without including ruby.h at
+	  encoding library sources.
+
 Mon May  9 06:30:12 2016  NAKAMURA Usaku  <usa@r...>
 
 	* include/ruby/ruby.h (CONSTFUNC, PUREFUNC): fixed build errors on

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

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