SkPreConfig.h revision 87a2a317c4e99c547ecbfa81f40f7bd7f2932433
1/* 2 * Copyright (C) 2006 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef SkPreConfig_DEFINED 18#define SkPreConfig_DEFINED 19 20////////////////////////////////////////////////////////////////////// 21 22#if !defined(SK_BUILD_FOR_PALM) && !defined(SK_BUILD_FOR_WINCE) && !defined(SK_BUILD_FOR_WIN32) && !defined(SK_BUILD_FOR_SYMBIAN) && !defined(SK_BUILD_FOR_UNIX) && !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_SDL) 23 24 #if defined(PALMOS_SDK_VERSION) 25 #define SK_BUILD_FOR_PALM 26 #elif defined(UNDER_CE) 27 #define SK_BUILD_FOR_WINCE 28 #elif defined(WIN32) 29 #define SK_BUILD_FOR_WIN32 30 #elif defined(__SYMBIAN32__) 31 #define SK_BUILD_FOR_WIN32 32 #elif defined(linux) 33 #define SK_BUILD_FOR_UNIX 34 #else 35 #define SK_BUILD_FOR_MAC 36 #endif 37 38#endif 39 40////////////////////////////////////////////////////////////////////// 41 42#if !defined(SK_DEBUG) && !defined(SK_RELEASE) 43 #ifdef NDEBUG 44 #define SK_RELEASE 45 #else 46 #define SK_DEBUG 47 #endif 48#endif 49 50#ifdef SK_BUILD_FOR_WIN32 51 #define SK_RESTRICT 52 #include "sk_stdint.h" 53#endif 54 55////////////////////////////////////////////////////////////////////// 56 57#if !defined(SK_RESTRICT) 58 #define SK_RESTRICT __restrict__ 59#endif 60 61////////////////////////////////////////////////////////////////////// 62 63#if !defined(SK_SCALAR_IS_FLOAT) && !defined(SK_SCALAR_IS_FIXED) 64 #define SK_SCALAR_IS_FLOAT 65 #define SK_CAN_USE_FLOAT 66#endif 67 68////////////////////////////////////////////////////////////////////// 69 70#if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN) 71 #if defined (__ppc__) || defined(__ppc64__) 72 #define SK_CPU_BENDIAN 73 #else 74 #define SK_CPU_LENDIAN 75 #endif 76#endif 77 78////////////////////////////////////////////////////////////////////// 79 80#if (defined(__arm__) && !defined(__thumb__)) || defined(SK_BUILD_FOR_WINCE) || (defined(SK_BUILD_FOR_SYMBIAN) && !defined(__MARM_THUMB__)) 81 /* e.g. the ARM instructions have conditional execution, making tiny branches cheap */ 82 #define SK_CPU_HAS_CONDITIONAL_INSTR 83#endif 84 85#endif 86 87