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

ruby-changes:38454

From: nobu <ko1@a...>
Date: Tue, 19 May 2015 09:54:54 +0900 (JST)
Subject: [ruby-changes:38454] nobu:r50535 (trunk): ruby.h: cast for C++

nobu	2015-05-19 09:54:46 +0900 (Tue, 19 May 2015)

  New Revision: 50535

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

  Log:
    ruby.h: cast for C++
    
    * include/ruby/ruby.h (Data_Make_Struct0): needs function pointer
      casts to fix function overloading in C++.

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/ruby.h
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 50534)
+++ include/ruby/ruby.h	(revision 50535)
@@ -1032,7 +1032,9 @@ void *rb_check_typeddata(VALUE, const rb https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1032
     rb_data_object_wrap((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free))
 
 #define Data_Make_Struct0(result, klass, type, size, mark, free, sval) \
-    VALUE result = rb_data_object_zalloc(klass, size, mark, free); \
+    VALUE result = rb_data_object_zalloc((klass), (size), \
+					 (RUBY_DATA_FUNC)(mark), \
+					 (RUBY_DATA_FUNC)(free)); \
     (void)((sval) = (type *)DATA_PTR(result));
 
 #ifdef __GNUC__
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50534)
+++ ChangeLog	(revision 50535)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue May 19 09:54:44 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* include/ruby/ruby.h (Data_Make_Struct0): needs function pointer
+	  casts to fix function overloading in C++.
+
 Tue May 19 09:43:56 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/ruby.h (Data_Make_Struct0, TypedData_Make_Struct0):

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

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