SkPreConfig.h revision b08eb2b3bce45411494fe00258e4c91248ccd15e
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#ifdef ANDROID
21    #define SK_BUILD_FOR_UNIX
22    #define SkLONGLONG  int64_t
23#endif
24
25//////////////////////////////////////////////////////////////////////
26
27#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)
28
29    #if defined(PALMOS_SDK_VERSION)
30        #define SK_BUILD_FOR_PALM
31    #elif defined(UNDER_CE)
32        #define SK_BUILD_FOR_WINCE
33    #elif defined(WIN32)
34        #define SK_BUILD_FOR_WIN32
35    #elif defined(__SYMBIAN32__)
36        #define SK_BUILD_FOR_WIN32
37    #elif defined(linux)
38        #define SK_BUILD_FOR_UNIX
39    #else
40        #define SK_BUILD_FOR_MAC
41    #endif
42
43#endif
44
45//////////////////////////////////////////////////////////////////////
46
47#if !defined(SK_DEBUG) && !defined(SK_RELEASE)
48    #ifdef NDEBUG
49        #define SK_RELEASE
50    #else
51        #define SK_DEBUG
52    #endif
53#endif
54
55//////////////////////////////////////////////////////////////////////
56
57// define to blank or change this in SkUserConfig.h as needed
58#define SK_RESTRICT __restrict__
59
60//////////////////////////////////////////////////////////////////////
61
62#if defined(SK_BUILD_FOR_WIN32) || defined(SK_BUILD_FOR_MAC)
63    #ifndef SK_CAN_USE_FLOAT
64        #define SK_CAN_USE_FLOAT
65    #endif
66    #if !defined(SK_SCALAR_IS_FIXED) && !defined(SK_SCALAR_IS_FLOAT)
67        #define SK_SCALAR_IS_FIXED
68    #endif
69
70    #ifndef SkLONGLONG
71        #ifdef SK_BUILD_FOR_WIN32
72            #define SkLONGLONG  __int64
73        #else
74            #define SkLONGLONG  long long
75        #endif
76    #endif
77#endif
78
79//////////////////////////////////////////////////////////////////////
80
81#if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
82    #if defined (__ppc__) || defined(__ppc64__)
83        #define SK_CPU_BENDIAN
84    #else
85        #define SK_CPU_LENDIAN
86    #endif
87#endif
88
89//////////////////////////////////////////////////////////////////////
90
91#if (defined(__arm__) && !defined(__thumb__)) || defined(SK_BUILD_FOR_BREW) || defined(SK_BUILD_FOR_WINCE) || (defined(SK_BUILD_FOR_SYMBIAN) && !defined(__MARM_THUMB__))
92    /* e.g. the ARM instructions have conditional execution, making tiny branches cheap */
93    #define SK_CPU_HAS_CONDITIONAL_INSTR
94#endif
95
96//////////////////////////////////////////////////////////////////////
97// Conditional features based on build target
98
99#ifdef SK_BUILD_FOR_SYMBIAN
100    #define SK_USE_RUNTIME_GLOBALS
101#endif
102
103#endif
104
105