Commit 74f04849 authored by Masaki Muranaka's avatar Masaki Muranaka

Rearrange SIZE_MAX. It is supported also VC++ since its version10. And there...

Rearrange SIZE_MAX. It is supported also VC++ since its version10. And there seems SIZE_MAX is defined in stdint.h. And it possibly (depends on the version of VC++) conflicts with SIZE_MAX in limits.h. This patch is no need if I did not support VC++.
parent 2f8dc97e
...@@ -4,17 +4,18 @@ ...@@ -4,17 +4,18 @@
** See Copyright Notice in mruby.h ** See Copyright Notice in mruby.h
*/ */
#ifndef SIZE_MAX
/* Some versions of VC++
* has SIZE_MAX in stdint.h
*/
# include <limits.h>
#endif
#include "mruby.h" #include "mruby.h"
#include "mruby/array.h" #include "mruby/array.h"
#include "mruby/class.h" #include "mruby/class.h"
#include "mruby/string.h" #include "mruby/string.h"
#include "value_array.h" #include "value_array.h"
/* SIZE_MAX is not supported by VC++. */
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t)-1)
#endif
#define ARY_DEFAULT_LEN 4 #define ARY_DEFAULT_LEN 4
#define ARY_SHRINK_RATIO 5 /* must be larger than 2 */ #define ARY_SHRINK_RATIO 5 /* must be larger than 2 */
#define ARY_C_MAX_SIZE (SIZE_MAX / sizeof(mrb_value)) #define ARY_C_MAX_SIZE (SIZE_MAX / sizeof(mrb_value))
......
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
** See Copyright Notice in mruby.h ** See Copyright Notice in mruby.h
*/ */
#ifndef SIZE_MAX
/* Some versions of VC++
* has SIZE_MAX in stdint.h
*/
# include <limits.h>
#endif
#include <string.h> #include <string.h>
#include "mruby.h" #include "mruby.h"
#include "mruby/array.h" #include "mruby/array.h"
...@@ -15,10 +21,6 @@ ...@@ -15,10 +21,6 @@
#include "mruby/string.h" #include "mruby/string.h"
#include "mruby/variable.h" #include "mruby/variable.h"
#ifndef SIZE_MAX
#include <limits.h> // for SIZE_MAX
#endif
/* /*
= Tri-color Incremental Garbage Collection = Tri-color Incremental Garbage Collection
......
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
** See Copyright Notice in mruby.h ** See Copyright Notice in mruby.h
*/ */
#ifndef SIZE_MAX
/* Some versions of VC++
* has SIZE_MAX in stdint.h
*/
# include <limits.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "mruby/dump.h" #include "mruby/dump.h"
......
...@@ -5,7 +5,12 @@ ...@@ -5,7 +5,12 @@
*/ */
#include <ctype.h> #include <ctype.h>
#include <limits.h> #ifndef SIZE_MAX
/* Some versions of VC++
* has SIZE_MAX in stdint.h
*/
# include <limits.h>
#endif
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment