Chromium Code Reviews| Index: base/format_macros.h |
| diff --git a/base/format_macros.h b/base/format_macros.h |
| index 466d79be731bf5d8c2e4f57c5c1109d5d985b612..0c07bf3d3b0461b3fc97310af1fcd296a3804adf 100644 |
| --- a/base/format_macros.h |
| +++ b/base/format_macros.h |
| @@ -46,6 +46,34 @@ |
| #define PRIuS "zu" |
| #endif |
| +// The size of NSInteger and NSUInteger varies between 32-bit and 64-bit |
| +// architectures and Apple does not provides standard format macros and |
| +// recommends casting. This has many drawback, so instead define macros |
|
Mark Mentovai
2014/03/06 17:02:42
drawback -> drawbacks
sdefresne
2014/03/06 18:10:54
Done.
|
| +// for formatting those types. |
| +#if defined(OS_MACOSX) |
| +#if defined(ARCH_CPU_64_BITS) |
| +#if !defined(PRIdNS) |
| +#define PRIdNS "ld" |
| +#endif |
| +#if !defined(PRIuNS) |
| +#define PRIuNS "lu" |
| +#endif |
| +#if !defined(PRIxNS) |
| +#define PRIxNS "lx" |
| +#endif |
| +#else // defined(ARCH_CPU_64_BITS) |
| +#if !defined(PRIdNS) |
| +#define PRIdNS "d" |
| +#endif |
| +#if !defined(PRIuNS) |
| +#define PRIuNS "u" |
| +#endif |
| +#if !defined(PRIxNS) |
| +#define PRIxNS "x" |
| +#endif |
| +#endif |
| +#endif // defined(OS_MACOSX) |
| + |
| #else // OS_WIN |
| #if !defined(PRId64) |