123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- #ifndef PNGDEBUG_H
- #define PNGDEBUG_H
- # ifndef PNG_LITERAL_SHARP
- # define PNG_LITERAL_SHARP 0x23
- # endif
- # ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET
- # define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b
- # endif
- # ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET
- # define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d
- # endif
- # ifndef PNG_STRING_NEWLINE
- # define PNG_STRING_NEWLINE "\n"
- # endif
- #ifdef PNG_DEBUG
- # if (PNG_DEBUG > 0)
- # if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
- # include <crtdbg.h>
- # if (PNG_DEBUG > 1)
- # ifndef _DEBUG
- # define _DEBUG
- # endif
- # ifndef png_debug
- # define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE)
- # endif
- # ifndef png_debug1
- # define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1)
- # endif
- # ifndef png_debug2
- # define png_debug2(l,m,p1,p2) \
- _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2)
- # endif
- # endif
- # else
- # ifndef PNG_STDIO_SUPPORTED
- # include <stdio.h>
- # endif
- # ifndef PNG_DEBUG_FILE
- # define PNG_DEBUG_FILE stderr
- # endif
- # if (PNG_DEBUG > 1)
- # ifdef __STDC__
- # ifndef png_debug
- # define png_debug(l,m) \
- do { \
- int num_tabs=l
- fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
- (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))))
- } while (0)
- # endif
- # ifndef png_debug1
- # define png_debug1(l,m,p1) \
- do { \
- int num_tabs=l
- fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
- (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1)
- } while (0)
- # endif
- # ifndef png_debug2
- # define png_debug2(l,m,p1,p2) \
- do { \
- int num_tabs=l
- fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
- (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2)
- } while (0)
- # endif
- # else
- # ifndef png_debug
- # define png_debug(l,m) \
- do { \
- int num_tabs=l
- char format[256]
- snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
- (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
- m,PNG_STRING_NEWLINE)
- fprintf(PNG_DEBUG_FILE,format)
- } while (0)
- # endif
- # ifndef png_debug1
- # define png_debug1(l,m,p1) \
- do { \
- int num_tabs=l
- char format[256]
- snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
- (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
- m,PNG_STRING_NEWLINE)
- fprintf(PNG_DEBUG_FILE,format,p1)
- } while (0)
- # endif
- # ifndef png_debug2
- # define png_debug2(l,m,p1,p2) \
- do { \
- int num_tabs=l
- char format[256]
- snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
- (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
- m,PNG_STRING_NEWLINE)
- fprintf(PNG_DEBUG_FILE,format,p1,p2)
- } while (0)
- # endif
- # endif
- # endif
- # endif
- # endif
- #endif
- #ifndef png_debug
- # define png_debug(l, m) ((void)0)
- #endif
- #ifndef png_debug1
- # define png_debug1(l, m, p1) ((void)0)
- #endif
- #ifndef png_debug2
- # define png_debug2(l, m, p1, p2) ((void)0)
- #endif
- #endif
|