3
* ---------------------------------
4
* Copyright (c)2010 Daniel Fiser <danfis@danfis.cz>
7
* This file is part of libccd.
9
* Distributed under the OSI-approved BSD License (the "License");
10
* see accompanying file BDS-LICENSE for details or see
11
* <http://www.opensource.org/licenses/bsd-license.php>.
13
* This software is distributed WITHOUT ANY WARRANTY; without even the
14
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
* See the License for more information.
22
* Some macros which can be used for printing debug info to stderr if macro
25
* DBG_PROLOGUE can be specified as string and this string will be
26
* prepended to output text
36
# define DBG(format, ...) do { \
37
fprintf(stderr, DBG_PROLOGUE "%s :: " format "\n", __func__, ## __VA_ARGS__); \
41
# define DBG2(str) do { \
42
fprintf(stderr, DBG_PROLOGUE "%s :: " str "\n", __func__); \
46
# define DBG_VEC3(vec, prefix) do {\
47
fprintf(stderr, DBG_PROLOGUE "%s :: %s[%lf %lf %lf]\n", \
48
__func__, prefix, ccdVec3X(vec), ccdVec3Y(vec), ccdVec3Z(vec)); \
52
# define DBG_VEC3(vec, prefix) do {\
53
fprintf(stderr, DBG_PROLOGUE "%s :: %s[%.20lf %.20lf %.20lf]\n", \
54
__func__, prefix, ccdVec3X(vec), ccdVec3Y(vec), ccdVec3Z(vec)); \
60
# define DBG(format, ...)
62
# define DBG_VEC3(v, prefix)
65
#endif /* __CCD_DBG_H__ */