summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-05-09 22:23:39 +0900
committerYukihiro Matsumoto <[email protected]>2012-05-09 22:23:39 +0900
commitbcd24af19ce79eff2343cb9a9165c96e24acbfa2 (patch)
tree35fcb48d294fce6ac81c5336bb0d4c8fda3799d1
parent6faab394d721011080355b1d0fa14d925a2a7734 (diff)
downloadmruby-bcd24af19ce79eff2343cb9a9165c96e24acbfa2.tar.gz
mruby-bcd24af19ce79eff2343cb9a9165c96e24acbfa2.zip
temporal VC patch from nkshigeru
-rw-r--r--include/mrbconf.h2
-rw-r--r--src/encoding.c4
-rw-r--r--src/transcode.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 4786d8194..9155575a9 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -45,6 +45,8 @@ typedef intptr_t mrb_sym;
#ifdef _MSC_VER
# define inline __inline
# define snprintf _snprintf
+# define isnan _isnan
+# define isinf(n) (!_finite(n) && !_isnan(n))
#endif
#endif /* MRUBYCONF_H */
diff --git a/src/encoding.c b/src/encoding.c
index 54cf290c2..ea350e497 100644
--- a/src/encoding.c
+++ b/src/encoding.c
@@ -1348,7 +1348,11 @@ set_default_internal(mrb_state *mrb, mrb_value klass)
}
#define digit(x) ((x) >= '0' && (x) <= '9')
+#ifndef _MSC_VER
#define strstart(s, n) (strncasecmp(s, n, strlen(n)) == 0)
+#else
+#define strstart(s, n) (_stricmp(s, n) == 0)
+#endif
#define C_CODESET "US-ASCII" /* Return this as the encoding of the
* C/POSIX locale. Could as well one day
* become "UTF-8". */
diff --git a/src/transcode.c b/src/transcode.c
index 5395a6e73..1240081e6 100644
--- a/src/transcode.c
+++ b/src/transcode.c
@@ -13,6 +13,9 @@
#ifdef INCLUDE_ENCODING
#include "encoding.h"
#include <sys/types.h> /* for ssize_t */
+#ifdef _MSC_VER
+typedef int ssize_t;
+#endif
#include "transcode_data.h"
#include <ctype.h>
#include "st.h"