~ubuntu-branches/ubuntu/oneiric/soqt/oneiric

« back to all changes in this revision

Viewing changes to build/msvc6/src/soqtdefs.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2006-02-06 22:34:00 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060206223400-g69m5soqa4zh0gkc
Tags: 1.3.0-3
debian/control: update libsoqt-dev depends.  Closes: #351700.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************\
 
2
 *
 
3
 *  This file is part of the Coin 3D visualization library.
 
4
 *  Copyright (C) 1998-2005 by Systems in Motion.  All rights reserved.
 
5
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
17
 *  See <URL:http://www.coin3d.org/> for more information.
 
18
 *
 
19
 *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
 
20
 *  <URL:http://www.sim.no/>.
 
21
 *
 
22
\**************************************************************************/
 
23
 
 
24
#ifndef SOQT_INTERNALDEFS_H
 
25
#define SOQT_INTERNALDEFS_H
 
26
 
 
27
/* ********************************************************************** */
 
28
 
 
29
#ifndef SOQT_INTERNAL
 
30
#error this is a private header file
 
31
#endif /* !SOQT_INTERNAL */
 
32
 
 
33
#ifdef HAVE_CONFIG_H
 
34
#include <config.h>
 
35
#endif /* HAVE_CONFIG_H */
 
36
 
 
37
/* ********************************************************************** */
 
38
 
 
39
#ifdef __FILE__
 
40
#define SOQT_STUB_FILE __FILE__
 
41
#else
 
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)
 
45
#endif
 
46
 
 
47
#ifdef __LINE__
 
48
#define SOQT_STUB_LINE __LINE__
 
49
#else
 
50
#define SOQT_STUB_LINE 0
 
51
#endif
 
52
 
 
53
#ifdef __cplusplus
 
54
#ifdef HAVE_CPP_COMPILER_FUNCTION_NAME_VAR
 
55
#define SOQT_STUB_FUNC HAVE_CPP_COMPILER_FUNCTION_NAME_VAR
 
56
#else
 
57
#define SOQT_STUB_FUNC ((const char *)0L)
 
58
#endif
 
59
#else /* !__cplusplus */
 
60
#ifdef HAVE_C_COMPILER_FUNCTION_NAME_VAR
 
61
#define SOQT_STUB_FUNC HAVE_C_COMPILER_FUNCTION_NAME_VAR
 
62
#else
 
63
#define SOQT_STUB_FUNC ((const char *)0L)
 
64
#endif
 
65
#endif /* !__cplusplus */
 
66
 
 
67
#if SOQT_DEBUG
 
68
 
 
69
#include <Inventor/errors/SoDebugError.h>
 
70
 
 
71
/*
 
72
  This stupid thing is here to silence some compilers that complain on
 
73
  constant if-expressions.
 
74
*/
 
75
 
 
76
inline int soqt_not_null(const void * arg) { return (arg != NULL) ? 1 : 0; }
 
77
 
 
78
 
 
79
/* Collects common code from SOQT_STUB(), SOQT_STUB()_ONCE and
 
80
   SOQT_OBSOLETED(). */
 
81
 
 
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 : ""
 
87
 
 
88
/*
 
89
  SOQT_STUB(): a macro that prints out stub information.
 
90
  Used where there is functionality missing.
 
91
*/
 
92
 
 
93
#define SOQT_STUB() \
 
94
  do { \
 
95
    SOQT_FUNCTIONIDENTIFIER(s); \
 
96
    SoDebugError::postWarning(s.getString(), \
 
97
                              "STUB: functionality not yet completed"); \
 
98
  } while (0)
 
99
 
 
100
/*
 
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.
 
104
*/
 
105
 
 
106
#define SOQT_STUB_ONCE() \
 
107
  do { \
 
108
    static int first = 1; \
 
109
    if (first) { \
 
110
      SOQT_FUNCTIONIDENTIFIER(s); \
 
111
      SoDebugError::postWarning(s.getString(), \
 
112
                                "STUB: functionality not yet completed " \
 
113
                                "(first and last warning)"); \
 
114
      first = 0; \
 
115
    } \
 
116
  } while (0)
 
117
 
 
118
/*
 
119
  SOQT_OBSOLETED(): a macro that prints out information about an obsoleted
 
120
  function still being in use.
 
121
*/
 
122
 
 
123
#define SOQT_OBSOLETED() \
 
124
  do { \
 
125
    SOQT_FUNCTIONIDENTIFIER(s); \
 
126
    SoDebugError::post(s.getString(), \
 
127
                       "OBSOLETED: functionality no longer supported"); \
 
128
  } while (0)
 
129
 
 
130
#else /* !SOQT_DEBUG */
 
131
 
 
132
/* snub the stubs */
 
133
#define SOQT_STUB()      do { } while (0)
 
134
#define SOQT_STUB_ONCE() do { } while (0)
 
135
#define SOQT_OBSOLETED() do { } while (0)
 
136
 
 
137
#endif /* !SOQT_DEBUG */
 
138
 
 
139
/*
 
140
  GETTEXT support
 
141
*/
 
142
 
 
143
#if defined(ENABLE_NLS) && defined(HAVE_GETTEXT)
 
144
#include <libintl.h>
 
145
#define _(String) dgettext (PACKAGE, String)
 
146
#define N_(String) (String)
 
147
#else
 
148
#define _(String) (String)
 
149
#define N_(String) (String)
 
150
#endif /* HAVE_GETTEXT && ENABLE_NLS */
 
151
 
 
152
/* ********************************************************************** */
 
153
 
 
154
#endif /* ! SOQT_INTERNALDEFS_H */