mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
+2
-1
@@ -287,7 +287,8 @@ void mrb_include_module(mrb_state*, struct RClass*, struct RClass*);
|
||||
|
||||
void mrb_define_method(mrb_state*, struct RClass*, const char*, mrb_func_t,int);
|
||||
void mrb_define_class_method(mrb_state *, struct RClass *, const char *, mrb_func_t, int);
|
||||
void mrb_define_singleton_method(mrb_state*, void*, const char*, mrb_func_t,int);
|
||||
void mrb_define_singleton_method(mrb_state*, struct RObject*, const char*, mrb_func_t,int);
|
||||
void mrb_define_module_function(mrb_state*, struct RClass*, const char*, mrb_func_t,int);
|
||||
void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_value);
|
||||
mrb_value mrb_instance_new(mrb_state *mrb, mrb_value cv);
|
||||
struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super);
|
||||
|
||||
+13
@@ -578,6 +578,19 @@ mrb_define_class_method(mrb_state *mrb, struct RClass *c, const char *name, mrb_
|
||||
mrb_define_method_id(mrb, c->c, mrb_intern(mrb, name), func, aspec);
|
||||
}
|
||||
|
||||
void
|
||||
mrb_define_singleton_method(mrb_state *mrb, struct RObject *o, const char *name, mrb_func_t func, int aspec)
|
||||
{
|
||||
mrb_define_method_id(mrb, mrb_singleton_class_ptr(mrb, o->c), mrb_intern(mrb, name), func, aspec);
|
||||
}
|
||||
|
||||
void
|
||||
mrb_define_module_function(mrb_state *mrb, struct RClass *c, const char *name, mrb_func_t func, int aspec)
|
||||
{
|
||||
mrb_define_class_method(mrb, c, name, func, aspec);
|
||||
mrb_define_method(mrb, c, name, func, aspec);
|
||||
}
|
||||
|
||||
struct RProc*
|
||||
mrb_method_search_vm(mrb_state *mrb, struct RClass **cp, mrb_sym mid)
|
||||
{
|
||||
|
||||
+23
-23
@@ -622,34 +622,34 @@ mrb_init_math(mrb_state *mrb)
|
||||
mrb_define_const(mrb, mrb_math, "E", mrb_float_value(exp(1.0)));
|
||||
#endif
|
||||
|
||||
mrb_define_class_method(mrb, mrb_math, "sin", math_sin, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "cos", math_cos, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "tan", math_tan, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "sin", math_sin, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "cos", math_cos, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "tan", math_tan, 1);
|
||||
|
||||
mrb_define_class_method(mrb, mrb_math, "asin", math_asin, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "acos", math_acos, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "atan", math_atan, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "atan2", math_atan2, 2);
|
||||
mrb_define_module_function(mrb, mrb_math, "asin", math_asin, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "acos", math_acos, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "atan", math_atan, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "atan2", math_atan2, 2);
|
||||
|
||||
mrb_define_class_method(mrb, mrb_math, "sinh", math_sinh, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "cosh", math_cosh, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "tanh", math_tanh, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "sinh", math_sinh, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "cosh", math_cosh, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "tanh", math_tanh, 1);
|
||||
|
||||
mrb_define_class_method(mrb, mrb_math, "asinh", math_asinh, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "acosh", math_acosh, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "atanh", math_atanh, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "asinh", math_asinh, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "acosh", math_acosh, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "atanh", math_atanh, 1);
|
||||
|
||||
mrb_define_class_method(mrb, mrb_math, "exp", math_exp, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "log", math_log, -1);
|
||||
mrb_define_class_method(mrb, mrb_math, "log2", math_log2, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "log10", math_log10, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "cbrt", math_cbrt, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "exp", math_exp, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "log", math_log, -1);
|
||||
mrb_define_module_function(mrb, mrb_math, "log2", math_log2, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "log10", math_log10, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "cbrt", math_cbrt, 1);
|
||||
|
||||
mrb_define_class_method(mrb, mrb_math, "frexp", math_frexp, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "ldexp", math_ldexp, 2);
|
||||
mrb_define_module_function(mrb, mrb_math, "frexp", math_frexp, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "ldexp", math_ldexp, 2);
|
||||
|
||||
mrb_define_class_method(mrb, mrb_math, "hypot", math_hypot, 2);
|
||||
mrb_define_module_function(mrb, mrb_math, "hypot", math_hypot, 2);
|
||||
|
||||
mrb_define_class_method(mrb, mrb_math, "erf", math_erf, 1);
|
||||
mrb_define_class_method(mrb, mrb_math, "erfc", math_erfc, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "erf", math_erf, 1);
|
||||
mrb_define_module_function(mrb, mrb_math, "erfc", math_erfc, 1);
|
||||
}
|
||||
|
||||
+2
-2
@@ -28,8 +28,8 @@
|
||||
#ifdef _WIN32
|
||||
/* Win32 platform do not provide gmtime_r/localtime_r; emulate them using gmtime_s/localtime_s */
|
||||
#if _MVC_VER
|
||||
#define gmtime_r(tp, tm) ((gmtime_s((tm), (tp)) == 0) ? (tp) : NULL)
|
||||
#define localtime_r(tp, tm) ((localtime_s((tm), (tp)) == 0) ? (tp) : NULL)
|
||||
#define gmtime_r(tp, tm) ((gmtime_s((tm), (tp)) == 0) ? (tm) : NULL)
|
||||
#define localtime_r(tp, tm) ((localtime_s((tm), (tp)) == 0) ? (tm) : NULL)
|
||||
#else
|
||||
#define NO_GMTIME_R
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user