home *** CD-ROM | disk | FTP | other *** search
- /*
- #### # # # #
- # # # # # The FreeWare C library for
- # # ## ### # # # # ### RISC OS machines
- # # # # # # # # # # # ___________________________________
- # # #### ### ## # # # #
- # # # # # # # # # # Please refer to the accompanying
- #### ### #### # # ##### # ### documentation for conditions of use
- ________________________________________________________________________
-
- File: WAssert.h
- Author: Copyright © 1993 Mark H. Wilkinson
- Version: 1.00 (05 Sep 1993)
- Purpose: Wimp version of ANSI assert() system, based on RISCOS_Lib
- version presented in Archive magazine 6.12.53 by Remo Biagioni.
- */
-
- /* NOTES
- * Assertions are used for debugging programs. They should be placed liberally
- * throughout your code to check that certain conditions are met during
- * development, and then the program re-compiled without them for final
- * release.
- *
- * e.g. if you have a function that expects a parameter which must be positive
- * then it should include a line like:
- * assert(parameter >= 0, "Parameter is negative!");
- *
- * If 'parameter' is not >= 0 then a wimp error box will report the fact,
- * indicating where in your source the assertion failed.
- *
- * To use assertions you must compile your code with _DEBUG defined
- * (i.e. run the compiler with the extra switch -D_DEBUG)
- *
- * To build a release version of your program without the assertions in it
- * (which will reduce the size of the program and increase execution speed)
- * simply compile it ensuring that _DEBUG is not defined.
- */
-
-
- #ifndef __dl_wassert_h
- # define __dl_wassert_h
- extern void __wassert(char *);
- #else
- # undef assert
- #endif
-
- #ifdef _DEBUG
- # define assert(ignore) ((void)0)
- #else
- # define __SR(x) __VL(x)
- # define __VL(x) #x
- # define assert(e) ((e) ? (void)0 : _wassert("Assertion " #e " failed at line " __SR(__LINE__) " of file " __FILE__))
- #endif
-
-