1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/tests/TestPRIntN.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include <stdint.h> 1.9 +#include "prtypes.h" 1.10 + 1.11 +// This test is NOT intended to be run. It's a test to make sure 1.12 +// PRInt{N} matches int{N}_t. If they don't match, we should get a 1.13 +// compiler warning or error in main(). 1.14 + 1.15 +static void 1.16 +ClearNSPRIntTypes(PRInt8 *a, PRInt16 *b, PRInt32 *c, PRInt64 *d) 1.17 +{ 1.18 + *a = 0; *b = 0; *c = 0; *d = 0; 1.19 +} 1.20 + 1.21 +static void 1.22 +ClearStdIntTypes(int8_t *w, int16_t *x, int32_t *y, int64_t *z) 1.23 +{ 1.24 + *w = 0; *x = 0; *y = 0; *z = 0; 1.25 +} 1.26 + 1.27 +int 1.28 +main() 1.29 +{ 1.30 + PRInt8 a; PRInt16 b; PRInt32 c; PRInt64 d; 1.31 + int8_t w; int16_t x; int32_t y; int64_t z; 1.32 + 1.33 + ClearNSPRIntTypes(&w, &x, &y, &z); 1.34 + ClearStdIntTypes(&a, &b, &c, &d); 1.35 + return 0; 1.36 +}