libsmbios_c library
suffix.h
Go to the documentation of this file.
1// Boost config.h configuration header file ------------------------------//
2
3// (C) Copyright John Maddock 2001 - 2003.
4// (C) Copyright Darin Adler 2001.
5// (C) Copyright Peter Dimov 2001.
6// (C) Copyright Bill Kempf 2002.
7// (C) Copyright Jens Maurer 2002.
8// (C) Copyright David Abrahams 2002 - 2003.
9// (C) Copyright Gennaro Prota 2003.
10// (C) Copyright Eric Friedman 2003.
11// Use, modification and distribution are subject to the
12// Boost Software License, Version 1.0. (See accompanying file
13// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
14
15// See http://www.boost.org for most recent version.
16
17// Boost config.h policy and rationale documentation has been moved to
18// http://www.boost.org/libs/config
19//
20// This file is intended to be stable, and relatively unchanging.
21// It should contain boilerplate code only - no compiler specific
22// code unless it is unavoidable - no changes unless unavoidable.
23
24#ifndef LIBSMBIOS_C_CONFIG_SUFFIX_H
25#define LIBSMBIOS_C_CONFIG_SUFFIX_H
26
27//
28// look for long long by looking for the appropriate macros in <limits.h>.
29// Note that we use limits.h rather than climits for maximal portability,
30// remember that since these just declare a bunch of macros, there should be
31// no namespace issues from this.
32//
33#include <limits.h>
34# if !defined(LIBSMBIOS_C_HAS_LONG_LONG) \
35 && !(defined(LIBSMBIOS_C_MSVC) && LIBSMBIOS_C_MSVC <=1300) && !defined(__BORLANDC__) \
36 && (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
37# define LIBSMBIOS_C_HAS_LONG_LONG
38#endif
39#if !defined(LIBSMBIOS_C_HAS_LONG_LONG) && !defined(LIBSMBIOS_C_NO_INTEGRAL_INT64_T)
40# define LIBSMBIOS_C_NO_INTEGRAL_INT64_T
41#endif
42
43// GCC 3.x will clean up all of those nasty macro definitions that
44// LIBSMBIOS_C_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine
45// it under GCC 3.x.
46#if defined(__GNUC__) && (__GNUC__ >= 3) && defined(LIBSMBIOS_C_NO_CTYPE_FUNCTIONS)
47# undef LIBSMBIOS_C_NO_CTYPE_FUNCTIONS
48#endif
49
50
51
52//
53// We can't have a <cwctype> if there is no <cwchar>:
54//
55# if defined(LIBSMBIOS_C_NO_CWCHAR) && !defined(LIBSMBIOS_C_NO_CWCTYPE)
56# define LIBSMBIOS_C_NO_CWCTYPE
57# endif
58
59//
60// We can't have a swprintf if there is no <cwchar>:
61//
62# if defined(LIBSMBIOS_C_NO_CWCHAR) && !defined(LIBSMBIOS_C_NO_SWPRINTF)
63# define LIBSMBIOS_C_NO_SWPRINTF
64# endif
65
66//
67// If Win32 support is turned off, then we must turn off
68// threading support also, unless there is some other
69// thread API enabled:
70//
71#if defined(LIBSMBIOS_C_DISABLE_WIN32) && defined(_WIN32) \
72 && !defined(LIBSMBIOS_C_DISABLE_THREADS) && !defined(LIBSMBIOS_C_HAS_PTHREADS)
73# define LIBSMBIOS_C_DISABLE_THREADS
74#endif
75
76//
77// Turn on threading support if the compiler thinks that it's in
78// multithreaded mode. We put this here because there are only a
79// limited number of macros that identify this (if there's any missing
80// from here then add to the appropriate compiler section):
81//
82#if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \
83 || defined(_PTHREADS)) && !defined(LIBSMBIOS_C_HAS_THREADS)
84# define LIBSMBIOS_C_HAS_THREADS
85#endif
86
87//
88// Turn threading support off if LIBSMBIOS_C_DISABLE_THREADS is defined:
89//
90#if defined(LIBSMBIOS_C_DISABLE_THREADS) && defined(LIBSMBIOS_C_HAS_THREADS)
91# undef LIBSMBIOS_C_HAS_THREADS
92#endif
93
94//
95// Turn threading support off if we don't recognise the threading API:
96//
97#if defined(LIBSMBIOS_C_HAS_THREADS) && !defined(LIBSMBIOS_C_HAS_PTHREADS)\
98 && !defined(LIBSMBIOS_C_HAS_WINTHREADS) && !defined(LIBSMBIOS_C_HAS_BETHREADS)\
99 && !defined(LIBSMBIOS_C_HAS_MPTASKS)
100# undef LIBSMBIOS_C_HAS_THREADS
101#endif
102
103//
104// Turn threading detail macros off if we don't (want to) use threading
105//
106#ifndef LIBSMBIOS_C_HAS_THREADS
107# undef LIBSMBIOS_C_HAS_PTHREADS
108# undef LIBSMBIOS_C_HAS_PTHREAD_MUTEXATTR_SETTYPE
109# undef LIBSMBIOS_C_HAS_WINTHREADS
110# undef LIBSMBIOS_C_HAS_BETHREADS
111# undef LIBSMBIOS_C_HAS_MPTASKS
112#endif
113
114//
115// If the compiler claims to be C99 conformant, then it had better
116// have a <stdint.h>:
117//
118# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
119# define LIBSMBIOS_C_HAS_STDINT_H
120# endif
121
122
123// LIBSMBIOS_C_HAS_ABI_HEADERS
124// This macro gets set if we have headers that fix the ABI,
125// and prevent ODR violations when linking to external libraries:
126#if defined(LIBSMBIOS_C_ABI_PREFIX) && defined(LIBSMBIOS_C_ABI_SUFFIX) && !defined(LIBSMBIOS_C_HAS_ABI_HEADERS)
127# define LIBSMBIOS_C_HAS_ABI_HEADERS
128#endif
129
130#if defined(LIBSMBIOS_C_HAS_ABI_HEADERS) && defined(LIBSMBIOS_C_DISABLE_ABI_HEADERS)
131# undef LIBSMBIOS_C_HAS_ABI_HEADERS
132#endif
133
134
135
136// LIBSMBIOS_C_UNREACHABLE_RETURN(x) workaround -------------------------------------//
137// Normally evaluates to nothing, unless LIBSMBIOS_C_NO_UNREACHABLE_RETURN_DETECTION
138// is defined, in which case it evaluates to return x; Use when you have a return
139// statement that can never be reached.
140
141#ifdef LIBSMBIOS_C_NO_UNREACHABLE_RETURN_DETECTION
142# define LIBSMBIOS_C_UNREACHABLE_RETURN(x) return x;
143#else
144# define LIBSMBIOS_C_UNREACHABLE_RETURN(x)
145#endif
146
147
148// ---------------------------------------------------------------------------//
149
150//
151// Helper macro LIBSMBIOS_C_STRINGIZE:
152// Converts the parameter X to a string after macro replacement
153// on X has been performed.
154//
155#define LIBSMBIOS_C_STRINGIZE(X) LIBSMBIOS_C_DO_STRINGIZE(X)
156#define LIBSMBIOS_C_DO_STRINGIZE(X) #X
157
158//
159// Helper macro LIBSMBIOS_C_JOIN:
160// The following piece of macro magic joins the two
161// arguments together, even when one of the arguments is
162// itself a macro (see 16.3.1 in C++ standard). The key
163// is that macro expansion of macro arguments does not
164// occur in LIBSMBIOS_C_DO_JOIN2 but does in LIBSMBIOS_C_DO_JOIN.
165//
166#define LIBSMBIOS_C_JOIN( X, Y ) LIBSMBIOS_C_DO_JOIN( X, Y )
167#define LIBSMBIOS_C_DO_JOIN( X, Y ) LIBSMBIOS_C_DO_JOIN2(X,Y)
168#define LIBSMBIOS_C_DO_JOIN2( X, Y ) X##Y
169
170//
171// Set some default values for compiler/library/platform names.
172// These are for debugging config setup only:
173//
174# ifndef LIBSMBIOS_C_COMPILER
175# define LIBSMBIOS_C_COMPILER "Unknown ISO C++ Compiler"
176# endif
177# ifndef LIBSMBIOS_C_STDLIB
178# define LIBSMBIOS_C_STDLIB "Unknown ISO standard library"
179# endif
180# ifndef LIBSMBIOS_C_PLATFORM
181# if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \
182 || defined(_POSIX_SOURCE)
183# define LIBSMBIOS_C_PLATFORM "Generic Unix"
184# else
185# define LIBSMBIOS_C_PLATFORM "Unknown"
186# endif
187# endif
188
189#endif
190
191
192