security/sandbox/build/build_config.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/sandbox/build/build_config.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,154 @@
     1.4 +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
     1.5 +// Use of this source code is governed by a BSD-style license that can be
     1.6 +// found in the LICENSE file.
     1.7 +
     1.8 +// This file adds defines about the platform we're currently building on.
     1.9 +//  Operating System:
    1.10 +//    OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX)
    1.11 +//  Compiler:
    1.12 +//    COMPILER_MSVC / COMPILER_GCC
    1.13 +//  Processor:
    1.14 +//    ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64)
    1.15 +//    ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
    1.16 +
    1.17 +#ifndef BUILD_BUILD_CONFIG_H_
    1.18 +#define BUILD_BUILD_CONFIG_H_
    1.19 +
    1.20 +#if defined(__APPLE__)
    1.21 +#include <TargetConditionals.h>
    1.22 +#endif
    1.23 +
    1.24 +// A set of macros to use for platform detection.
    1.25 +#if defined(ANDROID)
    1.26 +#define OS_ANDROID 1
    1.27 +#elif defined(__APPLE__)
    1.28 +#define OS_MACOSX 1
    1.29 +#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
    1.30 +#define OS_IOS 1
    1.31 +#endif  // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
    1.32 +#elif defined(__native_client__)
    1.33 +#define OS_NACL 1
    1.34 +#elif defined(__linux__)
    1.35 +#define OS_LINUX 1
    1.36 +// Use TOOLKIT_GTK on linux if TOOLKIT_VIEWS isn't defined.
    1.37 +#if !defined(TOOLKIT_VIEWS) && defined(USE_X11)
    1.38 +#define TOOLKIT_GTK
    1.39 +#endif
    1.40 +#if defined(__GLIBC__) && !defined(__UCLIBC__)
    1.41 +// we really are using glibc, not uClibc pretending to be glibc
    1.42 +#define LIBC_GLIBC
    1.43 +#endif
    1.44 +#elif defined(_WIN32)
    1.45 +#define OS_WIN 1
    1.46 +#define TOOLKIT_VIEWS 1
    1.47 +#elif defined(__FreeBSD__)
    1.48 +#define OS_FREEBSD 1
    1.49 +#define TOOLKIT_GTK
    1.50 +#elif defined(__OpenBSD__)
    1.51 +#define OS_OPENBSD 1
    1.52 +#define TOOLKIT_GTK
    1.53 +#elif defined(__sun)
    1.54 +#define OS_SOLARIS 1
    1.55 +#define TOOLKIT_GTK
    1.56 +#else
    1.57 +#error Please add support for your platform in build/build_config.h
    1.58 +#endif
    1.59 +
    1.60 +#if defined(USE_OPENSSL) && defined(USE_NSS)
    1.61 +#error Cannot use both OpenSSL and NSS
    1.62 +#endif
    1.63 +
    1.64 +// For access to standard BSD features, use OS_BSD instead of a
    1.65 +// more specific macro.
    1.66 +#if defined(OS_FREEBSD) || defined(OS_OPENBSD)
    1.67 +#define OS_BSD 1
    1.68 +#endif
    1.69 +
    1.70 +// For access to standard POSIXish features, use OS_POSIX instead of a
    1.71 +// more specific macro.
    1.72 +#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) ||     \
    1.73 +    defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) ||  \
    1.74 +    defined(OS_NACL)
    1.75 +#define OS_POSIX 1
    1.76 +#endif
    1.77 +
    1.78 +// Use tcmalloc
    1.79 +#if (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)) && \
    1.80 +    !defined(NO_TCMALLOC)
    1.81 +#define USE_TCMALLOC 1
    1.82 +#endif
    1.83 +
    1.84 +// Compiler detection.
    1.85 +#if defined(__GNUC__)
    1.86 +#define COMPILER_GCC 1
    1.87 +#elif defined(_MSC_VER)
    1.88 +#define COMPILER_MSVC 1
    1.89 +#else
    1.90 +#error Please add support for your compiler in build/build_config.h
    1.91 +#endif
    1.92 +
    1.93 +// Processor architecture detection.  For more info on what's defined, see:
    1.94 +//   http://msdn.microsoft.com/en-us/library/b0084kay.aspx
    1.95 +//   http://www.agner.org/optimize/calling_conventions.pdf
    1.96 +//   or with gcc, run: "echo | gcc -E -dM -"
    1.97 +#if defined(_M_X64) || defined(__x86_64__)
    1.98 +#define ARCH_CPU_X86_FAMILY 1
    1.99 +#define ARCH_CPU_X86_64 1
   1.100 +#define ARCH_CPU_64_BITS 1
   1.101 +#define ARCH_CPU_LITTLE_ENDIAN 1
   1.102 +#elif defined(_M_IX86) || defined(__i386__)
   1.103 +#define ARCH_CPU_X86_FAMILY 1
   1.104 +#define ARCH_CPU_X86 1
   1.105 +#define ARCH_CPU_32_BITS 1
   1.106 +#define ARCH_CPU_LITTLE_ENDIAN 1
   1.107 +#elif defined(__ARMEL__)
   1.108 +#define ARCH_CPU_ARM_FAMILY 1
   1.109 +#define ARCH_CPU_ARMEL 1
   1.110 +#define ARCH_CPU_32_BITS 1
   1.111 +#define ARCH_CPU_LITTLE_ENDIAN 1
   1.112 +#elif defined(__pnacl__)
   1.113 +#define ARCH_CPU_32_BITS 1
   1.114 +#elif defined(__MIPSEL__)
   1.115 +#define ARCH_CPU_MIPS_FAMILY 1
   1.116 +#define ARCH_CPU_MIPSEL 1
   1.117 +#define ARCH_CPU_32_BITS 1
   1.118 +#define ARCH_CPU_LITTLE_ENDIAN 1
   1.119 +#else
   1.120 +#error Please add support for your architecture in build/build_config.h
   1.121 +#endif
   1.122 +
   1.123 +// Type detection for wchar_t.
   1.124 +#if defined(OS_WIN)
   1.125 +#define WCHAR_T_IS_UTF16
   1.126 +#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
   1.127 +    defined(__WCHAR_MAX__) && \
   1.128 +    (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
   1.129 +#define WCHAR_T_IS_UTF32
   1.130 +#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
   1.131 +    defined(__WCHAR_MAX__) && \
   1.132 +    (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
   1.133 +// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
   1.134 +// compile in this mode (in particular, Chrome doesn't). This is intended for
   1.135 +// other projects using base who manage their own dependencies and make sure
   1.136 +// short wchar works for them.
   1.137 +#define WCHAR_T_IS_UTF16
   1.138 +#else
   1.139 +#error Please add support for your compiler in build/build_config.h
   1.140 +#endif
   1.141 +
   1.142 +#if defined(__ARMEL__) && !defined(OS_IOS)
   1.143 +#define WCHAR_T_IS_UNSIGNED 1
   1.144 +#elif defined(__MIPSEL__)
   1.145 +#define WCHAR_T_IS_UNSIGNED 0
   1.146 +#endif
   1.147 +
   1.148 +#if defined(OS_ANDROID)
   1.149 +// The compiler thinks std::string::const_iterator and "const char*" are
   1.150 +// equivalent types.
   1.151 +#define STD_STRING_ITERATOR_IS_CHAR_POINTER
   1.152 +// The compiler thinks base::string16::const_iterator and "char16*" are
   1.153 +// equivalent types.
   1.154 +#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
   1.155 +#endif
   1.156 +
   1.157 +#endif  // BUILD_BUILD_CONFIG_H_

mercurial