Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
ea80e828
Commit
ea80e828
authored
Aug 04, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:mruby/mruby
parents
db7b01c0
0fa3668e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
11 deletions
+48
-11
include/mruby/value.h
include/mruby/value.h
+6
-2
src/etc.c
src/etc.c
+37
-0
src/gc.c
src/gc.c
+4
-4
src/load.c
src/load.c
+0
-4
src/string.c
src/string.c
+1
-1
No files found.
include/mruby/value.h
View file @
ea80e828
...
...
@@ -47,7 +47,11 @@ struct mrb_state;
# define inline __inline
# endif
# if _MSC_VER < 1900
# define snprintf _snprintf
# include <stdarg.h>
MRB_API
int
mrb_msvc_vsnprintf
(
char
*
s
,
size_t
n
,
const
char
*
format
,
va_list
arg
);
MRB_API
int
mrb_msvc_snprintf
(
char
*
s
,
size_t
n
,
const
char
*
format
,
...);
# define vsnprintf(s, n, format, arg) mrb_msvc_vsnprintf(s, n, format, arg)
# define snprintf(s, n, format, ...) mrb_msvc_snprintf(s, n, format, __VA_ARGS__)
# endif
# if _MSC_VER < 1800
# include <float.h>
...
...
src/etc.c
View file @
ea80e828
...
...
@@ -183,3 +183,40 @@ mrb_regexp_p(mrb_state *mrb, mrb_value v)
{
return
mrb_class_defined
(
mrb
,
REGEXP_CLASS
)
&&
mrb_obj_is_kind_of
(
mrb
,
v
,
mrb_class_get
(
mrb
,
REGEXP_CLASS
));
}
#if defined _MSC_VER && _MSC_VER < 1900
#ifndef va_copy
static
void
mrb_msvc_va_copy
(
va_list
*
dest
,
va_list
src
)
{
*
dest
=
src
;
}
#define va_copy(dest, src) msvc_va_copy(&(dest), src)
#endif
MRB_API
int
mrb_msvc_vsnprintf
(
char
*
s
,
size_t
n
,
const
char
*
format
,
va_list
arg
)
{
int
cnt
;
va_list
argcp
;
va_copy
(
argcp
,
arg
);
if
(
n
==
0
||
(
cnt
=
_vsnprintf_s
(
s
,
n
,
_TRUNCATE
,
format
,
argcp
))
<
0
)
{
cnt
=
_vscprintf
(
format
,
arg
);
}
va_end
(
argcp
);
return
cnt
;
}
MRB_API
int
mrb_msvc_snprintf
(
char
*
s
,
size_t
n
,
const
char
*
format
,
...)
{
va_list
arg
;
int
ret
;
va_start
(
arg
,
format
);
ret
=
mrb_msvc_vsnprintf
(
s
,
n
,
format
,
arg
);
va_end
(
arg
);
return
ret
;
}
#endif
/* defined _MSC_VER && _MSC_VER < 1900 */
src/gc.c
View file @
ea80e828
...
...
@@ -949,7 +949,7 @@ static void
incremental_gc_until
(
mrb_state
*
mrb
,
enum
gc_state
to_state
)
{
do
{
incremental_gc
(
mrb
,
~
0
);
incremental_gc
(
mrb
,
SIZE_MAX
);
}
while
(
mrb
->
gc_state
!=
to_state
);
}
...
...
@@ -1162,7 +1162,7 @@ gc_start(mrb_state *mrb, mrb_value obj)
static
mrb_value
gc_enable
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
int
old
=
mrb
->
gc_disabled
;
mrb_bool
old
=
mrb
->
gc_disabled
;
mrb
->
gc_disabled
=
FALSE
;
...
...
@@ -1184,7 +1184,7 @@ gc_enable(mrb_state *mrb, mrb_value obj)
static
mrb_value
gc_disable
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
int
old
=
mrb
->
gc_disabled
;
mrb_bool
old
=
mrb
->
gc_disabled
;
mrb
->
gc_disabled
=
TRUE
;
...
...
@@ -1258,7 +1258,7 @@ gc_step_ratio_set(mrb_state *mrb, mrb_value obj)
}
static
void
change_gen_gc_mode
(
mrb_state
*
mrb
,
mrb_
int
enable
)
change_gen_gc_mode
(
mrb_state
*
mrb
,
mrb_
bool
enable
)
{
if
(
is_generational
(
mrb
)
&&
!
enable
)
{
clear_all_old
(
mrb
);
...
...
src/load.c
View file @
ea80e828
...
...
@@ -22,10 +22,6 @@
# define SIZE_ERROR(x) (0)
#endif
#if CHAR_BIT != 8
# error This code assumes CHAR_BIT == 8
#endif
#if UINT32_MAX > SIZE_MAX
# error This code cannot be built on your environment.
#endif
...
...
src/string.c
View file @
ea80e828
...
...
@@ -445,7 +445,7 @@ mrb_str_bytesize(mrb_state *mrb, mrb_value self)
*
* Returns a new string object containing a copy of <i>str</i>.
*/
MRB_API
mrb_value
static
mrb_value
mrb_str_size
(
mrb_state
*
mrb
,
mrb_value
self
)
{
struct
RString
*
s
=
mrb_str_ptr
(
self
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment