tools/profiler/PlatformMacros.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/profiler/PlatformMacros.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,76 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef SPS_PLATFORM_MACROS_H
    1.10 +#define SPS_PLATFORM_MACROS_H
    1.11 +
    1.12 +/* Define platform selection macros in a consistent way.  Don't add
    1.13 +   anything else to this file, so it can remain freestanding.  The
    1.14 +   primary factorisation is on (ARCH,OS) pairs ("PLATforms") but ARCH_
    1.15 +   and OS_ macros are defined too, since they are sometimes
    1.16 +   convenient. */
    1.17 +
    1.18 +#undef SPS_PLAT_arm_android
    1.19 +#undef SPS_PLAT_amd64_linux
    1.20 +#undef SPS_PLAT_x86_linux
    1.21 +#undef SPS_PLAT_amd64_darwin
    1.22 +#undef SPS_PLAT_x86_darwin
    1.23 +#undef SPS_PLAT_x86_windows
    1.24 +#undef SPS_PLAT_amd64_windows
    1.25 +
    1.26 +#undef SPS_ARCH_arm
    1.27 +#undef SPS_ARCH_x86
    1.28 +#undef SPS_ARCH_amd64
    1.29 +
    1.30 +#undef SPS_OS_android
    1.31 +#undef SPS_OS_linux
    1.32 +#undef SPS_OS_darwin
    1.33 +#undef SPS_OS_windows
    1.34 +
    1.35 +#if defined(__linux__) && defined(__x86_64__)
    1.36 +#  define SPS_PLAT_amd64_linux 1
    1.37 +#  define SPS_ARCH_amd64 1
    1.38 +#  define SPS_OS_linux 1
    1.39 +
    1.40 +#elif defined(__ANDROID__) && defined(__arm__)
    1.41 +#  define SPS_PLAT_arm_android 1
    1.42 +#  define SPS_ARCH_arm 1
    1.43 +#  define SPS_OS_android 1
    1.44 +
    1.45 +#elif defined(__ANDROID__) && defined(__i386__)
    1.46 +#  define SPS_PLAT_x86_android 1
    1.47 +#  define SPS_ARCH_x86 1
    1.48 +#  define SPS_OS_android 1
    1.49 +
    1.50 +#elif defined(__linux__) && defined(__i386__)
    1.51 +#  define SPS_PLAT_x86_linux 1
    1.52 +#  define SPS_ARCH_x86 1
    1.53 +#  define SPS_OS_linux 1
    1.54 +
    1.55 +#elif defined(__APPLE__) && defined(__x86_64__)
    1.56 +#  define SPS_PLAT_amd64_darwin 1
    1.57 +#  define SPS_ARCH_amd64 1
    1.58 +#  define SPS_OS_darwin 1
    1.59 +
    1.60 +#elif defined(__APPLE__) && defined(__i386__)
    1.61 +#  define SPS_PLAT_x86_darwin 1
    1.62 +#  define SPS_ARCH_x86 1
    1.63 +#  define SPS_OS_darwin 1
    1.64 +
    1.65 +#elif (defined(_MSC_VER) || defined(__MINGW32__)) && (defined(_M_IX86) || defined(__i386__))
    1.66 +#  define SPS_PLAT_x86_windows 1
    1.67 +#  define SPS_ARCH_x86 1
    1.68 +#  define SPS_OS_windows 1
    1.69 +
    1.70 +#elif (defined(_MSC_VER) || defined(__MINGW32__)) && (defined(_M_X64) || defined(__x86_64__))
    1.71 +#  define SPS_PLAT_amd64_windows 1
    1.72 +#  define SPS_ARCH_amd64 1
    1.73 +#  define SPS_OS_windows 1
    1.74 +
    1.75 +#else
    1.76 +#  error "Unsupported platform"
    1.77 +#endif
    1.78 +
    1.79 +#endif /* ndef SPS_PLATFORM_MACROS_H */

mercurial