Index: src/base/macros.h |
diff --git a/src/base/macros.h b/src/base/macros.h |
index 687a33eaddbc2cfc9acb7fd4eeee8c401fa748a8..3f09b2b9ce8af8939d64f85418a2e64a98387ad0 100644 |
--- a/src/base/macros.h |
+++ b/src/base/macros.h |
@@ -5,8 +5,13 @@ |
#ifndef V8_BASE_MACROS_H_ |
#define V8_BASE_MACROS_H_ |
+#include <stddef.h> |
+#include <stdint.h> |
+ |
+#include <cstring> |
+ |
+#include "src/base/build_config.h" |
#include "src/base/compiler-specific.h" |
-#include "src/base/format-macros.h" |
#include "src/base/logging.h" |
@@ -273,10 +278,17 @@ |
#if V8_OS_MACOSX |
#undef V8PRIxPTR |
#define V8PRIxPTR "lx" |
-#undef V8PRIdPTR |
-#define V8PRIdPTR "ld" |
#undef V8PRIuPTR |
#define V8PRIuPTR "lxu" |
+#endif |
+ |
+// GCC on S390 31-bit expands 'size_t' to 'long unsigned int' |
+// instead of 'int', resulting in compilation errors with %d. |
+// The printf format specifier needs to be %zd instead. |
+#if V8_HOST_ARCH_S390 && !V8_HOST_ARCH_64_BIT |
+#define V8_SIZET_PREFIX "z" |
+#else |
+#define V8_SIZET_PREFIX "" |
#endif |
// The following macro works on both 32 and 64-bit platforms. |