tools/profiler/PlatformMacros.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef SPS_PLATFORM_MACROS_H
michael@0 7 #define SPS_PLATFORM_MACROS_H
michael@0 8
michael@0 9 /* Define platform selection macros in a consistent way. Don't add
michael@0 10 anything else to this file, so it can remain freestanding. The
michael@0 11 primary factorisation is on (ARCH,OS) pairs ("PLATforms") but ARCH_
michael@0 12 and OS_ macros are defined too, since they are sometimes
michael@0 13 convenient. */
michael@0 14
michael@0 15 #undef SPS_PLAT_arm_android
michael@0 16 #undef SPS_PLAT_amd64_linux
michael@0 17 #undef SPS_PLAT_x86_linux
michael@0 18 #undef SPS_PLAT_amd64_darwin
michael@0 19 #undef SPS_PLAT_x86_darwin
michael@0 20 #undef SPS_PLAT_x86_windows
michael@0 21 #undef SPS_PLAT_amd64_windows
michael@0 22
michael@0 23 #undef SPS_ARCH_arm
michael@0 24 #undef SPS_ARCH_x86
michael@0 25 #undef SPS_ARCH_amd64
michael@0 26
michael@0 27 #undef SPS_OS_android
michael@0 28 #undef SPS_OS_linux
michael@0 29 #undef SPS_OS_darwin
michael@0 30 #undef SPS_OS_windows
michael@0 31
michael@0 32 #if defined(__linux__) && defined(__x86_64__)
michael@0 33 # define SPS_PLAT_amd64_linux 1
michael@0 34 # define SPS_ARCH_amd64 1
michael@0 35 # define SPS_OS_linux 1
michael@0 36
michael@0 37 #elif defined(__ANDROID__) && defined(__arm__)
michael@0 38 # define SPS_PLAT_arm_android 1
michael@0 39 # define SPS_ARCH_arm 1
michael@0 40 # define SPS_OS_android 1
michael@0 41
michael@0 42 #elif defined(__ANDROID__) && defined(__i386__)
michael@0 43 # define SPS_PLAT_x86_android 1
michael@0 44 # define SPS_ARCH_x86 1
michael@0 45 # define SPS_OS_android 1
michael@0 46
michael@0 47 #elif defined(__linux__) && defined(__i386__)
michael@0 48 # define SPS_PLAT_x86_linux 1
michael@0 49 # define SPS_ARCH_x86 1
michael@0 50 # define SPS_OS_linux 1
michael@0 51
michael@0 52 #elif defined(__APPLE__) && defined(__x86_64__)
michael@0 53 # define SPS_PLAT_amd64_darwin 1
michael@0 54 # define SPS_ARCH_amd64 1
michael@0 55 # define SPS_OS_darwin 1
michael@0 56
michael@0 57 #elif defined(__APPLE__) && defined(__i386__)
michael@0 58 # define SPS_PLAT_x86_darwin 1
michael@0 59 # define SPS_ARCH_x86 1
michael@0 60 # define SPS_OS_darwin 1
michael@0 61
michael@0 62 #elif (defined(_MSC_VER) || defined(__MINGW32__)) && (defined(_M_IX86) || defined(__i386__))
michael@0 63 # define SPS_PLAT_x86_windows 1
michael@0 64 # define SPS_ARCH_x86 1
michael@0 65 # define SPS_OS_windows 1
michael@0 66
michael@0 67 #elif (defined(_MSC_VER) || defined(__MINGW32__)) && (defined(_M_X64) || defined(__x86_64__))
michael@0 68 # define SPS_PLAT_amd64_windows 1
michael@0 69 # define SPS_ARCH_amd64 1
michael@0 70 # define SPS_OS_windows 1
michael@0 71
michael@0 72 #else
michael@0 73 # error "Unsupported platform"
michael@0 74 #endif
michael@0 75
michael@0 76 #endif /* ndef SPS_PLATFORM_MACROS_H */

mercurial