tools/profiler/LulPlatformMacros.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef LulPlatformMacros_h
     8 #define LulPlatformMacros_h
    10 #include <stdint.h>
    11 #include <stdlib.h>
    13 // Define platform selection macros in a consistent way.  The primary
    14 // factorisation is on (ARCH,OS) pairs ("PLATforms") but ARCH_ and OS_
    15 // macros are defined too, since they are sometimes convenient.
    17 #undef LUL_PLAT_x64_linux
    18 #undef LUL_PLAT_x86_linux
    19 #undef LUL_PLAT_arm_android
    20 #undef LUL_PLAT_x86_android
    22 #undef LUL_ARCH_arm
    23 #undef LUL_ARCH_x86
    24 #undef LUL_ARCH_x64
    26 #undef LUL_OS_android
    27 #undef LUL_OS_linux
    29 #if defined(__linux__) && defined(__x86_64__)
    30 # define LUL_PLAT_x64_linux 1
    31 # define LUL_ARCH_x64 1
    32 # define LUL_OS_linux 1
    34 #elif defined(__linux__) && defined(__i386__) && !defined(__ANDROID__)
    35 # define LUL_PLAT_x86_linux 1
    36 # define LUL_ARCH_x86 1
    37 # define LUL_OS_linux 1
    39 #elif defined(__ANDROID__) && defined(__arm__)
    40 # define LUL_PLAT_arm_android 1
    41 # define LUL_ARCH_arm 1
    42 # define LUL_OS_android 1
    44 #elif defined(__ANDROID__) && defined(__i386__)
    45 # define LUL_PLAT_x86_android 1
    46 # define LUL_ARCH_x86 1
    47 # define LUL_OS_android 1
    49 #else
    50 # error "Unsupported platform"
    51 #endif
    53 #endif // LulPlatformMacros_h

mercurial