Subversion Repositories Kolibri OS

Rev

Rev 4973 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  3.  
  4. #undef assert
  5. #undef unimpl
  6.  
  7. #ifdef NDEBUG
  8. #define assert(test) /*nothing*/
  9. #else
  10. #define assert(test) ((void)((test)||(__dj_assert(#test,__FILE__,__LINE__),0)))
  11. #endif
  12. #define unimpl()       __dj_unimp("Called unimplemented function in file \"" __FILE__ "\"\n")
  13.  
  14. #ifndef __dj_include_assert_h_
  15. #define __dj_include_assert_h_
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20.  
  21. #ifdef _MSC_VER
  22. void __declspec(noreturn) __dj_assert(const char *,const char *,int);
  23. void __declspec(noreturn) __dj_unimp(const char *fn);
  24. #else
  25. void    __dj_assert(const char *,const char *,int) __attribute__((__noreturn__));
  26. void    __dj_unimp(const char *fn) __attribute__((__noreturn__));
  27. #endif
  28.  
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32.  
  33. #endif /* !__dj_include_assert_h_ */
  34.  
  35. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  36.