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
5698852e
Commit
5698852e
authored
Jun 29, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1311 from cremno/msvc-2013-support
Visual Studio 2013 support (and two other fixes)
parents
9f154dd7
bc91bcef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
34 deletions
+30
-34
include/mruby/value.h
include/mruby/value.h
+22
-16
mrbgems/mruby-math/src/math.c
mrbgems/mruby-math/src/math.c
+8
-14
mrbgems/mruby-sprintf/src/sprintf.c
mrbgems/mruby-sprintf/src/sprintf.c
+0
-4
No files found.
include/mruby/value.h
View file @
5698852e
...
...
@@ -51,23 +51,29 @@
typedef
short
mrb_sym
;
#ifdef _MSC_VER
#
define _ALLOW_KEYWORD_MACROS
#
include <float.h>
#
define inline __inline
#
ifndef __cplusplus
#
define inline __inline
#
endif
# define snprintf _snprintf
# define isnan _isnan
# define isinf(n) (!_finite(n) && !_isnan(n))
# define strtoll _strtoi64
# define PRId32 "I32d"
# define PRIi32 "I32i"
# define PRIo32 "I32o"
# define PRIx32 "I32x"
# define PRIX32 "I32X"
# define PRId64 "I64d"
# define PRIi64 "I64i"
# define PRIo64 "I64o"
# define PRIx64 "I64x"
# define PRIX64 "I64X"
# if _MSC_VER < 1800
# include <float.h>
# define isnan _isnan
# define isinf(n) (!_finite(n) && !_isnan(n))
# define strtoll _strtoi64
# define strtof (float)strtod
# define PRId32 "I32d"
# define PRIi32 "I32i"
# define PRIo32 "I32o"
# define PRIx32 "I32x"
# define PRIX32 "I32X"
# define PRId64 "I64d"
# define PRIi64 "I64i"
# define PRIo64 "I64o"
# define PRIx64 "I64x"
# define PRIX64 "I64X"
# else
# include <inttypes.h>
# endif
#else
# include <inttypes.h>
#endif
...
...
mrbgems/mruby-math/src/math.c
View file @
5698852e
...
...
@@ -12,8 +12,8 @@
#define domain_error(msg) \
mrb_raise(mrb, E_RANGE_ERROR, "Numerical argument is out of domain - " #msg)
/* math functions not provided
under Microsoft Visual C++
*/
#if
def _MSC_VER
/* math functions not provided
by Microsoft Visual C++ 2012 or older
*/
#if
defined _MSC_VER && _MSC_VER < 1800
#define MATH_TOLERANCE 1E-12
...
...
@@ -87,6 +87,12 @@ erfc(double x)
return
one_sqrtpi
*
exp
(
-
x
*
x
)
*
q2
;
}
double
log2
(
double
x
)
{
return
log10
(
x
)
/
log10
(
2
.
0
);
}
#endif
/*
...
...
@@ -358,18 +364,6 @@ math_atanh(mrb_state *mrb, mrb_value obj)
# define log10(x) ((x) < 0.0 ? nan("") : log10(x))
#endif
#ifndef log2
#ifndef HAVE_LOG2
double
log2
(
double
x
)
{
return
log10
(
x
)
/
log10
(
2
.
0
);
}
#else
extern
double
log2
(
double
);
#endif
#endif
/*
* call-seq:
* Math.exp(x) -> float
...
...
mrbgems/mruby-sprintf/src/sprintf.c
View file @
5698852e
...
...
@@ -15,10 +15,6 @@
#include <math.h>
#include <ctype.h>
#ifdef _MSC_VER
#include <float.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
...
...
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