1
/**************************************************************************\
3
* This file is part of the Coin 3D visualization library.
4
* Copyright (C) 1998-2005 by Systems in Motion. All rights reserved.
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* ("GPL") version 2 as published by the Free Software Foundation.
9
* See the file LICENSE.GPL at the root directory of this source
10
* distribution for additional information about the GNU GPL.
12
* For using Coin with software that can not be combined with the GNU
13
* GPL, and for taking advantage of the additional benefits of our
14
* support services, please contact Systems in Motion about acquiring
15
* a Coin Professional Edition License.
17
* See <URL:http://www.coin3d.org/> for more information.
19
* Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
20
* <URL:http://www.sim.no/>.
22
\**************************************************************************/
24
#ifndef SOQT_INTERNALDEFS_H
25
#define SOQT_INTERNALDEFS_H
27
/* ********************************************************************** */
30
#error this is a private header file
31
#endif /* !SOQT_INTERNAL */
35
#endif /* HAVE_CONFIG_H */
37
/* ********************************************************************** */
40
#define SOQT_STUB_FILE __FILE__
42
/* FIXME: avoid this case by redefining the compilation rules to define the
43
current filename in some variable. [20010919 larsa] */
44
#define SOQT_STUB_FILE ((char *)0L)
48
#define SOQT_STUB_LINE __LINE__
50
#define SOQT_STUB_LINE 0
54
#ifdef HAVE_CPP_COMPILER_FUNCTION_NAME_VAR
55
#define SOQT_STUB_FUNC HAVE_CPP_COMPILER_FUNCTION_NAME_VAR
57
#define SOQT_STUB_FUNC ((const char *)0L)
59
#else /* !__cplusplus */
60
#ifdef HAVE_C_COMPILER_FUNCTION_NAME_VAR
61
#define SOQT_STUB_FUNC HAVE_C_COMPILER_FUNCTION_NAME_VAR
63
#define SOQT_STUB_FUNC ((const char *)0L)
65
#endif /* !__cplusplus */
69
#include <Inventor/errors/SoDebugError.h>
72
This stupid thing is here to silence some compilers that complain on
73
constant if-expressions.
76
inline int soqt_not_null(const void * arg) { return (arg != NULL) ? 1 : 0; }
79
/* Collects common code from SOQT_STUB(), SOQT_STUB()_ONCE and
82
#define SOQT_FUNCTIONIDENTIFIER(SOQTSTR) \
83
SbString SOQTSTR(soqt_not_null(SOQT_STUB_FILE) ? SOQT_STUB_FILE : ""); \
84
if (SOQTSTR.getLength() > 0) { SOQTSTR += ':'; } \
85
SOQTSTR += SbString((int)SOQT_STUB_LINE); SOQTSTR += ':'; \
86
SOQTSTR += soqt_not_null(SOQT_STUB_FUNC) ? SOQT_STUB_FUNC : ""
89
SOQT_STUB(): a macro that prints out stub information.
90
Used where there is functionality missing.
95
SOQT_FUNCTIONIDENTIFIER(s); \
96
SoDebugError::postWarning(s.getString(), \
97
"STUB: functionality not yet completed"); \
101
SOQT_STUB_ONCE(): a macro that prints out stub information, but only on
102
the first pass. Used where there is functionality missing that may be
103
called hundreds of times.
106
#define SOQT_STUB_ONCE() \
108
static int first = 1; \
110
SOQT_FUNCTIONIDENTIFIER(s); \
111
SoDebugError::postWarning(s.getString(), \
112
"STUB: functionality not yet completed " \
113
"(first and last warning)"); \
119
SOQT_OBSOLETED(): a macro that prints out information about an obsoleted
120
function still being in use.
123
#define SOQT_OBSOLETED() \
125
SOQT_FUNCTIONIDENTIFIER(s); \
126
SoDebugError::post(s.getString(), \
127
"OBSOLETED: functionality no longer supported"); \
130
#else /* !SOQT_DEBUG */
133
#define SOQT_STUB() do { } while (0)
134
#define SOQT_STUB_ONCE() do { } while (0)
135
#define SOQT_OBSOLETED() do { } while (0)
137
#endif /* !SOQT_DEBUG */
143
#if defined(ENABLE_NLS) && defined(HAVE_GETTEXT)
145
#define _(String) dgettext (PACKAGE, String)
146
#define N_(String) (String)
148
#define _(String) (String)
149
#define N_(String) (String)
150
#endif /* HAVE_GETTEXT && ENABLE_NLS */
152
/* ********************************************************************** */
154
#endif /* ! SOQT_INTERNALDEFS_H */