/usr/include/CppUTest/CppUTestConfig.h is in libcpputest-dev 3.8-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | /*
* Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE EARLIER MENTIONED AUTHORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CPPUTESTCONFIG_H_
#define CPPUTESTCONFIG_H_
#ifndef CPPUTEST_USE_OWN_CONFIGURATION
#include "CppUTestGeneratedConfig.h"
#endif
/*
* This file is added for some specific CppUTest configurations that earlier were spread out into multiple files.
*
* The goal of this file is to stay really small and not to include other things, but mainly to remove duplication
* from other files and resolve dependencies in #includes.
*
*/
#ifdef __clang__
#pragma clang diagnostic push
#if __clang_major__ >= 3 && __clang_minor__ >= 6
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#endif
/*
* Lib C dependencies that are currently still left:
*
* stdarg.h -> We use formatting functions and va_list requires to include stdarg.h in SimpleString
* stdlib.h -> The TestHarness_c.h includes this to try to avoid conflicts in its malloc #define. This dependency can
* easily be removed by not enabling the MALLOC overrides.
*
* Lib C++ dependencies are all under the CPPUTEST_USE_STD_CPP_LIB.
* The only dependency is to <new> which has the bad_alloc struct
*
*/
/* Do we use Standard C or not? When doing Kernel development, standard C usage is out. */
#ifndef CPPUTEST_USE_STD_C_LIB
#ifdef CPPUTEST_STD_C_LIB_DISABLED
#define CPPUTEST_USE_STD_C_LIB 0
#else
#define CPPUTEST_USE_STD_C_LIB 1
#endif
#endif
/* Do we use Standard C++ or not? */
#ifndef CPPUTEST_USE_STD_CPP_LIB
#ifdef CPPUTEST_STD_CPP_LIB_DISABLED
#define CPPUTEST_USE_STD_CPP_LIB 0
#else
#define CPPUTEST_USE_STD_CPP_LIB 1
#endif
#endif
/* Is memory leak detection enabled?
* Controls the override of the global operator new/deleted and malloc/free.
* Without this, there will be no memory leak detection in C/C++.
*/
#ifndef CPPUTEST_USE_MEM_LEAK_DETECTION
#ifdef CPPUTEST_MEM_LEAK_DETECTION_DISABLED
#define CPPUTEST_USE_MEM_LEAK_DETECTION 0
#else
#define CPPUTEST_USE_MEM_LEAK_DETECTION 1
#endif
#endif
/* Should be the only #include here. Standard C library wrappers */
#include "StandardCLibrary.h"
/* Create a __no_return__ macro, which is used to flag a function as not returning.
* Used for functions that always throws for instance.
*
* This is needed for compiling with clang, without breaking other compilers.
*/
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#if __has_attribute(noreturn)
#define __no_return__ __attribute__((noreturn))
#else
#define __no_return__
#endif
#if __has_attribute(format)
#define __check_format__(type, format_parameter, other_parameters) __attribute__ ((format (type, format_parameter, other_parameters)))
#else
#define __check_format__(type, format_parameter, other_parameters) /* type, format_parameter, other_parameters */
#endif
/*
* When we don't link Standard C++, then we won't throw exceptions as we assume the compiler might not support that!
*/
#if CPPUTEST_USE_STD_CPP_LIB
#if defined(__cplusplus) && __cplusplus >= 201103L
#define UT_THROW(exception)
#define UT_NOTHROW noexcept
#else
#define UT_THROW(exception) throw (exception)
#define UT_NOTHROW throw()
#endif
#else
#define UT_THROW(exception)
#ifdef __clang__
#define UT_NOTHROW throw()
#else
#define UT_NOTHROW
#endif
#endif
/*
* Visual C++ doesn't define __cplusplus as C++11 yet (201103), however it doesn't want the throw(exception) either, but
* it does want throw().
*/
#ifdef _MSC_VER
#undef UT_THROW
#define UT_THROW(exception)
#endif
#if defined(__cplusplus) && __cplusplus >= 201103L
#define DEFAULT_COPY_CONSTRUCTOR(classname) classname(const classname &) = default;
#else
#define DEFAULT_COPY_CONSTRUCTOR(classname)
#endif
/*
* g++-4.7 with stdc++11 enabled On MacOSX! will have a different exception specifier for operator new (and thank you!)
* I assume they'll fix this in the future, but for now, we'll change that here.
* (This should perhaps also be done in the configure.ac)
*/
#ifdef __GXX_EXPERIMENTAL_CXX0X__
#ifdef __APPLE__
#ifdef _GLIBCXX_THROW
#undef UT_THROW
#define UT_THROW(exception) _GLIBCXX_THROW(exception)
#endif
#endif
#endif
/*
* Handling of IEEE754 floating point exceptions via fenv.h
* Works on non-Visual C++ compilers and Visual C++ 2008 and newer
*/
#if CPPUTEST_USE_STD_C_LIB && (!defined(_MSC_VER) || (_MSC_VER >= 1800))
#define CPPUTEST_HAVE_FENV
#if defined(__WATCOMC__) || defined(__ARMEL__) || defined(__m68k__)
#define CPPUTEST_FENV_IS_WORKING_PROPERLY 0
#else
#define CPPUTEST_FENV_IS_WORKING_PROPERLY 1
#endif
#endif
/*
* Detection of different 64 bit environments
*/
#if defined(__LP64__) || defined(_LP64) || (defined(__WORDSIZE) && (__WORDSIZE == 64 )) || defined(__x86_64) || defined(_WIN64)
#define CPPUTEST_64BIT
#if defined(_WIN64)
#define CPPUTEST_64BIT_32BIT_LONGS
#endif
#endif
/* Handling of systems with a different byte-width (e.g. 16 bit).
* Since CHAR_BIT is defined in limits.h (ANSI C), use default of 8 when building without Std C library.
*/
#if CPPUTEST_USE_STD_C_LIB
#define CPPUTEST_CHAR_BIT CHAR_BIT
#else
#define CPPUTEST_CHAR_BIT 8
#endif
/*
* Support for "long long" type.
*
* Not supported when CPUTEST_LONG_LONG_DISABLED is set.
* Can be overridden by using CPPUTEST_USE_LONG_LONG
*
* CPPUTEST_HAVE_LONG_LONG_INT is set by configure
* LLONG_MAX is set in limits.h. This is a crude attempt to detect long long support when no configure is used
*
*/
#if !defined(CPPUTEST_LONG_LONG_DISABLED) && !defined(CPPUTEST_USE_LONG_LONG)
#if defined(CPPUTEST_HAVE_LONG_LONG_INT) || defined(LLONG_MAX)
#define CPPUTEST_USE_LONG_LONG 1
#endif
#endif
#ifdef CPPUTEST_USE_LONG_LONG
typedef long long cpputest_longlong;
typedef unsigned long long cpputest_ulonglong;
#else
/* Define some placeholders to disable the overloaded methods.
* It's not required to have these match the size of the "real" type, but it's occasionally convenient.
*/
#if defined(CPPUTEST_64BIT) && !defined(CPPUTEST_64BIT_32BIT_LONGS)
#define CPPUTEST_SIZE_OF_FAKE_LONG_LONG_TYPE 16
#else
#define CPPUTEST_SIZE_OF_FAKE_LONG_LONG_TYPE 8
#endif
struct cpputest_longlong
{
#if defined(__cplusplus)
cpputest_longlong() {}
cpputest_longlong(int) {}
#endif
char dummy[CPPUTEST_SIZE_OF_FAKE_LONG_LONG_TYPE];
};
struct cpputest_ulonglong
{
#if defined(__cplusplus)
cpputest_ulonglong() {}
cpputest_ulonglong(int) {}
#endif
char dummy[CPPUTEST_SIZE_OF_FAKE_LONG_LONG_TYPE];
};
#endif
/* Visual C++ 10.0+ (2010+) supports the override keyword, but doesn't define the C++ version as C++11 */
#if defined(__cplusplus) && ((__cplusplus >= 201103L) || (defined(_MSC_VER) && (_MSC_VER >= 1600)))
#define CPPUTEST_COMPILER_FULLY_SUPPORTS_CXX11
#define _override override
#else
#define _override
#endif
/* MinGW-w64 prefers to act like Visual C++, but we want the ANSI behaviors instead */
#undef __USE_MINGW_ANSI_STDIO
#define __USE_MINGW_ANSI_STDIO 1
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif
|