tassert.h 846 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * cifra - embedded cryptography library
  3. * Written in 2014 by Joseph Birr-Pixton <jpixton@gmail.com>
  4. *
  5. * To the extent possible under law, the author(s) have dedicated all
  6. * copyright and related and neighboring rights to this software to the
  7. * public domain worldwide. This software is distributed without any
  8. * warranty.
  9. *
  10. * You should have received a copy of the CC0 Public Domain Dedication
  11. * along with this software. If not, see
  12. * <http://creativecommons.org/publicdomain/zero/1.0/>.
  13. */
  14. #ifndef TASSERT_H
  15. #define TASSERT_H
  16. /* Tiny assert
  17. * -----------
  18. *
  19. * This is an assert(3) definition which doesn't include any
  20. * strings, but just branches to abort(3) on failure.
  21. */
  22. #ifndef FULL_FAT_ASSERT
  23. # include <stdlib.h>
  24. # define assert(expr) do { if (!(expr)) abort(); } while (0)
  25. #else
  26. # include <assert.h>
  27. #endif
  28. #endif