You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.0 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: examples/c/example.c.assert/example.c.assert.c
  3. *
  4. * Purpose: C example program for Pantheios. Demonstrates:
  5. *
  6. * - how the Pantheios libraries must be explicitly
  7. * initialised in a C program; this is not the case in
  8. * C++ programs
  9. * - use of PANTHEIOS_ASSERT()
  10. *
  11. * Created: 8th May 2009
  12. * Updated: 22nd March 2010
  13. *
  14. * www: http://www.pantheios.org/
  15. *
  16. * License: This source code is placed into the public domain 2006
  17. * by Synesis Software Pty Ltd. There are no restrictions
  18. * whatsoever to your use of the software.
  19. *
  20. * This software is provided "as is", and any warranties,
  21. * express or implied, of any kind and for any purpose, are
  22. * disclaimed.
  23. *
  24. * ////////////////////////////////////////////////////////////////////// */
  25. /* Pantheios Header Files */
  26. #include <pantheios/assert.h>
  27. /* Standard C Header Files */
  28. #include <stdlib.h>
  29. /* /////////////////////////////////////////////////////////////////////////
  30. * Compiler compatibility
  31. */
  32. #ifdef STLSOFT_COMPILER_IS_BORLAND
  33. # pragma warn -8008
  34. # pragma warn -8066
  35. #endif
  36. /* ////////////////////////////////////////////////////////////////////// */
  37. /* Define the stock front-end process identity, so that it links when using
  38. * fe.N, fe.simple, etc. */
  39. const PAN_CHAR_T PANTHEIOS_FE_PROCESS_IDENTITY[] = PANTHEIOS_LITERAL_STRING("example.c.assert");
  40. /* ////////////////////////////////////////////////////////////////////// */
  41. int main()
  42. {
  43. int i = pantheios_init();
  44. if(i >= 0)
  45. {
  46. PANTHEIOS_ASSERT(1);
  47. PANTHEIOS_ASSERT(0);
  48. PANTHEIOS_MESSAGE_ASSERT(1, "it was true");
  49. PANTHEIOS_MESSAGE_ASSERT(0, "it was false");
  50. pantheios_uninit();
  51. }
  52. return EXIT_SUCCESS;
  53. }
  54. /* ////////////////////////////////////////////////////////////////////// */