Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-09 08:19:03

0001 // Copyright 2008, Google Inc.
0002 // All rights reserved.
0003 //
0004 // Redistribution and use in source and binary forms, with or without
0005 // modification, are permitted provided that the following conditions are
0006 // met:
0007 //
0008 //     * Redistributions of source code must retain the above copyright
0009 // notice, this list of conditions and the following disclaimer.
0010 //     * Redistributions in binary form must reproduce the above
0011 // copyright notice, this list of conditions and the following disclaimer
0012 // in the documentation and/or other materials provided with the
0013 // distribution.
0014 //     * Neither the name of Google Inc. nor the names of its
0015 // contributors may be used to endorse or promote products derived from
0016 // this software without specific prior written permission.
0017 //
0018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0019 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0020 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0021 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0022 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0023 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0024 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0025 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0026 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0027 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0028 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0029 //
0030 // Author: vadimb@google.com (Vadim Berman)
0031 //
0032 // Low-level types and utilities for porting Google Mock to various
0033 // platforms.  All macros ending with _ and symbols defined in an
0034 // internal namespace are subject to change without notice.  Code
0035 // outside Google Mock MUST NOT USE THEM DIRECTLY.  Macros that don't
0036 // end with _ are part of Google Mock's public API and can be used by
0037 // code outside Google Mock.
0038 
0039 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
0040 #define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
0041 
0042 #include <assert.h>
0043 #include <stdlib.h>
0044 #include <iostream>
0045 
0046 // Most of the utilities needed for porting Google Mock are also
0047 // required for Google Test and are defined in gtest-port.h.
0048 //
0049 // Note to maintainers: to reduce code duplication, prefer adding
0050 // portability utilities to Google Test's gtest-port.h instead of
0051 // here, as Google Mock depends on Google Test.  Only add a utility
0052 // here if it's truly specific to Google Mock.
0053 #include "gtest/internal/gtest-linked_ptr.h"
0054 #include "gtest/internal/gtest-port.h"
0055 #include "gmock/internal/custom/gmock-port.h"
0056 
0057 // To avoid conditional compilation everywhere, we make it
0058 // gmock-port.h's responsibility to #include the header implementing
0059 // tr1/tuple.  gmock-port.h does this via gtest-port.h, which is
0060 // guaranteed to pull in the tuple header.
0061 
0062 // For MS Visual C++, check the compiler version. At least VS 2003 is
0063 // required to compile Google Mock.
0064 #if defined(_MSC_VER) && _MSC_VER < 1310
0065 # error "At least Visual C++ 2003 (7.1) is required to compile Google Mock."
0066 #endif
0067 
0068 // Macro for referencing flags.  This is public as we want the user to
0069 // use this syntax to reference Google Mock flags.
0070 #define GMOCK_FLAG(name) FLAGS_gmock_##name
0071 
0072 #if !defined(GMOCK_DECLARE_bool_)
0073 
0074 // Macros for declaring flags.
0075 #define GMOCK_DECLARE_bool_(name) extern GTEST_API_ bool GMOCK_FLAG(name)
0076 #define GMOCK_DECLARE_int32_(name) \
0077     extern GTEST_API_ ::testing::internal::Int32 GMOCK_FLAG(name)
0078 #define GMOCK_DECLARE_string_(name) \
0079     extern GTEST_API_ ::std::string GMOCK_FLAG(name)
0080 
0081 // Macros for defining flags.
0082 #define GMOCK_DEFINE_bool_(name, default_val, doc) \
0083     GTEST_API_ bool GMOCK_FLAG(name) = (default_val)
0084 #define GMOCK_DEFINE_int32_(name, default_val, doc) \
0085     GTEST_API_ ::testing::internal::Int32 GMOCK_FLAG(name) = (default_val)
0086 #define GMOCK_DEFINE_string_(name, default_val, doc) \
0087     GTEST_API_ ::std::string GMOCK_FLAG(name) = (default_val)
0088 
0089 #endif  // !defined(GMOCK_DECLARE_bool_)
0090 
0091 #endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_