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
db1244ce
Commit
db1244ce
authored
Jun 12, 2012
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #263 from monaka/pr-make-sprintf-optional
Make sprintf/format optional.
parents
f537e2bb
e1e4ceb3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
include/mrbconf.h
include/mrbconf.h
+3
-0
src/kernel.c
src/kernel.c
+2
-0
src/sprintf.c
src/sprintf.c
+5
-0
No files found.
include/mrbconf.h
View file @
db1244ce
...
...
@@ -34,6 +34,9 @@ typedef intptr_t mrb_sym;
# define INCLUDE_ENCODING
/* Regexp depends Encoding */
#endif
//#undef INCLUDE_KERNEL_SPRINTF /* not use Kernel.sprintf method. */
#define INCLUDE_KERNEL_SPRINTF
/* not use Kernel.sprintf method. */
#ifdef MRUBY_DEBUG_BUILD
# define PARSER_DUMP
#endif
...
...
src/kernel.c
View file @
db1244ce
...
...
@@ -1394,8 +1394,10 @@ mrb_init_kernel(mrb_state *mrb)
mrb_define_method
(
mrb
,
krn
,
"singleton_methods"
,
mrb_obj_singleton_methods_m
,
ARGS_ANY
());
/* 15.3.1.3.45 */
mrb_define_method
(
mrb
,
krn
,
"to_s"
,
mrb_any_to_s
,
ARGS_NONE
());
/* 15.3.1.3.46 */
#ifdef INCLUDE_KERNEL_SPRINTF
mrb_define_method
(
mrb
,
krn
,
"sprintf"
,
mrb_f_sprintf
,
ARGS_ANY
());
/* in sprintf.c */
mrb_define_method
(
mrb
,
krn
,
"format"
,
mrb_f_sprintf
,
ARGS_ANY
());
/* in sprintf.c */
#endif
mrb_include_module
(
mrb
,
mrb
->
object_class
,
mrb
->
kernel_module
);
}
src/sprintf.c
View file @
db1244ce
...
...
@@ -5,6 +5,9 @@
*/
#include "mruby.h"
#ifdef INCLUDE_KERNEL_SPRINTF
#include <stdio.h>
#include <string.h>
#include "encoding.h"
...
...
@@ -1078,3 +1081,5 @@ fmt_setup(char *buf, size_t size, int c, int flags, int width, int prec)
*
buf
++
=
c
;
*
buf
=
'\0'
;
}
#endif //INCLUDE_KERNEL_SPRINTF
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