00001 /* 00002 * Copyright (C) 2006. QLogic Corporation. All Rights Reserved. 00003 */ 00004 00006 // 00007 // Copyright 2006 PathScale, Inc. All Rights Reserved. 00008 // 00009 // This program is free software; you can redistribute it and/or modify it 00010 // under the terms of version 2 of the GNU General Public License as 00011 // published by the Free Software Foundation. 00012 // 00013 // This program is distributed in the hope that it would be useful, but 00014 // WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 // 00017 // Further, this software is distributed without any warranty that it is 00018 // free of the rightful claim of any third person regarding infringement 00019 // or the like. Any license provided herein, whether implied or 00020 // otherwise, applies only to this software file. Patent licenses, if 00021 // any, provided herein do not apply to combinations of this program with 00022 // other software, or any other product whatsoever. 00023 // 00024 // You should have received a copy of the GNU General Public License along 00025 // with this program; if not, write the Free Software Foundation, Inc., 59 00026 // Temple Place - Suite 330, Boston MA 02111-1307, USA. 00028 00029 #include <stdio.h> 00030 #include <stdlib.h> 00031 00032 #include "gspin-base-types.h" 00033 #include "gspin-assert.h" 00034 00035 static void 00036 gs_assert_failure (gs_string_t file, gs_string_t function, gs_count_t line, 00037 const gs_string_t message) 00038 { 00039 fprintf(stderr, "Assertion failure in file: %s, function: %s, line: %d.\n", 00040 file, function, line); 00041 fprintf (stderr, "%s\n", message); 00042 } 00043 00044 void gs_assert(bool condition, 00045 gs_string_t file, 00046 gs_string_t function, 00047 gs_count_t line, 00048 const gs_string_t message) 00049 { 00050 if (condition == gs_true) 00051 return; 00052 gs_assert_failure(file, function, line, message); 00053 }
1.5.6