Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SbBase.h
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Paul S. Strauss (MMM yyyy)
25** Modified by : Nick Thompson (MMM yyyy)
26**=======================================================================*/
27/*=======================================================================
28 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
29 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
30 *** ***
31 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
32 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
33 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
34 *** ***
35 *** RESTRICTED RIGHTS LEGEND ***
36 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
37 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
38 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
39 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
40 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
41 *** ***
42 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
43 *** BORDEAUX, FRANCE ***
44 *** ALL RIGHTS RESERVED ***
45**=======================================================================*/
46/*=======================================================================
47** Modified by : VSG (MMM YYYY)
48**=======================================================================*/
49
50
51#ifndef _SB_BASE_
52#define _SB_BASE_
53
54#ifndef HIDDEN_FROM_DOC
55
56#if defined(_WIN32)
57#pragma warning(disable:4251)
58#endif
59
60#include <SoVersion.h>
61#include <SoDeprecationRules.h>
62
63#include <SbTypes.h>
64#include <stdlib.h>
65#include <sys/types.h>
66
67#include <stdio.h>
68
69#include <Inventor/non_winsys.h>
70
71#endif //HIDDEN_FROM_DOC
72
73#ifndef FALSE
75# define FALSE 0
77# define TRUE 1
78#endif
79
87typedef int SbBool;
88
89typedef void *SbHandle;
90
91#ifndef HIDDEN_FROM_DOC
92#define _SBHANDLE_ 1
93
94#include <Inventor/sys/port.h>
95#include <Inventor/SoInventorBaseLibName.h>
96
97#ifdef _WIN32
98typedef unsigned int SbThreadId_t;
99#else
100#include <pthread.h> //for defn of pthread_t
101typedef pthread_t SbThreadId_t;
102#endif
103
114#define SoEXTENDER
115
126#define SoEXTENDER_Documented
127
138#define SoINTERNAL
139
143#if defined(__STDC__) || defined(__ANSI_CPP__) || defined(_WIN32)
144/* ANSI C */
145# define SO__QUOTE(str) #str
146#else
147/* Non-ANSI C */
148# define SO__QUOTE(str) "str"
149#endif
150
154#if defined(__STDC__) || defined(__ANSI_CPP__) || defined(_WIN32)
155/* ANSI C */
156# define SO__CONCAT(str1, str2) str1##str2
157#else
158/* Non-ANSI C */
159# define SO__CONCAT(str1, str2) str1str2
160#endif
161
163//
164// Map the single-precision math functions to the regular ones on
165// machines that don't support them.
166//
168#if defined(__x86_64__)
169# define OIV_PTR_SIZE 64
170# define OIV_LONG_SIZE 64
171#else
172# define OIV_PTR_SIZE 32
173# define OIV_LONG_SIZE 32
174#endif
175
176#if defined(_WIN32) && (_MSC_VER >=1300)
177
178// We define SoNONUNICODE only in the internal build
179#ifdef OIV_UNICODE_CHECK
180# define SoNONUNICODE \
181 __declspec(deprecated( "!!! This function is not unicode! IT SHOULD NOT BE USED !!!" ) )
182#else
183# define SoNONUNICODE
184#endif // OIV_UNICODE_CHECK
185
186#else // defined(_WIN32) && (_MSC_VER >=1300)
187
188# define SoNONUNICODE
189
190#endif // defined(_WIN32) && (_MSC_VER >=1300)
191
192#if (defined(__GNUC__) && (__GNUC__ >= 4))
193#define SoPRINTFPREFIX(stringIndex, firstToCheck) __attribute__((format(printf, stringIndex, firstToCheck)))
194#define SoPRINTF __attribute__((format(printf, 1, 2)))
195#else
196#define SoPRINTFPREFIX(stringIndex, firstToCheck)
197#define SoPRINTF
198#endif
199
200
201#if (defined(_WIN32) && (_MSC_VER < 1400))
202// no VA_ARGS support in macro
203#ifdef DEBUG_PRINTF
204static inline void SODEBUGPRINTF(const char *format, ...){
205 va_list ap;
206 va_start(ap, format);
207 vfprintf(stderr,format,ap);
208 va_end(ap);
209}
210#else
211static inline void SODEBUGPRINTF(...) {}
212#endif
213
214#else
215// support VA_ARGS in macro
216
217#ifdef DEBUG_PRINTF
218#define SODEBUGPRINTF(format, ...) fprintf (stderr, format, __VA_ARGS__)
219#else
220#ifdef _WIN32
221#pragma managed(push, off)
222#endif
223inline static void SODEBUGPRINTF(const char *, ...) {}
224#ifdef _WIN32
225#pragma managed(pop)
226#endif
227#endif
228
229#endif // VA_ARGS support
230
231#ifdef _WIN32
232
233#if !defined(InventorBase_EXPORTS)
234#ifndef OIV_DISABLE_AUTOLINK
235# pragma comment(lib,__INVENTORBASELIB)
236#endif
237#endif
238
239#endif // _WIN32
240
245#define SO_UNUSED_PARAM(P)
246
247#endif //HIDDEN_FROM_DOC
248
249#endif // _SB_BASE_
250
251
int SbBool
Boolean type.
Definition SbBase.h:87