00001 #ifndef SGE_ASSERT_HPP_INCLUDED
00002 #define SGE_ASSERT_HPP_INCLUDED
00003
00004 #include "string.hpp"
00005 #include "text.hpp"
00006 #include "export.hpp"
00007 #include "stringize.hpp"
00008 #include "file.hpp"
00009
00010 namespace sge
00011 {
00012 namespace detail
00013 {
00014 SGE_SYMBOL void process_assert(
00015 string const &file,
00016 string const &line,
00017 string const &condition,
00018 string const &message = string(),
00019 string const &function = string());
00020 }
00021 }
00022
00023 #define SGE_ASSERT_MESSAGE(cond,message)\
00024 if (!(cond))\
00025 sge::detail::process_assert(\
00026 SGE_FILE,\
00027 SGE_STRINGIZE(__LINE__),\
00028 SGE_STRINGIZE(cond),\
00029 message);
00030
00031 #define SGE_ASSERT(cond)\
00032 if (!(cond))\
00033 sge::detail::process_assert(\
00034 SGE_FILE,\
00035 SGE_STRINGIZE(__LINE__),\
00036 SGE_STRINGIZE(cond));
00037
00038 #endif