140805Smsmith/*- 240805Smsmith * Copyright (c) 1998 Michael Smith. 340805Smsmith * All rights reserved. 440805Smsmith * 540805Smsmith * Redistribution and use in source and binary forms, with or without 640805Smsmith * modification, are permitted provided that the following conditions 740805Smsmith * are met: 840805Smsmith * 1. Redistributions of source code must retain the above copyright 940805Smsmith * notice, this list of conditions and the following disclaimer. 1040805Smsmith * 2. Redistributions in binary form must reproduce the above copyright 1140805Smsmith * notice, this list of conditions and the following disclaimer in the 1240805Smsmith * documentation and/or other materials provided with the distribution. 1340805Smsmith * 1440805Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1540805Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1640805Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1740805Smsmith * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1840805Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1940805Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2040805Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2140805Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2240805Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2340805Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2440805Smsmith * SUCH DAMAGE. 2540805Smsmith */ 2640805Smsmith 2784221Sdillon#include <sys/cdefs.h> 2884221Sdillon__FBSDID("$FreeBSD$"); 2984221Sdillon 3040805Smsmith#include <assert.h> 3140805Smsmith 3280736Smp#include "stand.h" 3380736Smp 3440805Smsmithvoid 3585607Smike__assert(const char *func, const char *file, int line, const char *expression) 3640805Smsmith{ 3785607Smike if (func == NULL) 38205900Sjhb panic("Assertion failed: (%s), file %s, line %d.\n", 3985671Smike expression, file, line); 4085607Smike else 41205900Sjhb panic( 42205900Sjhb "Assertion failed: (%s), function %s, file %s, line %d.\n", 43205900Sjhb expression, func, file, line); 4440805Smsmith} 45