//
// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
//
// The contents of this file are covered under the licence agreement in the
// file "LICENCE" distributed with Cforall.
//
// assert --
//
// Author           : Thierry Delisle
// Created On       : Mon Nov 28 12:27:26 2016
// Last Modified By : Thierry Delisle
// Last Modified On : Mon Nov 28 12:27:26 2016
// Update Count     : 0
//

#ifndef __ASSERT_H__
#define __ASSERT_H__

extern "C" {
	#include <assert.h>

	#ifdef NDEBUG
		#define assertf(expr, fmt, ...) ((void)0)
	#else
		#define __STRINGIFY__(str) #str
		#define __VSTRINGIFY__(str) __STRINGIFY__(str)
		#define assertf(expr, fmt, ...) ((expr) ? ((void)0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ ))

		void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) __attribute__((noreturn));
	#endif
}

#endif // __ASSERT_H__

// Local Variables: //
// mode: c //
// tab-width: 4 //
// End: //
