SkPreConfig.h revision ec4400824c33f2b354a1c8be8951a0d0120545f1
1
2/*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10#ifndef SkPreConfig_DEFINED
11#define SkPreConfig_DEFINED
12
13#ifdef WEBKIT_VERSION_MIN_REQUIRED
14    #include "config.h"
15#endif
16
17//////////////////////////////////////////////////////////////////////
18
19#if !defined(SK_BUILD_FOR_ANDROID_NDK) && !defined(SK_BUILD_FOR_IOS) && !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) && !defined(SK_BUILD_FOR_BREW)
20
21    #ifdef __APPLE__
22        #include "TargetConditionals.h"
23    #endif
24
25    #if defined(PALMOS_SDK_VERSION)
26        #define SK_BUILD_FOR_PALM
27    #elif defined(UNDER_CE)
28        #define SK_BUILD_FOR_WINCE
29    #elif defined(WIN32)
30        #define SK_BUILD_FOR_WIN32
31    #elif defined(__SYMBIAN32__)
32        #define SK_BUILD_FOR_WIN32
33    #elif defined(linux) || defined(__OpenBSD_)
34        #define SK_BUILD_FOR_UNIX
35    #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
36        #define SK_BUILD_FOR_IOS
37    #elif defined(ANDROID_NDK)
38        #define SK_BUILD_FOR_ANDROID_NDK
39    #elif defined(ANROID)
40        #define SK_BUILD_FOR_ANDROID
41    #else
42        #define SK_BUILD_FOR_MAC
43    #endif
44
45#endif
46
47//////////////////////////////////////////////////////////////////////
48
49#if !defined(SK_DEBUG) && !defined(SK_RELEASE)
50    #ifdef NDEBUG
51        #define SK_RELEASE
52    #else
53        #define SK_DEBUG
54    #endif
55#endif
56
57#ifdef SK_BUILD_FOR_WIN32
58    #if !defined(SK_RESTRICT)
59        #define SK_RESTRICT __restrict
60    #endif
61    #include "sk_stdint.h"
62#endif
63
64//////////////////////////////////////////////////////////////////////
65
66#if !defined(SK_RESTRICT)
67    #define SK_RESTRICT __restrict__
68#endif
69
70//////////////////////////////////////////////////////////////////////
71
72#if !defined(SK_SCALAR_IS_FLOAT) && !defined(SK_SCALAR_IS_FIXED)
73    #define SK_SCALAR_IS_FLOAT
74    #define SK_CAN_USE_FLOAT
75#endif
76
77//////////////////////////////////////////////////////////////////////
78
79#if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
80    #if defined (__ppc__) || defined(__ppc64__)
81        #define SK_CPU_BENDIAN
82    #else
83        #define SK_CPU_LENDIAN
84    #endif
85#endif
86
87//////////////////////////////////////////////////////////////////////
88
89#if (defined(__arm__) && !defined(__thumb__)) || defined(SK_BUILD_FOR_WINCE) || (defined(SK_BUILD_FOR_SYMBIAN) && !defined(__MARM_THUMB__))
90    /* e.g. the ARM instructions have conditional execution, making tiny branches cheap */
91    #define SK_CPU_HAS_CONDITIONAL_INSTR
92#endif
93
94//////////////////////////////////////////////////////////////////////
95
96#if !defined(SKIA_IMPLEMENTATION)
97    #define SKIA_IMPLEMENTATION 0
98#endif
99
100#if defined(SKIA_DLL)
101    #if defined(WIN32)
102        #if SKIA_IMPLEMENTATION
103            #define SK_API __declspec(dllexport)
104        #else
105            #define SK_API __declspec(dllimport)
106        #endif
107    #else
108        #define SK_API __attribute__((visibility("default")))
109    #endif
110#else
111    #define SK_API
112#endif
113
114#endif
115
116