libsmbios_c library
sunpro_cc.hpp
Go to the documentation of this file.
1 // (C) Copyright John Maddock 2001.
2 // (C) Copyright Jens Maurer 2001 - 2003.
3 // (C) Copyright Peter Dimov 2002.
4 // (C) Copyright Aleksey Gurtovoy 2002 - 2003.
5 // (C) Copyright David Abrahams 2002.
6 // Use, modification and distribution are subject to the
7 // Boost Software License, Version 1.0. (See accompanying file
8 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 
10 // See http://www.boost.org for most recent version.
11 
12 // Sun C++ compiler setup:
13 
14 # if __SUNPRO_CC <= 0x500
15 # define LIBSMBIOS_NO_MEMBER_TEMPLATES
16 # define LIBSMBIOS_NO_FUNCTION_TEMPLATE_ORDERING
17 # endif
18 
19 # if (__SUNPRO_CC <= 0x520)
20  //
21  // Sunpro 5.2 and earler:
22  //
23  // although sunpro 5.2 supports the syntax for
24  // inline initialization it often gets the value
25  // wrong, especially where the value is computed
26  // from other constants (J Maddock 6th May 2001)
27 # define LIBSMBIOS_NO_INCLASS_MEMBER_INITIALIZATION
28 
29  // Although sunpro 5.2 supports the syntax for
30  // partial specialization, it often seems to
31  // bind to the wrong specialization. Better
32  // to disable it until suppport becomes more stable
33  // (J Maddock 6th May 2001).
34 # define LIBSMBIOS_NO_TEMPLATE_PARTIAL_SPECIALIZATION
35 # endif
36 
37 # if (__SUNPRO_CC <= 0x530)
38  // Requesting debug info (-g) with Boost.Python results
39  // in an internal compiler error for "static const"
40  // initialized in-class.
41  // >> Assertion: (../links/dbg_cstabs.cc, line 611)
42  // while processing ../test.cpp at line 0.
43  // (Jens Maurer according to Gottfried Ganssauge 04 Mar 2002)
44 # define LIBSMBIOS_NO_INCLASS_MEMBER_INITIALIZATION
45 
46  // SunPro 5.3 has better support for partial specialization,
47  // but breaks when compiling std::less<shared_ptr<T> >
48  // (Jens Maurer 4 Nov 2001).
49 
50  // std::less specialization fixed as reported by George
51  // Heintzelman; partial specialization re-enabled
52  // (Peter Dimov 17 Jan 2002)
53 
54 //# define LIBSMBIOS_NO_TEMPLATE_PARTIAL_SPECIALIZATION
55 
56  // integral constant expressions with 64 bit numbers fail
57 # define LIBSMBIOS_NO_INTEGRAL_INT64_T
58 # endif
59 
60 # if (__SUNPRO_CC < 0x570)
61 # define LIBSMBIOS_NO_TEMPLATE_TEMPLATES
62  // see http://lists.boost.org/MailArchives/boost/msg47184.php
63  // and http://lists.boost.org/MailArchives/boost/msg47220.php
64 # define LIBSMBIOS_NO_INCLASS_MEMBER_INITIALIZATION
65 # define LIBSMBIOS_NO_SFINAE
66 # define LIBSMBIOS_NO_ARRAY_TYPE_SPECIALIZATIONS
67 # endif
68 # if (__SUNPRO_CC <= 0x580)
69 # define LIBSMBIOS_NO_IS_ABSTRACT
70 # endif
71 
72 //
73 // Issues that effect all known versions:
74 //
75 #define LIBSMBIOS_NO_TWO_PHASE_NAME_LOOKUP
76 #define LIBSMBIOS_NO_ADL_BARRIER
77 
78 //
79 // C++0x features
80 //
81 
82 #if(__SUNPRO_CC >= 0x590)
83 # define LIBSMBIOS_HAS_LONG_LONG
84 #else
85 # define LIBSMBIOS_NO_LONG_LONG
86 #endif
87 
88 #define LIBSMBIOS_NO_AUTO_DECLARATIONS
89 #define LIBSMBIOS_NO_AUTO_MULTIDECLARATIONS
90 #define LIBSMBIOS_NO_CHAR16_T
91 #define LIBSMBIOS_NO_CHAR32_T
92 #define LIBSMBIOS_NO_CONCEPTS
93 #define LIBSMBIOS_NO_CONSTEXPR
94 #define LIBSMBIOS_NO_DECLTYPE
95 #define LIBSMBIOS_NO_DEFAULTED_FUNCTIONS
96 #define LIBSMBIOS_NO_DELETED_FUNCTIONS
97 #define LIBSMBIOS_NO_EXPLICIT_CONVERSION_OPERATORS
98 #define LIBSMBIOS_NO_EXTERN_TEMPLATE
99 #define LIBSMBIOS_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
100 #define LIBSMBIOS_NO_INITIALIZER_LISTS
101 #define LIBSMBIOS_NO_LAMBDAS
102 #define LIBSMBIOS_NO_NULLPTR
103 #define LIBSMBIOS_NO_RAW_LITERALS
104 #define LIBSMBIOS_NO_RVALUE_REFERENCES
105 #define LIBSMBIOS_NO_SCOPED_ENUMS
106 #define LIBSMBIOS_NO_SFINAE_EXPR
107 #define LIBSMBIOS_NO_STATIC_ASSERT
108 #define LIBSMBIOS_NO_TEMPLATE_ALIASES
109 #define LIBSMBIOS_NO_UNICODE_LITERALS
110 #define LIBSMBIOS_NO_VARIADIC_TEMPLATES
111 
112 //
113 // Version
114 //
115 
116 #define LIBSMBIOS_COMPILER "Sun compiler version " LIBSMBIOS_STRINGIZE(__SUNPRO_CC)
117 
118 //
119 // versions check:
120 // we don't support sunpro prior to version 4:
121 #if __SUNPRO_CC < 0x400
122 #error "Compiler not supported or configured - please reconfigure"
123 #endif
124 //
125 // last known and checked version is 0x590:
126 #if (__SUNPRO_CC > 0x590)
127 # if defined(LIBSMBIOS_ASSERT_CONFIG)
128 # error "Unknown compiler version - please run the configure tests and report the results"
129 # endif
130 #endif
131 
132 #ifndef UNREFERENCED_PARAMETER
133 #define UNREFERENCED_PARAMETER(P) ((void)(P))
134 #endif
135 
136 #define LIBSMBIOS_PACKED_ATTR __attribute__ ((packed))
137 
138 #define _dbg_iostream_out(stream, line) do { stream << line; } while(0)
139 #define _dbg_cout(line) _dbg_iostream_out(cout, line)
140 #define _dbg_cerr(line) _dbg_iostream_out(cerr, line)
141 #define _null_call( args...) do {} while(0)
142 #ifdef DEBUG_OUTPUT_ALL
143 #include <iostream>
144 #define DCOUT _dbg_cout
145 #define DCERR _dbg_cerr
146 #else
147 #define DCOUT _null_call
148 #define DCERR _null_call
149 #endif
150 
151 #define MARK_UNUSED __attribute__((unused))