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

# grinliz/gldebug.h

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