aboutsummaryrefslogtreecommitdiffstats
path: root/ext/psych/yaml/yaml_private.h
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-04 19:18:01 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-04 19:18:01 +0000
commite8132aa4d78c5ea43e01df44b54abdedb1ff7bf0 (patch)
tree65dadae7dd5a9d3d2251cf830bbe3483395e9dc8 /ext/psych/yaml/yaml_private.h
parentfc4321ea3fc5be0868be8501536014ac04e9b46b (diff)
downloadruby-e8132aa4d78c5ea43e01df44b54abdedb1ff7bf0.tar.gz
* ext/psych/yaml/emitter.c: merge libyaml 0.1.5
* ext/psych/yaml/loader.c: ditto * ext/psych/yaml/parser.c: ditto * ext/psych/yaml/reader.c: ditto * ext/psych/yaml/scanner.c: ditto * ext/psych/yaml/writer.c: ditto * ext/psych/yaml/yaml_private.h: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/yaml/yaml_private.h')
-rw-r--r--ext/psych/yaml/yaml_private.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/ext/psych/yaml/yaml_private.h b/ext/psych/yaml/yaml_private.h
index af10c83973..9589e052fe 100644
--- a/ext/psych/yaml/yaml_private.h
+++ b/ext/psych/yaml/yaml_private.h
@@ -1,6 +1,3 @@
-#ifdef RUBY_EXTCONF_H
-#include RUBY_EXTCONF_H
-#endif
#if HAVE_CONFIG_H
#include <config.h>
@@ -10,6 +7,17 @@
#include <assert.h>
#include <limits.h>
+#include <stddef.h>
+
+#ifndef _MSC_VER
+#include <stdint.h>
+#else
+#ifdef _WIN64
+#define PTRDIFF_MAX _I64_MAX
+#else
+#define PTRDIFF_MAX INT_MAX
+#endif
+#endif
/*
* Memory management.
@@ -231,9 +239,9 @@ yaml_string_join(
(string).pointer[offset] <= (yaml_char_t) 'f') ? \
((string).pointer[offset] - (yaml_char_t) 'a' + 10) : \
((string).pointer[offset] - (yaml_char_t) '0'))
-
+
#define AS_HEX(string) AS_HEX_AT((string),0)
-
+
/*
* Check if the character is ASCII.
*/
@@ -424,6 +432,12 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
#define STACK_EMPTY(context,stack) \
((stack).start == (stack).top)
+#define STACK_LIMIT(context,stack,size) \
+ ((stack).top - (stack).start < (size) ? \
+ 1 : \
+ ((context)->error = YAML_MEMORY_ERROR, \
+ 0))
+
#define PUSH(context,stack,value) \
(((stack).top != (stack).end \
|| yaml_stack_extend((void **)&(stack).start, \