00001 /** @file rutz/abort.h low-level GVX_ABORT macro */ 00002 00003 /////////////////////////////////////////////////////////////////////// 00004 // 00005 // Copyright (c) 2005-2007 University of Southern California 00006 // Rob Peters <rjpeters at klab dot caltech dot edu> 00007 // 00008 // created: Thu Jun 30 15:26:45 2005 00009 // commit: $Id: abort.h 8249 2007-04-12 06:03:40Z rjpeters $ 00010 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/rutz/abort.h $ 00011 // 00012 // -------------------------------------------------------------------- 00013 // 00014 // This file is part of GroovX. 00015 // [http://www.klab.caltech.edu/rjpeters/groovx/] 00016 // 00017 // GroovX is free software; you can redistribute it and/or modify it 00018 // under the terms of the GNU General Public License as published by 00019 // the Free Software Foundation; either version 2 of the License, or 00020 // (at your option) any later version. 00021 // 00022 // GroovX is distributed in the hope that it will be useful, but 00023 // WITHOUT ANY WARRANTY; without even the implied warranty of 00024 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00025 // General Public License for more details. 00026 // 00027 // You should have received a copy of the GNU General Public License 00028 // along with GroovX; if not, write to the Free Software Foundation, 00029 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00030 // 00031 /////////////////////////////////////////////////////////////////////// 00032 00033 #ifndef GROOVX_RUTZ_ABORT_H_UTC20050630222645_DEFINED 00034 #define GROOVX_RUTZ_ABORT_H_UTC20050630222645_DEFINED 00035 00036 namespace rutz { namespace debug { 00037 /// Helper function called frmo the GVX_ABORT() macro. 00038 void abort_aux (const char* what, const char* where, 00039 int line_no) throw(); 00040 }} 00041 00042 /// Print a message and then abort(). 00043 /** You probably want to use GVX_PANIC() instead of this macro, 00044 GVX_PANIC() will also print a rutz::backtrace if there is one 00045 available. However, for truly low-level code that needs to avoid a 00046 dependency on rutz::backtrace, there is this bare-bones 00047 GVX_ABORT() depends on nothing except std library code. */ 00048 #define GVX_ABORT(message) \ 00049 rutz::debug::abort_aux(message, __FILE__, __LINE__) 00050 00051 static const char __attribute__((used)) vcid_groovx_rutz_abort_h_utc20050630222645[] = "$Id: abort.h 8249 2007-04-12 06:03:40Z rjpeters $ $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/rutz/abort.h $"; 00052 #endif // !GROOVX_RUTZ_ABORT_H_UTC20050630222645DEFINED