obsints.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /*
  6. * Test: obsints.c
  7. *
  8. * Description: make sure that protypes.h defines the obsolete integer
  9. * types intn, uintn, uint, int8, uint8, int16, uint16, int32, uint32,
  10. * int64, and uint64.
  11. */
  12. #include <stdio.h>
  13. #ifdef NO_NSPR_10_SUPPORT
  14. /* nothing to do */
  15. int main(int argc, char **argv)
  16. {
  17. printf("PASS\n");
  18. return 0;
  19. }
  20. #else /* NO_NSPR_10_SUPPORT */
  21. #include "prtypes.h" /* which includes protypes.h */
  22. int main(int argc, char **argv)
  23. {
  24. /*
  25. * Compilation fails if any of these integer types are not
  26. * defined by protypes.h.
  27. */
  28. intn in;
  29. uintn uin;
  30. uint ui;
  31. int8 i8;
  32. uint8 ui8;
  33. int16 i16;
  34. uint16 ui16;
  35. int32 i32;
  36. uint32 ui32;
  37. int64 i64;
  38. uint64 ui64;
  39. printf("PASS\n");
  40. return 0;
  41. }
  42. #endif /* NO_NSPR_10_SUPPORT */