fixed: compile issue
[opensg.git] / Source / Base / Base / OSGConfig.h
blob8b5663f66183bc1907919fccb11b50a98b9680ee
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2003 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGCONFIG_H_
40 #define _OSGCONFIG_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
46 #ifdef __hpux
47 #include <sys/types.h>
48 #endif
50 #if defined(__linux) || defined(WIN32) || defined(__APPLE__)
51 #include <cassert>
52 #endif
54 #ifdef __APPLE__
55 #include "TargetConditionals.h"
56 #endif
58 /*-------------------------------------------------------------------------*/
59 /* Versioning */
61 /*! @name Version Defines
64 /*!{*/
66 /*! The printable Version string. Includes the full version with specifiers,
67 e.g. "1.3.0pre1"
70 #define OSG_VERSION_STRING "2.0.0-pre1"
72 /*! The numeric full version, with two digits per major/minor/release, e.g.
73 010300
76 #define OSG_VERSION 0x020000
78 /*! The numeric major version number, e.g. 1
81 #define OSG_MAJOR_VERSION 2
83 /*! The numeric minor version number, e.g. 3
86 #define OSG_MINOR_VERSION 0
88 /*! The numeric release version number, e.g. 0
91 #define OSG_RELEASE_VERSION 0
94 /*!}*/
96 // Mac Hack
98 #ifdef __APPLE__
99 #define darwin
100 #endif
102 /*-------------------------------------------------------------------------*/
103 /* endian general */
105 #if defined(__sgi)
106 #include <standards.h>
107 #include <sys/endian.h>
108 // Some systems (notably VRJuggler) screw up the environment, so kludge it
109 # ifndef BYTE_ORDER
110 # define LITTLE_ENDIAN _LITTLE_ENDIAN
111 # define BIG_ENDIAN _BIG_ENDIAN
112 # define BYTE_ORDER _BYTE_ORDER
113 # endif
114 #elif defined(__hpux)
115 #include <arpa/nameser.h>
116 #include <pthread.h>
117 #elif defined(__sun)
118 #include <arpa/nameser_compat.h>
119 #elif defined(__APPLE__)
120 #include <machine/endian.h>
121 #elif defined(__linux)
122 #include <endian.h>
123 #ifndef __USE_BSD
124 # define LITTLE_ENDIAN __LITTLE_ENDIAN
125 # define BIG_ENDIAN __BIG_ENDIAN
126 # define PDP_ENDIAN __PDP_ENDIAN
127 # define BYTE_ORDER __BYTE_ORDER
128 #endif
129 #elif defined(WIN32) // HACK until I find a better solution
130 #define LITTLE_ENDIAN 1234
131 #define BIG_ENDIAN 4321
132 #define BYTE_ORDER LITTLE_ENDIAN
133 #elif defined(_WIN32_WCE) // HACK until I find a better solution
134 #define LITTLE_ENDIAN 1234
135 #define BIG_ENDIAN 4321
136 #define BYTE_ORDER LITTLE_ENDIAN
137 #else
138 #error Endian determination : could not guess your plattform
139 #endif
142 /*-------------------------------------------------------------------------*/
143 /* icc general */
145 #ifdef __ICL
146 #ifndef __INTEL_COMPILER
147 #define __INTEL_COMPILER __ICL
148 #endif
149 #endif
151 /*-------------------------------------------------------------------------*/
152 /* gcc general */
154 # ifdef __GNUC__
157 /*! \brief stream->rdbuf get the new buffer as a parameter
158 * \ingroup GrpBaseDefines
161 # define OSG_STREAM_RDBUF_HAS_PARAM
163 /*! \brief stream->isopen is available
164 * \ingroup GrpBaseDefines
167 # define OSG_STREAM_HAS_ISOPEN
169 /*! \brief vsnprintf is available
170 * \ingroup GrpBaseDefines
173 # define OSG_HAS_VSNPRINTF
175 /*! \brief nilbuffer is defined in the stdlib
176 * \ingroup GrpBaseDefines
179 # define OSG_HAS_NILBUF
181 /*! \brief LongLong constants have LL suffix
182 * \ingroup GrpBaseDefines
185 # define OSG_LONGLONG_HAS_LL
187 # define OSG_HAS_POSIXMEMALIGN
189 # define OSG_COMPILER_PART_SPEZ
191 # define OSG_NEED_BOOL_MFIELD_SPEZ
193 # if __GNUC__ >= 3
194 # define OSG_HASH_MAP_AS_EXT
196 /*! \brief SGI's stl implementation is available
197 * \ingroup GrpBaseDefines
200 # define OSG_SGI_STL
202 # define OSG_THROW_NOTHING() throw()
204 # define OSG_STDEXCEPTION_NAMESPACE std
206 # if __GNUC__ >= 4 || __GNUC_MINOR__ >=1
207 # define OSG_STDEXTENSION_NAMESPACE __gnu_cxx
208 # define OSG_HAS_SSTREAM
209 # else
210 # define OSG_STDEXTENSION_NAMESPACE std
211 # endif
213 # define OSG_STL_HAS_HASH_MAP
215 # else
216 # define OSG_HAS_INPUT_ITERATOR
218 # define OSG_THROW_NOTHING()
219 # if __GNUC_MINOR__ <= 96
220 # define OSG_GCC_NO_IOS_BASE
221 # endif
222 # endif
224 # if __GNUC__ >= 8
225 # define OSG_THROW(X)
226 # else
227 # define OSG_THROW(X) throw(X)
228 # endif
229 # else // __GNUC__
230 # define OSG_THROW(X) throw(X)
231 # endif
234 /*-------------------------------------------------------------------------*/
235 /* sgi CC */
237 # if defined(__sgi) && !defined(__GNUC__)
239 # if _COMPILER_VERSION < 730
240 # error compiler version < 730 not supported, please upgrade
241 # endif
243 /*! \brief stream->rdbuf get the new buffer as a parameter
244 * \ingroup GrpBaseDefines
247 # define OSG_STREAM_RDBUF_HAS_PARAM
249 /*! \brief stream->isopen is available
250 * \ingroup GrpBaseDefines
253 # define OSG_STREAM_HAS_ISOPEN
255 /*! \brief vsnprintf is available
256 * \ingroup GrpBaseDefines
259 # define OSG_HAS_VSNPRINTF
261 /*! \brief nilbuffer is defined in the stdlib
262 * \ingroup GrpBaseDefines
265 # define OSG_HAS_NILBUF
267 /*! \brief Use SGI internal types to define OpenSG base types
268 * \ingroup GrpBaseDefines
271 # define OSG_SGI_TYPES
273 /*! \brief atan2f function available
274 * \ingroup GrpBaseDefines
277 # define OSG_HAS_ATANF2
279 /*! \brief General float math
280 * \ingroup GrpBaseDefines
283 # define OSG_HAS_FLOATMATH
285 /*! \brief SGI's stl implementation is available
286 * \ingroup GrpBaseDefines
289 # define OSG_SGI_STL
291 # define OSG_STL_HAS_HASH_MAP
293 /*! \brief Use GLX
294 * \ingroup GrpBaseDefines
297 # define OSG_USE_GLX
299 /*! \brief LongLong constants have LL suffix
300 * \ingroup GrpBaseDefines
303 # define OSG_LONGLONG_HAS_LL
305 # define OSG_COMPILER_PART_SPEZ
307 # define OSG_THROW_NOTHING() THROW_NOTHING()
309 # define OSG_SGI_CC
311 # define OSG_FOUND_OS
313 # define OSG_STDEXCEPTION_NAMESPACE std
315 # endif // defined(__sgi) && !defined(__GNUC__)
320 /*-------------------------------------------------------------------------*/
321 /* Linux gcc */
323 # if defined(__GNUC__) && defined(__linux)
325 /*! \brief streams in std namespace
328 # define OSG_LINUX_TYPES
330 # define OSG_HAS_ATANF2
332 # define OSG_HAS_FLOATMATH
334 /*! \brief Use the math functions from the std:: namespace
335 * \ingroup GrpBaseDefines
336 The std:: namespace has a set of overloaded functions for many
337 math operations, up to and including long double versions.
340 # define OSG_USE_STDMATH
342 # define OSG_USE_GLX
344 # define OSG_USE_PTHREADS
346 # define OSG_LINUX_GCC
348 # define OSG_FOUND_OS
350 # endif // defined(__GNUC__) && defined(__linux)
352 /*-------------------------------------------------------------------------*/
353 /* Linux gcc ia64 */
355 # if defined(__GNUC__) && defined(__linux) && defined(__ia64)
357 # define SIZE_T_NEQ_UINT32
358 # define SIZE_T_64BIT
360 # endif // defined(__GNUC__) && defined(__linux) && defined(__ia64)
362 /*-------------------------------------------------------------------------*/
363 /* Linux icc */
365 # if defined(__INTEL_COMPILER) && defined(__linux)
367 # ifndef __ICL
368 # define __ICL __INTEL_COMPILER
369 # endif
371 # ifndef __INTEL_COMPILER_VERSION
372 # define __INTEL_COMPILER_VERSION __INTEL_COMPILER
373 # endif
375 # define OSG_STREAM_RDBUF_HAS_PARAM
377 # define OSG_STREAM_HAS_IOPEN
379 # define OSG_HAS_NILBUF
381 # define OSG_LINUX_TYPES
383 # define OSG_HAS_ATANF2
385 # define OSG_HAS_FLOATMATH
387 # define OSG_USE_GLX
389 # define OSG_LONGLONG_HAS_LL
391 # define OSG_COMPILER_PART_SPEZ
393 # if __INTEL_COMPILER_VERSION >= 710
394 # define OSG_THROW_NOTHING() throw()
395 # else
396 # define OSG_THROW_NOTHING()
397 # endif
399 //# define OSG_NO_INT8_PNT
401 # define OSG_USE_PTHREADS
403 # define OSG_LINUX_ICC
405 # define OSG_FOUND_OS
407 // icc >=8.1 uses gnu headers anyway, use gnu defines set above
408 #if __INTEL_COMPILER_VERSION < 810 || ! defined(__GNUC__)
409 # define OSG_STDEXTENSION_NAMESPACE std
410 # define OSG_STDEXCEPTION_NAMESPACE std
411 #endif
413 # define OSG_STL_HAS_HASH_MAP
415 # define OSG_HAS_SSTREAM
417 # define OSG_TMPL_STATIC_MEMBER_NEEDS_HELPER_FCT
419 # if __INTEL_COMPILER_VERSION >= 800
420 # define OSG_USE_HASH_COMPARE
421 # endif
423 # endif // defined(__INTEL_COMPILER) && defined(__linux)
425 /*-------------------------------------------------------------------------*/
426 /* Linux icc ia64 */
428 # if defined(__INTEL_COMPILER) && defined(__linux) && defined(__ia64)
430 # define OSG_NO_INT8_PNT
432 # endif // defined(__GNUC__) && defined(__linux) && defined(__ia64)
434 /*-------------------------------------------------------------------------*/
435 /* Windows icc */
437 # if defined(__INTEL_COMPILER) && !defined(__linux) && !defined(_WIN32_WCE) && defined(_MSC_VER) && _MSC_VER < 1300
439 # ifndef __ICL
440 # define __ICL __INTEL_COMPILER
441 # endif
443 // Use windows internal types to define OpenSG base types
444 # define OSG_WIN_TYPES
446 // Use windows threads
447 # define OSG_USE_WINTHREADS
450 // general float math
451 # define OSG_HAS_FLOATMATH
453 // Use WGL
454 # define OSG_USE_WGL
456 # define OSG_STREAM_HAS_ISOPEN
458 // it's there, it's just called something else
459 # define OSG_HAS_VSNPRINTF
460 # define vsnprintf _vsnprintf
462 # define OSG_HAS_NILBUF
463 # define OSG_STREAM_RDBUF_HAS_PARAM
465 # define OSG_LONGLONG_HAS_LL
467 # define OSG_COMPILER_PART_SPEZ
469 # define OSG_THROW_NOTHING()
471 # define OSG_WIN32_ICL
473 # define OSG_FOUND_OS
475 # define OSG_TMPL_STATIC_MEMBER_NEEDS_FUNCTION_INSTANTIATION
477 //# define OSG_HAS_VSNPRINTF
479 # endif // defined(__INTEL_COMPILER) && !defined(__linux)
482 # if defined(__INTEL_COMPILER) && !defined(__linux) && defined(_WIN32_WCE)
484 # ifndef __ICL
485 # define __ICL __INTEL_COMPILER
486 # endif
488 // Use windows internal types to define OpenSG base types
489 # define OSG_WIN_TYPES
491 // Use windows threads
492 # define OSG_USE_WINTHREADS
495 // general float math
496 # define OSG_HAS_FLOATMATH
498 // Use WGL
499 # define OSG_USE_EGL
501 # define OSG_GLES 100
503 # define OSG_WINCE 5
505 # define OSG_EMBEDDED
507 # define OSG_GL_ES_VERSION 100
509 # define OSG_STREAM_HAS_ISOPEN
511 //# define OSG_HAS_VSNPRINTF
513 # define OSG_HAS_NILBUF
514 # define OSG_STREAM_RDBUF_HAS_PARAM
516 # define OSG_LONGLONG_HAS_LL
518 # define OSG_COMPILER_PART_SPEZ
520 # define OSG_THROW_NOTHING()
522 # define OSG_WIN32_ICL
524 # define OSG_FOUND_OS
526 # define OSG_TMPL_STATIC_MEMBER_NEEDS_FUNCTION_INSTANTIATION
528 //# define OSG_HAS_VSNPRINTF
530 # endif // defined(__INTEL_COMPILER) && !defined(__linux)
532 /*-------------------------------------------------------------------------*/
533 /* Windows vc ce */
535 # if defined(_MSC_VER) && !defined(__ICL) && defined(_WIN32_WCE)
536 # define OSG_WIN_TYPES
537 // Use windows threads
538 # define OSG_USE_WINTHREADS
539 // general float math
540 # define OSG_HAS_FLOATMATH
542 # define OSG_USE_STDMATH
544 # define OSG_STREAM_HAS_ISOPEN
545 //# define OSG_HAS_VSNPRINTF
546 # define OSG_HAS_NILBUF
547 # define OSG_STREAM_RDBUF_HAS_PARAM
549 //# define OSG_MICROSOFT_COMPILER_ALERT
550 //# define OSG_MICROSOFT_COMPILER_HACKS
552 // Use WGL
553 # define OSG_USE_EGL
555 # define OSG_GLES
557 # define OSG_GL_ES_VERSION 100
559 # define OSG_WINCE 5
561 # define OSG_EMBEDDED
563 //# define OSG_HAS_TEMPLATE_RETURNVALUES
565 # define OSG_NEED_EXPLICIT_INST_FOR_STATIC
567 # define OSG_THROW_NOTHING()
569 # define OSG_WIN32_CL
571 # define OSG_FOUND_OS
573 # define OSG_TMPL_STATIC_MEMBER_NEEDS_CLASS_INSTANTIATION
575 # define OSG_STATIC_MEMEBER_NEEDS_COPY_ASIGN_INIT
577 # define OSG_MICROSOFT_DOTNET_COMPILER_HACKS
579 # if _MSC_VER >= 1300 && _MSC_VER < 1310
580 # define OSG_WIN32_CL_NET70 1
581 # endif
583 # if _MSC_VER > 1300
584 //# define OSG_NEED_BOOL_MFIELD_SPEZ
585 # endif
587 // vc 8.0
588 # if _MSC_VER >= 1400
589 # define OSG_STDEXCEPTION_NAMESPACE std
590 # endif
592 # endif // defined(_MSC_VER) && !defined(__ICL)
594 /*-------------------------------------------------------------------------*/
595 /* Windows vc */
597 # if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_WIN32_WCE)
598 # define OSG_WIN_TYPES
599 // Use windows threads
600 # define OSG_USE_WINTHREADS
601 // general float math
602 # define OSG_HAS_FLOATMATH
604 # define OSG_USE_STDMATH
606 # define OSG_STREAM_HAS_ISOPEN
608 // it's there, it's just called something else
609 # define OSG_HAS_VSNPRINTF
610 // vc 9.0 finally supports vsnprintf!
611 # if _MSC_VER < 1500
612 # define vsnprintf _vsnprintf
613 # endif
614 # define OSG_HAS_NILBUF
615 # define OSG_STREAM_RDBUF_HAS_PARAM
617 //# define OSG_MICROSOFT_COMPILER_ALERT
618 //# define OSG_MICROSOFT_COMPILER_HACKS
620 // Use WGL
621 # define OSG_USE_WGL
623 //# define OSG_HAS_TEMPLATE_RETURNVALUES
625 # define OSG_NEED_EXPLICIT_INST_FOR_STATIC
627 # define OSG_THROW_NOTHING()
629 # define OSG_WIN32_CL
631 # define OSG_FOUND_OS
633 # define OSG_TMPL_STATIC_MEMBER_NEEDS_CLASS_INSTANTIATION
635 # if _MSC_VER >= 1910
636 # define OSG_STATIC_MEMEBER_NEEDS_COPY_ASIGN_INIT 1
637 # define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE 1
638 # endif
640 # define OSG_MICROSOFT_DOTNET_COMPILER_HACKS
642 # if _MSC_VER >= 1300 && _MSC_VER < 1310
643 # define OSG_WIN32_CL_NET70 1
644 # endif
646 # if _MSC_VER > 1300
647 # define OSG_NEED_BOOL_MFIELD_SPEZ
648 # endif
650 // vc 8.0
651 # if _MSC_VER >= 1400
652 # define OSG_STDEXCEPTION_NAMESPACE std
653 # endif
655 # endif // defined(_MSC_VER) && !defined(__ICL)
657 /*-------------------------------------------------------------------------*/
658 /* Mac OSX gcc */
660 # if defined(__APPLE__)
662 # define OSG_LINUX_TYPES
663 # define OSG_NO_CONCEPT_CHECKS
664 # define SIZE_T_NEQ_UINT32
666 #if defined(__x86_64)
667 #define SIZE_T_64BIT
668 #endif
671 # include <AvailabilityMacros.h>
672 # if !defined(MAC_OS_X_VERSION_10_5) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5)
673 # define OSG_GLENUM_NEQ_UINT32
674 # endif
676 # define OSG_USE_PTHREADS
678 # define OSG_DLSYM_NEEDS_UNDERSCORE
680 # define OSG_USE_STDMATH
682 # define OSG_FOUND_OS
684 #if TARGET_OS_IPHONE || TARGET_OS_IPHONE_SIMULATOR
685 # define OSG_APPLE_IOS 1
686 #endif
688 # endif // if defined(__APPLE__)
691 /*-------------------------------------------------------------------------*/
692 /* HP-UX aC++ */
694 # if defined(__hpux) && !defined(__GNUC__)
696 /*! \brief stream->rdbuf get the new buffer as a parameter
697 * \ingroup GrpBaseDefines
700 # define OSG_STREAM_RDBUF_HAS_PARAM
702 /*! \brief stream->isopen is available
703 * \ingroup GrpBaseDefines
706 # define OSG_STREAM_HAS_ISOPEN
708 /*! \brief vsnprintf is available
709 * \ingroup GrpBaseDefines
712 # define OSG_HAS_VSNPRINTF
714 /*! \brief nilbuffer is defined in the stdlib
715 * \ingroup GrpBaseDefines
718 # define OSG_HAS_NILBUF
720 /*! \brief Use SGI internal types to define OpenSG base types
721 * \ingroup GrpBaseDefines
724 # define OSG_HPUX_TYPES
726 /*! \brief atan2f function available
727 * \ingroup GrpBaseDefines
730 # define OSG_HAS_ATANF2
732 /*! \brief General float math
733 * \ingroup GrpBaseDefines
736 # define OSG_HAS_FLOATMATH
738 /*! \brief SGI's stl implementation is available
739 * \ingroup GrpBaseDefines
742 //# define OSG_SGI_STL
744 /*! \brief Use GLX
745 * \ingroup GrpBaseDefines
748 # define OSG_USE_GLX
750 /*! \brief LongLong constants have LL suffix
751 * \ingroup GrpBaseDefines
754 # define OSG_LONGLONG_HAS_LL
756 # define OSG_COMPILER_PART_SPEZ
758 # define OSG_THROW_NOTHING() __THROWSPEC_NULL
760 # define OSG_USE_PTHREADS
762 # define OSG_HPUX_ACC
764 # define OSG_FOUND_OS
766 // # define OSG_NOGLUTSUBDIR
768 # define OSG_STDEXCEPTION_NAMESPACE std
770 # endif // defined(__hpux) && !defined(__GNUC__)
773 /*-------------------------------------------------------------------------*/
774 /* Sun CC */
776 # if defined(__sun) && !defined(__GNUC__)
778 /*! \brief stream->rdbuf get the new buffer as a parameter
779 * \ingroup GrpBaseDefines
782 # define OSG_STREAM_RDBUF_HAS_PARAM
784 /*! \brief stream->isopen is available
785 * \ingroup GrpBaseDefines
788 # define OSG_STREAM_HAS_ISOPEN
790 /*! \brief vsnprintf is available
791 * \ingroup GrpBaseDefines
794 # define OSG_HAS_VSNPRINTF
796 /*! \brief nilbuffer is defined in the stdlib
797 * \ingroup GrpBaseDefines
800 # define OSG_HAS_NILBUF
802 /*! \brief Use SGI internal types to define OpenSG base types
803 * \ingroup GrpBaseDefines
806 # define OSG_SUN_TYPES
808 /*! \brief atan2f function available
809 * \ingroup GrpBaseDefines
812 //# define OSG_HAS_ATANF2
814 /*! \brief General float math
815 * \ingroup GrpBaseDefines
818 //# define OSG_HAS_FLOATMATH
820 /*! \brief SGI's stl implementation is available
821 * \ingroup GrpBaseDefines
824 # define OSG_SGI_STL
826 /*! \brief Use GLX
827 * \ingroup GrpBaseDefines
830 # define OSG_USE_GLX
832 /*! \brief LongLong constants have LL suffix
833 * \ingroup GrpBaseDefines
836 # define OSG_LONGLONG_HAS_LL
838 # define OSG_COMPILER_PART_SPEZ
840 # define OSG_THROW_NOTHING() throw()
842 # define OSG_USE_PTHREADS
844 # define OSG_SUN_CC
846 # define OSG_FOUND_OS
848 # define OSG_STDEXCEPTION_NAMESPACE std
850 # define OSG_NO_INT8_PNT
852 # endif // defined(__sun) && !defined(__GNUC__)
855 #ifndef OSG_FOUND_OS
856 # error Could not determine compiler / os combination
857 #endif
860 #include "OSGExportDefines.h"
861 #include "OSGConfigured.h"
864 /* Mixed bag defines... */
866 // STLPORT doesn't support all of std::math
867 #if defined(STLPORT) ||defined(OSG_WITH_STLPORT)
868 #undef OSG_USE_STDMATH
869 #endif
871 # define OSG_USING_STD_NAMESPACE namespace std {} using namespace std;
872 # define OSG_STD std
874 /*! @name Namespace Defines
877 /*@{*/
879 /** \brief Begin the osg namespace
880 * \ingroup GrpBaseDefines
883 #ifdef OSG_USE_OSG2_NAMESPACE
884 # define OSG_BEGIN_NAMESPACE namespace OSG2 {
885 #else
886 # define OSG_BEGIN_NAMESPACE namespace OSG {
887 #endif
889 /** \brief End the osg namespace
890 * \ingroup GrpBaseDefines
893 # define OSG_END_NAMESPACE }
895 /** \brief Use the osg namespace throughout the following code.
896 * \ingroup GrpBaseDefines
899 #ifdef OSG_USE_OSG2_NAMESPACE
900 # define OSG_USING_NAMESPACE namespace OSG2 {} using namespace OSG2;
901 #else
902 # define OSG_USING_NAMESPACE namespace OSG {} using namespace OSG;
903 #endif
905 /** \brief Import the osg namespace throughout the following code.
906 * \ingroup GrpBaseDefines
909 #ifdef OSG_USE_OSG2_NAMESPACE
910 # define OSG_IMPORT_NAMESPACE using namespace OSG2
911 #else
912 # define OSG_IMPORT_NAMESPACE using namespace OSG
913 #endif
915 #ifdef OSG_USE_OSG2_NAMESPACE
916 # define OSG_NAMESPACE_PREFIX "OSG2"
917 #else
918 # define OSG_NAMESPACE_PREFIX "OSG"
919 #endif
921 /*@}*/
923 #ifdef OSG_USE_OSG2_NAMESPACE
924 # define OSG OSG2
925 #endif
927 #if defined(OSG_DLSYM_NEEDS_UNDERSCORE)
928 #define OSG_DLSYM_UNDERSCORE "_"
929 #else
930 #define OSG_DLSYM_UNDERSCORE
931 #endif
933 #ifdef OSG_WIN_TYPES
934 # ifndef OSG_NO_WINDOWD_H_INCLUDE
935 # include <windows.h>
936 # include <intrin.h>
937 # endif
938 #endif
940 #ifndef OSG_WIN_TYPES
941 # define OSG_APIENTRY
942 #else
943 # ifdef APIENTRY
944 # define OSG_APIENTRY APIENTRY
945 # elif defined(GLAPIENTRY)
946 # define OSG_APIENTRY GLAPIENTRY
947 # else
948 # error "Neither APIENTRY nor GLAPIENTRY defined"
949 # endif
950 #endif
952 #ifdef OSG_DEBUG
953 #define OSG_DEBUG_LOCK_STAT
954 #endif
956 #ifdef OSG_DEBUG_ARG
957 #define OSG_CHECK_ARG(ARG) ARG
958 #else
959 #define OSG_CHECK_ARG(ARG)
960 #endif
962 #ifdef OSG_DEBUG
963 #define OSG_DEBUG_CHECK_ARG(ARG) ARG
964 #else
965 #define OSG_DEBUG_CHECK_ARG(ARG)
966 #endif
968 #ifdef OSG_LONGLONG_HAS_LL
969 #define OSGLL(ARG) ARG##LL
970 #else
971 #define OSGLL(ARG) ARG
972 #endif
974 #ifdef OSG_1_COMPAT
975 #define osg OSG
976 #endif
978 #define OSG_ASSERT(expr) assert(expr)
980 //#define OSG_DBG_MEM
981 //#define OSG_DBG_LCK
983 // ToBeChecked Defaults
985 #if !defined(OSG_STDEXCEPTION_NAMESPACE)
986 # define OSG_STDEXCEPTION_NAMESPACE
987 #endif
989 #ifndef OSG_STDEXTENSION_NAMESPACE
990 # define OSG_STDEXTENSION_NAMESPACE std
991 #endif
993 #ifndef DOXYGEN_SHOULD_SKIP_THIS
994 # if !defined(OSG_DOC_LEVEL)
995 # define OSG_DOC_LEVEL 0
996 # endif
997 #endif
999 #define OSG_FLEX_USE_IOSTREAM_INPUT 1
1001 #define OSG_ASPECT_REFCOUNT
1003 //#define OSG_FCPTR_TYPED_STORE
1005 #ifdef OSG_ELDK
1007 # define OSG_EMBEDDED
1008 # define OSG_INTERNAL_GL_ES
1009 # define OSG_GLES 100
1010 # define OSG_GL_ES_VERSION 100
1012 #endif
1014 #define OSG_THREAD_DEBUG_SETASPECTTO
1016 // XXX: Todo: Add build support for this
1017 #if defined(OSG_ICC_GNU_COMPAT)
1019 # undef OSG_USE_HASH_COMPARE
1021 # if __GNUC__ >= 3
1022 # define OSG_HASH_MAP_AS_EXT
1024 /*! \brief SGI's stl implementation is available
1025 * \ingroup GrpBaseDefines
1027 # ifdef OSG_STDEXTENSION_NAMESPACE
1028 # undef OSG_STDEXTENSION_NAMESPACE
1029 # endif
1031 # if __GNUC_MINOR__ >=1 || __GNUC__ >= 4
1032 # define OSG_STDEXTENSION_NAMESPACE __gnu_cxx
1033 # else
1034 # define OSG_STDEXTENSION_NAMESPACE std
1035 # endif
1036 # endif
1037 #endif
1039 #if defined(__sgi) || defined(__linux) || defined(__APPLE__) || \
1040 defined(__sun) || defined(__hpux)
1042 #if defined(__linux) || defined(__hpux) || defined(__APPLE__) || defined(__sun)
1043 # if defined(__GNUC__)
1044 # if __GNUC__ >= 3
1045 # define OSG_STL_DEFAULT_ALLOCATOR(TP) std::allocator<TP>
1046 # endif
1047 # elif defined (__ICL)
1048 # define OSG_STL_DEFAULT_ALLOCATOR(TP) std::allocator<TP>
1049 # elif defined (OSG_HPUX_ACC)
1050 # define OSG_STL_DEFAULT_ALLOCATOR(TP) std::allocator<TP>
1051 # elif defined(OSG_SUN_CC)
1052 # define OSG_STL_DEFAULT_ALLOCATOR(TP) std::allocator<TP>
1053 # else
1054 # define OSG_STL_DEFAULT_ALLOCATOR(TP) std::__STL_DEFAULT_ALLOCATOR(TP)
1055 # endif
1056 #else
1057 # define OSG_STL_DEFAULT_ALLOCATOR(TP) std::__STL_DEFAULT_ALLOCATOR(TP)
1058 #endif
1060 #else
1061 #define OSG_STL_DEFAULT_ALLOCATOR(TP) std::allocator< TP >
1062 #endif
1064 #if (defined(__linux) && defined(__i386__)) || defined(WIN32)
1065 #define OSG_FAST_INT 1
1066 #endif
1068 #define OSG_DOUBLEMAGICROUNDEPS (.5-1.4e-11)
1069 #define OSG_DOUBLEMAGIC double(6755399441055744.0)
1071 #if defined(WIN32)
1074 // OSG_DISABLE_MICROSOFT_SECURE_CXXX
1075 // -D _CRT_SECURE_NO_DEPRECATE
1076 // -D _CRT_SECURE_NO_WARNINGS
1077 // -D _CRT_NONSTDC_NO_DEPRECATE
1078 // -D _SECURE_SCL = 0
1079 // -D _SCL_SECURE_NO_WARNINGS
1080 // -D _SCL_SECURE_NO_DEPRECATE
1082 # if defined(OSG_DISABLE_MICROSOFT_SECURE_CXXX)
1083 # if !defined(_SECURE_SCL) || _SECURE_SCL != 0
1084 # error "mixed up compiler settings, OpenSG libs with OSG_DISABLE_MICROSOFT_SECURE_CXXX on, but _SECURE_SCL not set or not equal 0"
1085 # endif
1086 # endif //OSG_DISABLE_MICROSOFT_SECURE_CXXX
1089 // OSG_DISABLE_MS_ITERATOR_DEBUGGING
1090 // -D _HAS_ITERATOR_DEBUGGING = 0
1092 # if defined(OSG_DISABLE_MS_ITERATOR_DEBUGGING)
1093 # if !defined(_HAS_ITERATOR_DEBUGGING) || _HAS_ITERATOR_DEBUGGING != 0
1094 # error "mixed up compiler settings, OpenSG libs with OSG_DISABLE_MS_ITERATOR_DEBUGGING on, but _HAS_ITERATOR_DEBUGGING not set or not equal 0"
1095 # endif
1096 # endif // OSG_DISABLE_MS_ITERATOR_DEBUGGING
1098 #endif // WIN32
1100 #endif /* _OSGCONFIG_H_ */