1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tools/profiler/LulPlatformMacros.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef LulPlatformMacros_h 1.11 +#define LulPlatformMacros_h 1.12 + 1.13 +#include <stdint.h> 1.14 +#include <stdlib.h> 1.15 + 1.16 +// Define platform selection macros in a consistent way. The primary 1.17 +// factorisation is on (ARCH,OS) pairs ("PLATforms") but ARCH_ and OS_ 1.18 +// macros are defined too, since they are sometimes convenient. 1.19 + 1.20 +#undef LUL_PLAT_x64_linux 1.21 +#undef LUL_PLAT_x86_linux 1.22 +#undef LUL_PLAT_arm_android 1.23 +#undef LUL_PLAT_x86_android 1.24 + 1.25 +#undef LUL_ARCH_arm 1.26 +#undef LUL_ARCH_x86 1.27 +#undef LUL_ARCH_x64 1.28 + 1.29 +#undef LUL_OS_android 1.30 +#undef LUL_OS_linux 1.31 + 1.32 +#if defined(__linux__) && defined(__x86_64__) 1.33 +# define LUL_PLAT_x64_linux 1 1.34 +# define LUL_ARCH_x64 1 1.35 +# define LUL_OS_linux 1 1.36 + 1.37 +#elif defined(__linux__) && defined(__i386__) && !defined(__ANDROID__) 1.38 +# define LUL_PLAT_x86_linux 1 1.39 +# define LUL_ARCH_x86 1 1.40 +# define LUL_OS_linux 1 1.41 + 1.42 +#elif defined(__ANDROID__) && defined(__arm__) 1.43 +# define LUL_PLAT_arm_android 1 1.44 +# define LUL_ARCH_arm 1 1.45 +# define LUL_OS_android 1 1.46 + 1.47 +#elif defined(__ANDROID__) && defined(__i386__) 1.48 +# define LUL_PLAT_x86_android 1 1.49 +# define LUL_ARCH_x86 1 1.50 +# define LUL_OS_android 1 1.51 + 1.52 +#else 1.53 +# error "Unsupported platform" 1.54 +#endif 1.55 + 1.56 +#endif // LulPlatformMacros_h