1 // $Header$ 2 // 3 // Copyright (C) 2000 - 2004, by 4 // 5 // Carlo Wood, Run on IRC <carlo@alinoe.com> 6 // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt 7 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 8 // 9 // This file may be distributed under the terms of the Q Public License 10 // version 1.0 as appearing in the file LICENSE.QPL included in the 11 // packaging of this file. 12 // 13 14 /** \file libcwd/private_assert.h 15 * Do not include this header file directly, instead include \ref preparation_step2 "debug.h". 16 */ 17 18 #ifndef LIBCWD_PRIVATE_ASSERT_H 19 #define LIBCWD_PRIVATE_ASSERT_H 20 21 #ifndef LIBCWD_CONFIG_H 22 #include <libcwd/config.h> 23 #endif 24 #ifndef LIBCW_CASSERT 25 #define LIBCW_CASSERT 26 #include <cassert> 27 #endif 28 29 namespace libcwd { 30 namespace _private_ { 31 32 void assert_fail(char const* expr, char const* file, int line, char const* function); 33 34 } // namespace _private_ 35 } // namespace libcwd 36 37 // Solaris8 doesn't define __STRING(). 38 #define LIBCWD_STRING(x) #x 39 40 #define LIBCWD_ASSERT(expr) \ 41 (static_cast<void>((expr) ? 0 \ 42 : (::libcwd::_private_::\ 43 assert_fail(LIBCWD_STRING(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__), 0))) 44 45 #endif // LIBCWD_PRIVATE_ASSERT_H 46 47