--- gvpe/src/slog.C 2003/10/16 02:41:21 1.2 +++ gvpe/src/slog.C 2005/04/26 00:55:56 1.5 @@ -1,8 +1,10 @@ /* slog.C -- logging - Copyright (C) 2003 Marc Lehmann + Copyright (C) 2003 Marc Lehmann - This program is free software; you can redistribute it and/or modify + This file is part of GVPE. + + GVPE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -13,8 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + along with gvpe; if not, write to the Free Software + Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -92,6 +94,18 @@ void fatal (const char *m) { slog (L_CRIT, m); - exit (1); + exit (EXIT_FAILURE); +} + +extern void require_failed (const char *file, int line, const char *info) +{ + slog (L_CRIT, "FATAL: This program encountered a SHOULD NOT HAPPEN condition and will exit:"); + slog (L_CRIT, "FATAL+ %s:%d '%s' is false", file, line, info); + slog (L_CRIT, "FATAL+ This might indicates a bug in this program, a bug in your libraries,"); + slog (L_CRIT, "FATAL+ your system setup or operating system. Or it might indicate a very"); + slog (L_CRIT, "FATAL+ unusual, unanticipated operating condition, library version mismatch"); + slog (L_CRIT, "FATAL+ or similar problem. If it's not obvious to you what was causing it,"); + slog (L_CRIT, "FATAL+ then please report this to the program author(s)."); + exit (126); }