"Fossies" - the Fresh Open Source Software Archive

Member "feh-3.4.1/src/debug.h" (29 May 2020, 1921 Bytes) of package /linux/privat/feh-3.4.1.tar.bz2:


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 and the latest Fossies "Diffs" side-by-side code changes report: 3.4_vs_3.4.1.

    1 /* debug.h
    2 
    3 Copyright (C) 1999-2003 Tom Gilbert.
    4 Copyright (C) 2010-2020 Daniel Friesel.
    5 
    6 Permission is hereby granted, free of charge, to any person obtaining a copy
    7 of this software and associated documentation files (the "Software"), to
    8 deal in the Software without restriction, including without limitation the
    9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   10 sell copies of the Software, and to permit persons to whom the Software is
   11 furnished to do so, subject to the following conditions:
   12 
   13 The above copyright notice and this permission notice shall be included in
   14 all copies of the Software and its documentation and acknowledgment shall be
   15 given in the documentation and software packages that this Software was
   16 used.
   17 
   18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
   21 THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
   22 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   23 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   24 
   25 */
   26 
   27 #ifndef DEBUG_H
   28 #define DEBUG_H
   29 
   30 #ifdef WITH_DMALLOC
   31 #include <dmalloc.h>
   32 #define emalloc(a) malloc(a)
   33 #define estrdup(a) strdup(a)
   34 #define erealloc(a,b) realloc(a,b)
   35 #else
   36 #define emalloc(a) _emalloc(a)
   37 #define estrdup(a) _estrdup(a)
   38 #define erealloc(a,b) _erealloc(a,b)
   39 #endif
   40 
   41 #ifdef DEBUG
   42 #ifdef __GNUC__
   43 #define D(a) \
   44 { \
   45     if (opt.debug) { \
   46         printf("%-12s +%-4u %-20s : ",__FILE__,__LINE__,__FUNCTION__); \
   47         printf a; \
   48         fflush(stdout); \
   49     } \
   50   }
   51 #else                   /* __GNUC__ */
   52 #define D(a) \
   53 { \
   54     if (opt.debug) { \
   55         printf("%-12s +%-4u : ",__FILE__,__LINE__); \
   56         printf a; \
   57         fflush(stdout); \
   58     } \
   59 }
   60 #endif                  /* __GNUC__ */
   61 #else                   /* DEBUG */
   62 #define D(a)
   63 #endif                  /* DEBUG */
   64 
   65 #endif                  /* DEBUG_H */