]> andersk Git - libyaml.git/blobdiff - src/yaml_private.h
Merge tag 'upstream/0.1.6' into debian
[libyaml.git] / src / yaml_private.h
index f2483839b9c83688d002a24cec56cde5e1b185f5..f0e10010242a59f6e9c2e7d8ceca0fd198786bd4 100644 (file)
@@ -9,6 +9,16 @@
 #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.
  */
@@ -133,9 +143,12 @@ yaml_string_join(
      (string).start = (string).pointer = (string).end = 0)
 
 #define STRING_EXTEND(context,string)                                           \
-    (((string).pointer+5 < (string).end)                                        \
+    ((((string).pointer+5 < (string).end)                                       \
         || yaml_string_extend(&(string).start,                                  \
-            &(string).pointer, &(string).end))
+            &(string).pointer, &(string).end)) ?                                \
+         1 :                                                                    \
+        ((context)->error = YAML_MEMORY_ERROR,                                  \
+         0))
 
 #define CLEAR(context,string)                                                   \
     ((string).pointer = (string).start,                                         \
This page took 0.045576 seconds and 4 git commands to generate.