diff options
| author | Richard Brooksby | 2012-04-23 16:20:40 +0100 |
|---|---|---|
| committer | Richard Brooksby | 2012-04-23 16:20:40 +0100 |
| commit | 61890da12b3d0150f25b6edd783f320d957b223f (patch) | |
| tree | 1f8cf8bb503f9a33616c1a783a8497ada33f6ed7 /mps/code/testlib.h | |
| parent | ea4257879f044d79b0fbb0701acdda6268322a87 (diff) | |
| download | emacs-61890da12b3d0150f25b6edd783f320d957b223f.tar.gz emacs-61890da12b3d0150f25b6edd783f320d957b223f.zip | |
Fixing up occurences of "unsigned long" in the main mps and test code so that we no longer assume that "unsigned long" is large enough for a pointer or size, or that it's the longest available integer type, since these are not true on 64-bit windows.
Copied from Perforce
Change: 178021
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code/testlib.h')
| -rw-r--r-- | mps/code/testlib.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mps/code/testlib.h b/mps/code/testlib.h index 2a70fa81f58..63d462a6658 100644 --- a/mps/code/testlib.h +++ b/mps/code/testlib.h | |||
| @@ -75,6 +75,30 @@ | |||
| 75 | #endif /* MPS_BUILD_MV */ | 75 | #endif /* MPS_BUILD_MV */ |
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | /* ulongest_t -- longest unsigned integer type | ||
| 79 | * | ||
| 80 | * Define a longest unsigned integer type for testing and printing. We'd | ||
| 81 | * like to use C99's uintmax_t and PRIuMAX here, but the MPS is in C89 | ||
| 82 | * and C99 isn't supported by Microsoft. | ||
| 83 | * | ||
| 84 | * We avoid using the ones defined in mpstd.h because we want the tests to | ||
| 85 | * root out any incompatible assumptions by breaking. | ||
| 86 | */ | ||
| 87 | |||
| 88 | #ifdef MPS_PF_W3I6MV | ||
| 89 | #define PRIuLONGEST "llu" | ||
| 90 | #define PRIXLONGEST "llX" | ||
| 91 | #define PRIwLONGEST "16" | ||
| 92 | typedef unsigned long long ulongest_t; | ||
| 93 | #else | ||
| 94 | #define PRIuLONGEST "lu" | ||
| 95 | #define PRIXLONGEST "lX" | ||
| 96 | #define PRIwLONGEST "8" | ||
| 97 | typedef unsigned long ulongest_t; | ||
| 98 | #endif | ||
| 99 | #define PRIXPTR "0"PRIwLONGEST PRIXLONGEST | ||
| 100 | |||
| 101 | |||
| 78 | /* testlib_unused -- declares that a variable is unused | 102 | /* testlib_unused -- declares that a variable is unused |
| 79 | * | 103 | * |
| 80 | * It should be used to prevent compiler warnings about unused | 104 | * It should be used to prevent compiler warnings about unused |