From 010752631bb67412c37b9e4a7821068fcdba4833 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 22 Feb 2016 07:15:57 +0000 Subject: [PATCH] vm_core.h: CoreDataFromValue * vm_core.h (CoreDataFromValue): split as an expression from GetCoreDataFromValue, which can be a statement only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_core.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vm_core.h b/vm_core.h index 7b5adbcbd3..38de35636f 100644 --- a/vm_core.h +++ b/vm_core.h @@ -250,12 +250,11 @@ struct rb_call_cache { }; #if 1 -#define GetCoreDataFromValue(obj, type, ptr) do { \ - (ptr) = (type*)DATA_PTR(obj); \ -} while (0) +#define CoreDataFromValue(obj, type) (type*)DATA_PTR(obj) #else -#define GetCoreDataFromValue(obj, type, ptr) Data_Get_Struct((obj), type, (ptr)) +#define CoreDataFromValue(obj, type) (type*)rb_data_object_get(obj) #endif +#define GetCoreDataFromValue(obj, type, ptr) ((ptr) = CoreDataFromValue((obj), type)) typedef struct rb_iseq_location_struct { VALUE path;