TestPRIntN.cpp 844 B

12345678910111213141516171819202122232425262728293031323334
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #include <stdint.h>
  5. #include "prtypes.h"
  6. // This test is NOT intended to be run. It's a test to make sure
  7. // PRInt{N} matches int{N}_t. If they don't match, we should get a
  8. // compiler warning or error in main().
  9. static void
  10. ClearNSPRIntTypes(PRInt8 *a, PRInt16 *b, PRInt32 *c, PRInt64 *d)
  11. {
  12. *a = 0; *b = 0; *c = 0; *d = 0;
  13. }
  14. static void
  15. ClearStdIntTypes(int8_t *w, int16_t *x, int32_t *y, int64_t *z)
  16. {
  17. *w = 0; *x = 0; *y = 0; *z = 0;
  18. }
  19. int
  20. main()
  21. {
  22. PRInt8 a; PRInt16 b; PRInt32 c; PRInt64 d;
  23. int8_t w; int16_t x; int32_t y; int64_t z;
  24. ClearNSPRIntTypes(&w, &x, &y, &z);
  25. ClearStdIntTypes(&a, &b, &c, &d);
  26. return 0;
  27. }