"Fossies" - the Fresh Open Source Software Archive

Member "AutoHotkey_L-1.1.33.09/source/debug.h" (8 May 2021, 996 Bytes) of package /windows/misc/AutoHotkey_L-1.1.33.09.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "debug.h" see the Fossies "Dox" file reference documentation.

    1 #pragma once
    2 // This file debugging defines some macros like MFC does.
    3 
    4 #ifndef TRACE
    5     #ifdef _DEBUG
    6         #ifdef _MSC_VER
    7             #define TRACE OutputDebugStringFormat
    8         #else
    9             #define TRACE(...) _ftprintf(stderr, __VA_ARGS__)
   10         #endif
   11     #else
   12         #define TRACE(...)
   13     #endif
   14 #endif
   15 
   16 /*
   17 This part of codes map the new operator to the debug version. Although the map is contains in "crtdbg.h",
   18 it is not really work (we will always get a wrong information show us the leaked memory blocks are allocated in "crtdbg.h").
   19 */
   20 #ifdef _MSC_VER
   21 //  #define _CRTDBG_MAP_ALLOC
   22     #include <crtdbg.h>
   23 //  #ifdef _DEBUG
   24 //      #define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
   25 //  #endif
   26 #endif
   27 
   28 #ifndef ASSERT
   29     #ifdef _ASSERTE
   30         #define ASSERT(expr) _ASSERTE(expr)
   31     #else
   32         #ifdef _DEBUG
   33             #include <assert.h>
   34             #define ASSERT(expr) assert(expr)
   35         #else
   36             #define ASSERT(expr)
   37         #endif
   38     #endif
   39 #endif
   40 
   41 #ifndef VERIFY
   42     #ifdef _DEBUG
   43         #define VERIFY(expr) ASSERT(expr)
   44     #else
   45         #define VERIFY(expr) expr
   46     #endif
   47 #endif