// Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker
// This file is part of the "Luxinia Engine".
// For conditions of distribution and use, see copyright notice in luxiniapublicsdk.txt
//
// <Author: Christoph Kubisch>


#ifndef __LUXCORE_DEBUG_H__
#define __LUXCORE_DEBUG_H__

#include <luxplatform/luxplatform.h>

//////////////////////////////////////////////////////////////////////////
// Debug

#ifdef __cplusplus
extern "C"{
#endif

void debugAssertFailed( const char *file, int line, const char *expression );
void debugPrintf(const char* format, ...);


//////////////////////////////////////////////////////////////////////////
#ifdef LUX_DEVBUILD
	#define LUX_ASSERT( X )						if ( !(X) ) debugAssertFailed( __FILE__, __LINE__, #X )
	#define LUX_PRINTF			debugPrintf
#else
	#define LUX_ASSERT			LUX_NOOP
	#define LUX_PRINTF			LUX_NOOP
#endif

#ifdef _DEBUG
	#define LUX_DEBUGASSERT( X )	if ( !(X) ) debugAssertFailed( __FILE__, __LINE__, #X )
	#define LUX_DEBUGPRINTF			debugPrintf
#ifdef LUX_SIMD
	#define LUX_SIMDASSERT( X )		if ( !(X) ) debugAssertFailed( __FILE__, __LINE__, #X )
#else
	#define LUX_SIMDASSERT			LUX_NOOP
#endif
#else
	#define LUX_DEBUGASSERT			LUX_NOOP
	#define LUX_DEBUGPRINTF			LUX_NOOP
	#define LUX_SIMDASSERT			LUX_NOOP
#endif

#ifdef __cplusplus
};  
#endif

#endif
