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

ruby-changes:42911

From: naruse <ko1@a...>
Date: Fri, 13 May 2016 03:12:52 +0900 (JST)
Subject: [ruby-changes:42911] naruse:r54985 (trunk): * configurein: use alternative keyword

naruse	2016-05-13 03:12:45 +0900 (Fri, 13 May 2016)

  New Revision: 54985

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

  Log:
    * configurein: use alternative keyword
    
    to avoid macros conflicts with them.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
    trunk/internal.h
Index: internal.h
===================================================================
--- internal.h	(revision 54984)
+++ internal.h	(revision 54985)
@@ -30,18 +30,18 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/internal.h#L30
 # define __has_attribute(x) 0
 #endif
 
-#if __has_attribute(unused)
-#define UNINITIALIZED_VAR(x) x __attribute__((unused))
+#if __has_attribute(__unused__)
+#define UNINITIALIZED_VAR(x) x __attribute__((__unused__))
 #elif defined(__GNUC__) && __GNUC__ >= 3
 #define UNINITIALIZED_VAR(x) x = x
 #else
 #define UNINITIALIZED_VAR(x) x
 #endif
 
-#if __has_attribute(warn_unused_result)
-#define WARN_UNUSED_RESULT(x) x __attribute__((warn_unused_result))
+#if __has_attribute(__warn_unused_result__)
+#define WARN_UNUSED_RESULT(x) x __attribute__((__warn_unused_result__))
 #elif defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 3004
-#define WARN_UNUSED_RESULT(x) x __attribute__((warn_unused_result))
+#define WARN_UNUSED_RESULT(x) x __attribute__((__warn_unused_result__))
 #else
 #define WARN_UNUSED_RESULT(x) x
 #endif
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54984)
+++ ChangeLog	(revision 54985)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri May 13 03:10:39 2016  NARUSE, Yui  <naruse@r...>
+
+	* configurein: use alternative keyword
+	  to avoid macros conflicts with them.
+
 Thu May 12 01:54:08 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/mkmf.rb (try_func): get rid of conflict of declarations of
Index: configure.in
===================================================================
--- configure.in	(revision 54984)
+++ configure.in	(revision 54985)
@@ -1800,24 +1800,26 @@ AC_DEFUN([RUBY_TYPE_ATTRIBUTE], [dnl https://github.com/ruby/ruby/blob/trunk/configure.in#L1800
 ])
 ])
 
-RUBY_FUNC_ATTRIBUTE(const, CONSTFUNC)
-RUBY_FUNC_ATTRIBUTE(pure, PUREFUNC)
-RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
-RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
-RUBY_FUNC_ATTRIBUTE(deprecated("by "@%:@n), DEPRECATED_BY(n,x), rb_cv_func_deprecated_by)
-RUBY_TYPE_ATTRIBUTE(deprecated mesg, DEPRECATED_TYPE(mesg,x), rb_cv_type_deprecated)
-RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
-RUBY_FUNC_ATTRIBUTE(weak, WEAK, rb_cv_func_weak)
+RUBY_FUNC_ATTRIBUTE(__const__, CONSTFUNC)
+RUBY_FUNC_ATTRIBUTE(__pure__, PUREFUNC)
+RUBY_FUNC_ATTRIBUTE(__noreturn__, NORETURN)
+RUBY_FUNC_ATTRIBUTE(__deprecated__, DEPRECATED)
+RUBY_FUNC_ATTRIBUTE(__deprecated__("by "@%:@n), DEPRECATED_BY(n,x), rb_cv_func_deprecated_by)
+RUBY_TYPE_ATTRIBUTE(__deprecated__ mesg, DEPRECATED_TYPE(mesg,x), rb_cv_type_deprecated)
+RUBY_FUNC_ATTRIBUTE(__noinline__, NOINLINE)
+RUBY_FUNC_ATTRIBUTE(__error__, ERRORFUNC)
+RUBY_FUNC_ATTRIBUTE(__warning__, WARNINGFUNC)
+RUBY_FUNC_ATTRIBUTE(__weak__, WEAK, rb_cv_func_weak)
 if test "$rb_cv_func_weak" != x; then
    AC_DEFINE(HAVE_FUNC_WEAK)
 fi
 
 if_i386=${universal_binary+[defined __i386__]}
-RUBY_FUNC_ATTRIBUTE(stdcall,  [], [], ${if_i386})
-RUBY_FUNC_ATTRIBUTE(cdecl,    [], [], ${if_i386})
-RUBY_FUNC_ATTRIBUTE(fastcall, [], [], ${if_i386})
-RUBY_FUNC_ATTRIBUTE(optimize("O0"), FUNC_UNOPTIMIZED, rb_cv_func_unoptimized)
-RUBY_FUNC_ATTRIBUTE(optimize("-Os","-fomit-frame-pointer"), FUNC_MINIMIZED, rb_cv_func_minimized)
+RUBY_FUNC_ATTRIBUTE(__stdcall__,  [], [], ${if_i386})
+RUBY_FUNC_ATTRIBUTE(__cdecl__,    [], [], ${if_i386})
+RUBY_FUNC_ATTRIBUTE(__fastcall__, [], [], ${if_i386})
+RUBY_FUNC_ATTRIBUTE(__optimize__("O0"), FUNC_UNOPTIMIZED, rb_cv_func_unoptimized)
+RUBY_FUNC_ATTRIBUTE(__optimize__("-Os","-fomit-frame-pointer"), FUNC_MINIMIZED, rb_cv_func_minimized)
 
 if test "$GCC" = yes; then
     AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
@@ -1882,7 +1884,7 @@ fi https://github.com/ruby/ruby/blob/trunk/configure.in#L1884
 AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
 rb_cv_func_exported=no
 RUBY_WERROR_FLAG([
-for mac in '__attribute__ ((visibility("default")))' '__declspec(dllexport)'; do
+for mac in '__attribute__ ((__visibility__("default")))' '__declspec(dllexport)'; do
   AC_TRY_COMPILE([@%:@define RUBY_FUNC_EXPORTED $mac extern
     RUBY_FUNC_EXPORTED void conftest_attribute_check(void);], [],
     [rb_cv_func_exported="$mac"; break])

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

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