~ubuntu-branches/ubuntu/lucid/protobuf/lucid

« back to all changes in this revision

Viewing changes to src/gtest/internal/gtest-port.h

  • Committer: Bazaar Package Importer
  • Author(s): Manny Vindiola
  • Date: 2008-12-18 01:26:29 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081218012629-l93kqt3jptydn9zh
Tags: 2.0.3-0ubuntu1
* Merge from new upstream version (LP: #309237), remaining changes:
   * debian/control Moving python-support from Build-Depends-Indep
     to Build-Depends to fix build failures.  
* Fix FTBFS on ia64 architecture due to lack of clone(2)
   - src/gtest/internal/gtest-port.h (LP: #308829)
     disable death tests if architecture is IA64
     adapted from gtest upstream fix at:
     http://codereview.appspot.com/8690/show
* Fix FTBFS on x64 architectures due to python 2.x int vs long issue
  test expects return type long but on x64 architecture return type 
  unpacks to int
   -python/google/protobuf/internal/decoder_test.py
    explicitly type the result value as long 
   taken from upstream discussion:
   http://groups.google.com/group/protobuf/browse_thread
       /thread/2357176cb1f50e10/

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
// The user can define the following macros in the build script to
45
45
// control Google Test's behavior:
46
46
//
 
47
//   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
 
48
//                              is/isn't available.
47
49
//   GTEST_HAS_STD_STRING    - Define it to 1/0 to indicate that
48
50
//                             std::string does/doesn't work (Google Test can be
49
51
//                             used where std::string is unavailable).  Leave
187
189
#include <strstream>  // NOLINT
188
190
#endif  // GTEST_HAS_STD_STRING
189
191
 
 
192
// Determines whether clone(2) is supported.
 
193
// Usually it will only be available on Linux, excluding
 
194
// Linux on the Itanium architecture.
 
195
// Also see http://linux.die.net/man/2/clone.
 
196
#ifndef GTEST_HAS_CLONE
 
197
// The user didn't tell us, so we need to figure it out.
 
198
 
 
199
#if defined(GTEST_OS_LINUX) && !defined(__ia64__)
 
200
#define GTEST_HAS_CLONE 1
 
201
#else
 
202
#define GTEST_HAS_CLONE 0
 
203
#endif  // defined(GTEST_OS_LINUX) && !defined(__ia64__)
 
204
 
 
205
#endif  // GTEST_HAS_CLONE
 
206
 
190
207
// Determines whether to support death tests.
191
 
#if GTEST_HAS_STD_STRING && defined(GTEST_OS_LINUX)
 
208
#if GTEST_HAS_STD_STRING && GTEST_HAS_CLONE
192
209
#define GTEST_HAS_DEATH_TEST
193
210
// On some platforms, <regex.h> needs someone to define size_t, and
194
211
// won't compile if being #included first.  Therefore it's important
197
214
#include <vector>
198
215
#include <fcntl.h>
199
216
#include <sys/mman.h>
200
 
#endif  // GTEST_HAS_STD_STRING && defined(GTEST_OS_LINUX)
 
217
#endif  // GTEST_HAS_STD_STRING && GTEST_HAS_CLONE
201
218
 
202
219
// Defines some utility macros.
203
220
 
223
240
//   struct Foo {
224
241
//     Foo() { ... }
225
242
//   } GTEST_ATTRIBUTE_UNUSED;
226
 
#if defined(GTEST_OS_WINDOWS) || (defined(GTEST_OS_LINUX) && defined(SWIG))
 
243
#ifdef __GNUC__
 
244
#define GTEST_ATTRIBUTE_UNUSED __attribute__ ((unused))
 
245
#else
227
246
#define GTEST_ATTRIBUTE_UNUSED
228
 
#else
229
 
#define GTEST_ATTRIBUTE_UNUSED __attribute__ ((unused))
230
247
#endif  // GTEST_OS_WINDOWS || (GTEST_OS_LINUX && SWIG)
231
248
 
232
249
// A macro to disallow the evil copy constructor and operator= functions
438
455
 
439
456
// Defines tr1::is_pointer (only needed for Symbian).
440
457
 
441
 
#ifdef __SYMBIAN32__
 
458
#if defined(__SYMBIAN32__) || (defined (__DECCXX) && defined(__osf__))
442
459
 
443
 
// Symbian does not have tr1::type_traits, so we define our own is_pointer
444
 
// These are needed as the Nokia Symbian Compiler cannot decide between
445
 
// const T& and const T* in a function template.
 
460
// Symbian and HP C++ on Tru64 do not have tr1::type_traits, so we define
 
461
// our own is_pointer.  These are needed as these compilers cannot decide
 
462
// between const T& and const T* in a function template.
446
463
 
447
464
template <bool bool_value>
448
465
struct bool_constant {