mycrypt_argchk.h 457 B

123456789101112131415161718192021222324
  1. /* Defines the _ARGCHK macro used within the library */
  2. /* ch1-01-1 */
  3. /* ARGTYPE is defined in mycrypt_cfg.h */
  4. #if ARGTYPE == 0
  5. #include <signal.h>
  6. /* this is the default LibTomCrypt macro */
  7. void crypt_argchk(char *v, char *s, int d);
  8. #define _ARGCHK(x) if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); }
  9. #elif ARGTYPE == 1
  10. /* fatal type of error */
  11. #define _ARGCHK(x) assert((x))
  12. #elif ARGTYPE == 2
  13. #define _ARGCHK(x)
  14. #endif
  15. /* ch1-01-1 */