include/rucy/extension.h.erb in rucy-0.1.15 vs include/rucy/extension.h.erb in rucy-0.1.16
- old
+ new
@@ -25,18 +25,24 @@
template <> const native_class* value_to<const native_class*> (Value value, bool); \
template <> native_class& value_to< native_class&> (Value value, bool convert); \
template <> const native_class& value_to<const native_class&> (Value value, bool convert); \
}
-#define RUCY_DECLARE_VALUE_OR_ARRAY_TO(native_class) \
- RUCY_DECLARE_VALUE_TO(native_class) \
+#define RUCY_DECLARE_ARRAY_TO(native_class) \
namespace Rucy \
{ \
template <> native_class value_to<native_class> (Value value, bool convert); \
template <> native_class value_to<native_class> (int argc, const Value* argv, bool convert); \
}
+#define RUCY_DECLARE_CONVERT_TO(native_type) \
+ RUCY_DECLARE_ARRAY_TO(native_type)
+
+#define RUCY_DECLARE_VALUE_OR_ARRAY_TO(native_class) \
+ RUCY_DECLARE_VALUE_TO(native_class) \
+ RUCY_DECLARE_ARRAY_TO(native_class)
+
#define RUCY_DECLARE_WRAPPER_VALUE_FROM(native_class) \
namespace Rucy \
{ \
Value value (native_class* obj); \
Value value (native_class* obj, Value klass); \
@@ -90,12 +96,11 @@
{ \
return (const native_class&) value_to<native_class&>(value, convert); \
} \
}
-#define RUCY_DEFINE_VALUE_OR_ARRAY_TO(native_class) \
- RUCY_DEFINE_VALUE_TO(native_class) \
+#define RUCY_DEFINE_ARRAY_TO(native_class) \
namespace Rucy \
{ \
template <> native_class \
value_to<native_class> (Value value, bool convert) \
{ \
@@ -103,9 +108,16 @@
return value_to<native_class>(value.size(), value.as_array(), convert); \
else \
return value_to<native_class>(1, &value, convert); \
} \
}
+
+#define RUCY_DEFINE_CONVERT_TO(native_type) \
+ RUCY_DEFINE_ARRAY_TO(native_type)
+
+#define RUCY_DEFINE_VALUE_OR_ARRAY_TO(native_class) \
+ RUCY_DEFINE_VALUE_TO(native_class) \
+ RUCY_DEFINE_ARRAY_TO(native_class)
#define RUCY_DEFINE_WRAPPER_VALUE_FROM(native_class) \
namespace Rucy \
{ \
Value \