summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-22 07:15:57 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-22 07:15:57 (GMT)
commit010752631bb67412c37b9e4a7821068fcdba4833 (patch)
treec3f3e0745340ae153875f81a732b777906a4953d /vm_core.h
parent1656b70c0e3eea3e0484c9862134e275cd1af07a (diff)
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
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/vm_core.h b/vm_core.h
index 7b5adbc..38de356 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;