libsmbios_c library
|
00001 // (C) Copyright John Maddock 2001 - 2003. 00002 // (C) Copyright Darin Adler 2001 - 2002. 00003 // (C) Copyright Jens Maurer 2001 - 2002. 00004 // (C) Copyright Beman Dawes 2001 - 2003. 00005 // (C) Copyright Douglas Gregor 2002. 00006 // (C) Copyright David Abrahams 2002 - 2003. 00007 // (C) Copyright Synge Todo 2003. 00008 // Use, modification and distribution are subject to the 00009 // Boost Software License, Version 1.0. (See accompanying file 00010 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00011 00012 // See http://www.boost.org for most recent version. 00013 00014 // GNU C++ compiler setup: 00015 00016 # if __GNUC__ == 2 && __GNUC_MINOR__ == 91 00017 // egcs 1.1 won't parse shared_ptr.hpp without this: 00018 # define LIBSMBIOS_NO_AUTO_PTR 00019 # endif 00020 # if __GNUC__ == 2 && __GNUC_MINOR__ < 95 00021 // 00022 // Prior to gcc 2.95 member templates only partly 00023 // work - define LIBSMBIOS_MSVC6_MEMBER_TEMPLATES 00024 // instead since inline member templates mostly work. 00025 // 00026 # define LIBSMBIOS_NO_MEMBER_TEMPLATES 00027 # if __GNUC_MINOR__ >= 9 00028 # define LIBSMBIOS_MSVC6_MEMBER_TEMPLATES 00029 # endif 00030 # endif 00031 00032 # if __GNUC__ == 2 && __GNUC_MINOR__ < 96 00033 # define LIBSMBIOS_NO_SFINAE 00034 # endif 00035 00036 # if __GNUC__ == 2 && __GNUC_MINOR__ <= 97 00037 # define LIBSMBIOS_NO_MEMBER_TEMPLATE_FRIENDS 00038 # define LIBSMBIOS_NO_OPERATORS_IN_NAMESPACE 00039 # endif 00040 00041 # if __GNUC__ < 3 00042 # define LIBSMBIOS_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE 00043 # define LIBSMBIOS_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL 00044 # endif 00045 00046 #ifndef __EXCEPTIONS 00047 # define LIBSMBIOS_NO_EXCEPTIONS 00048 #endif 00049 00050 // GCC has __PRETTY_FUNCTION__ macro 00051 #define LIBSMBIOS_HAS_PRETTY_FUNCTION 00052 #define LIBSMBIOS_HAS_FUNCTION 00053 #define LIBSMBIOS_PACKED_ATTR __attribute__ ((packed)) 00054 00055 #ifndef UNREFERENCED_PARAMETER 00056 #define UNREFERENCED_PARAMETER(P) ((void)(P)) 00057 #endif 00058 00059 # if __GNUC__ > 4 00060 // internal compiler error in RHEL4 gcc when this is used. 00061 #define MARK_UNUSED __attribute__ ((unused)) 00062 #else 00063 #define MARK_UNUSED 00064 #endif 00065 00066 #define _dbg_iostream_out(stream, line) do { stream << line; } while(0) 00067 #define _dbg_cout(line) _dbg_iostream_out(cout, line) 00068 #define _dbg_cerr(line) _dbg_iostream_out(cerr, line) 00069 #define _null_call( args...) do {} while(0) 00070 #ifdef DEBUG_OUTPUT_ALL 00071 #include <iostream> 00072 #define DCOUT _dbg_cout 00073 #define DCERR _dbg_cerr 00074 #else 00075 #define DCOUT _null_call 00076 #define DCERR _null_call 00077 #endif 00078 00079 // 00080 // Bug specific to gcc 3.1 and 3.2: 00081 // 00082 #if (__GNUC__ == 3) && ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2)) 00083 # define LIBSMBIOS_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS 00084 #endif 00085 00086 // 00087 // Threading support: Turn this on unconditionally here (except for 00088 // those platforms where we can know for sure). It will get turned off again 00089 // later if no threading API is detected. 00090 // 00091 #if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__) 00092 # define LIBSMBIOS_HAS_THREADS 00093 #endif 00094 00095 // 00096 // gcc has "long long" 00097 // 00098 #define LIBSMBIOS_HAS_LONG_LONG 00099 00100 // 00101 // gcc implements the named return value optimization since version 3.1 00102 // 00103 #if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) 00104 #define LIBSMBIOS_HAS_NRVO 00105 #endif 00106 00107 #define LIBSMBIOS_COMPILER "GNU C++ version " __VERSION__ 00108 00109 // 00110 // versions check: 00111 // we don't know gcc prior to version 2.90: 00112 #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90) 00113 # error "Compiler not configured - please reconfigure" 00114 #endif 00115 // 00116 #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)) 00117 # if defined(LIBSMBIOS_ASSERT_CONFIG) 00118 # error "Unknown compiler version - please run the configure tests and report the results" 00119 # else 00120 # warning "Unknown compiler version - please run the configure tests and report the results" 00121 # endif 00122 #endif 00123 00124