debug.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Support for debug.c in iofuncs.
  2. */
  3. /*
  4. This file is part of VIPS.
  5. VIPS is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU Lesser General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. 02110-1301 USA
  17. */
  18. /*
  19. These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
  20. */
  21. #ifndef VIPS_DEBUG_H
  22. #define VIPS_DEBUG_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif /*__cplusplus*/
  26. #ifdef VIPS_DEBUG
  27. #define VIPS_DEBUG_MSG( ... ) \
  28. G_STMT_START { printf( __VA_ARGS__ ); } G_STMT_END
  29. #else
  30. #define VIPS_DEBUG_MSG( ... ) \
  31. G_STMT_START { ; } G_STMT_END
  32. #endif /*VIPS_DEBUG*/
  33. #ifdef VIPS_DEBUG_RED
  34. #define VIPS_DEBUG_MSG_RED( ... ) \
  35. G_STMT_START { printf( "red: " __VA_ARGS__ ); } G_STMT_END
  36. #else
  37. #define VIPS_DEBUG_MSG_RED( ... ) \
  38. G_STMT_START { ; } G_STMT_END
  39. #endif /*VIPS_DEBUG_RED*/
  40. #ifdef VIPS_DEBUG_AMBER
  41. #define VIPS_DEBUG_MSG_AMBER( ... ) \
  42. G_STMT_START { printf( "amber: " __VA_ARGS__ ); } G_STMT_END
  43. #else
  44. #define VIPS_DEBUG_MSG_AMBER( ... ) \
  45. G_STMT_START { ; } G_STMT_END
  46. #endif /*VIPS_DEBUG_AMBER*/
  47. #ifdef VIPS_DEBUG_GREEN
  48. #define VIPS_DEBUG_MSG_GREEN( ... ) \
  49. G_STMT_START { printf( "green: " __VA_ARGS__ ); } G_STMT_END
  50. #else
  51. #define VIPS_DEBUG_MSG_GREEN( ... ) \
  52. G_STMT_START { ; } G_STMT_END
  53. #endif /*VIPS_DEBUG_GREEN*/
  54. #ifdef __cplusplus
  55. }
  56. #endif /*__cplusplus*/
  57. #endif /* VIPS_DEBUG_H */