Main Page   Reference Manual   Namespace List   Compound List   Namespace Members   Compound Members   File Members  

libcwd/private_assert.h

Go to the documentation of this file.
00001 // $Header: /cvsroot/libcwd/libcwd/include/libcwd/private_assert.h,v 1.5 2004/06/03 12:23:07 libcw Exp $
00002 //
00003 // Copyright (C) 2000 - 2004, by
00004 // 
00005 // Carlo Wood, Run on IRC <carlo@alinoe.com>
00006 // RSA-1024 0x624ACAD5 1997-01-26                    Sign & Encrypt
00007 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6  F6 F6 55 DD 1C DC FF 61
00008 //
00009 // This file may be distributed under the terms of the Q Public License
00010 // version 1.0 as appearing in the file LICENSE.QPL included in the
00011 // packaging of this file.
00012 //
00013 
00018 #ifndef LIBCWD_PRIVATE_ASSERT_H
00019 #define LIBCWD_PRIVATE_ASSERT_H
00020 
00021 #ifndef LIBCWD_CONFIG_H
00022 #include <libcwd/config.h>
00023 #endif
00024 #ifndef LIBCW_CASSERT
00025 #define LIBCW_CASSERT
00026 #include <cassert>
00027 #endif
00028 
00029 namespace libcwd {
00030   namespace _private_ {
00031 
00032 void assert_fail(char const* expr, char const* file, int line, char const* function);
00033 
00034   } // namespace _private_
00035 } // namespace libcwd
00036 
00037 // Solaris8 doesn't define __STRING().
00038 #define LIBCWD_STRING(x) #x
00039 
00040 #define LIBCWD_ASSERT(expr) \
00041         (static_cast<void>((expr) ? 0 \
00042                                   : (::libcwd::_private_::\
00043                         assert_fail(LIBCWD_STRING(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__), 0)))
00044 
00045 #endif // LIBCWD_PRIVATE_ASSERT_H
00046 
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.