- Main Page
- Classes
- Files
- Directories
- Related Pages

# kyra/util/gldebug.h

    00001 /*
    00002 Copyright (c) 2000-2003 Lee Thomason (www.grinninglizard.com)
    00003
    00004 Grinning Lizard Utilities. Note that software that uses the
    00005 utility package (including Lilith3D and Kyra) have more restrictive
    00006 licences which applies to code outside of the utility package.
    00007
    00008
    00009 This software is provided 'as-is', without any express or implied
    00010 warranty. In no event will the authors be held liable for any
    00011 damages arising from the use of this software.
    00012
    00013 Permission is granted to anyone to use this software for any
    00014 purpose, including commercial applications, and to alter it and
    00015 redistribute it freely, subject to the following restrictions:
    00016
    00017 1. The origin of this software must not be misrepresented; you must
    00018 not claim that you wrote the original software. If you use this
    00019 software in a product, an acknowledgment in the product documentation
    00020 would be appreciated but is not required.
    00021
    00022 2. Altered source versions must be plainly marked as such, and
    00023 must not be misrepresented as being the original software.
    00024
    00025 3. This notice may not be removed or altered from any source
    00026 distribution.
    00027 */
    00028
    00029
    00030 #ifndef DEBUG_INCLUDED
    00031 #define DEBUG_INCLUDED
    00032
    00033 #if defined( _DEBUG ) && !defined( DEBUG )
    00034         #define DEBUG
    00035 #endif
    00036
    00037 #if defined(DEBUG)
    00038         #ifdef _WIN32
    00039                 void dprintf( const char* format, ... );
    00040                 void WinDebugBreak();
    00041
    00042                 #define GLASSERT( x )           if ( !(x)) WinDebugBreak()
    00043                 #define GLOUTPUT dprintf
    00044         #else
    00045                 #include <assert.h>
    00046         #include <stdio.h>
    00047                 #define GLASSERT                assert
    00048                 #define GLOUTPUT                printf
    00049         #endif
    00050
    00051         #define GLLOG GLOUTPUT
    00052
    00053 #else
    00054
    00055         #if defined(UNIX)
    00056                 inline void nullprintf( const char* format, ...) {};
    00057                 #define GLOUTPUT                nullprintf
    00058         #else
    00059                 #define GLOUTPUT                __noop
    00060         #endif
    00061
    00062         #define GLASSERT( x )
    00063         #define GLLOG                           printf
    00064
    00065 #endif
    00066
    00067
    00068
    00069 #endif