michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef LulPlatformMacros_h michael@0: #define LulPlatformMacros_h michael@0: michael@0: #include michael@0: #include michael@0: michael@0: // Define platform selection macros in a consistent way. The primary michael@0: // factorisation is on (ARCH,OS) pairs ("PLATforms") but ARCH_ and OS_ michael@0: // macros are defined too, since they are sometimes convenient. michael@0: michael@0: #undef LUL_PLAT_x64_linux michael@0: #undef LUL_PLAT_x86_linux michael@0: #undef LUL_PLAT_arm_android michael@0: #undef LUL_PLAT_x86_android michael@0: michael@0: #undef LUL_ARCH_arm michael@0: #undef LUL_ARCH_x86 michael@0: #undef LUL_ARCH_x64 michael@0: michael@0: #undef LUL_OS_android michael@0: #undef LUL_OS_linux michael@0: michael@0: #if defined(__linux__) && defined(__x86_64__) michael@0: # define LUL_PLAT_x64_linux 1 michael@0: # define LUL_ARCH_x64 1 michael@0: # define LUL_OS_linux 1 michael@0: michael@0: #elif defined(__linux__) && defined(__i386__) && !defined(__ANDROID__) michael@0: # define LUL_PLAT_x86_linux 1 michael@0: # define LUL_ARCH_x86 1 michael@0: # define LUL_OS_linux 1 michael@0: michael@0: #elif defined(__ANDROID__) && defined(__arm__) michael@0: # define LUL_PLAT_arm_android 1 michael@0: # define LUL_ARCH_arm 1 michael@0: # define LUL_OS_android 1 michael@0: michael@0: #elif defined(__ANDROID__) && defined(__i386__) michael@0: # define LUL_PLAT_x86_android 1 michael@0: # define LUL_ARCH_x86 1 michael@0: # define LUL_OS_android 1 michael@0: michael@0: #else michael@0: # error "Unsupported platform" michael@0: #endif michael@0: michael@0: #endif // LulPlatformMacros_h