SkPreConfig.h revision 0910916c0f7b951ee55c4b7c6358295b9bca0565
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)
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//////////////////////////////////////////////////////////////////////
51
52#if !defined(SK_RESTRICT)
53    #define SK_RESTRICT __restrict__
54#endif
55
56//////////////////////////////////////////////////////////////////////
57
58#if !defined(SK_SCALAR_IS_FLOAT) && !defined(SK_SCALAR_IS_FIXED)
59    #define SK_SCALAR_IS_FLOAT
60    #define SK_CAN_USE_FLOAT
61#endif
62
63//////////////////////////////////////////////////////////////////////
64
65#if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
66    #if defined (__ppc__) || defined(__ppc64__)
67        #define SK_CPU_BENDIAN
68    #else
69        #define SK_CPU_LENDIAN
70    #endif
71#endif
72
73//////////////////////////////////////////////////////////////////////
74
75#if (defined(__arm__) && !defined(__thumb__)) || defined(SK_BUILD_FOR_BREW) || defined(SK_BUILD_FOR_WINCE) || (defined(SK_BUILD_FOR_SYMBIAN) && !defined(__MARM_THUMB__))
76    /* e.g. the ARM instructions have conditional execution, making tiny branches cheap */
77    #define SK_CPU_HAS_CONDITIONAL_INSTR
78#endif
79
80#endif
81
82