diff options
| author | Masaki Muranaka <[email protected]> | 2013-03-29 11:02:35 +0900 |
|---|---|---|
| committer | Masaki Muranaka <[email protected]> | 2013-03-29 11:02:35 +0900 |
| commit | 74f04849c4d04425e911acbe6bedb2596046f5b0 (patch) | |
| tree | 34272c291c59b5c6d6c8d1009f78e148eae807a4 /src/array.c | |
| parent | 2f8dc97e2d245c641af2f314df5b29c0182f833c (diff) | |
| download | mruby-74f04849c4d04425e911acbe6bedb2596046f5b0.tar.gz mruby-74f04849c4d04425e911acbe6bedb2596046f5b0.zip | |
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++.
Diffstat (limited to 'src/array.c')
| -rw-r--r-- | src/array.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/array.c b/src/array.c index c6f2d8001..88f56f6b4 100644 --- a/src/array.c +++ b/src/array.c @@ -4,17 +4,18 @@ ** 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/array.h" #include "mruby/class.h" #include "mruby/string.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_SHRINK_RATIO 5 /* must be larger than 2 */ #define ARY_C_MAX_SIZE (SIZE_MAX / sizeof(mrb_value)) |
