Home | History | Annotate | Download | only in core
      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 WEBKIT_VERSION_MIN_REQUIRED
     21     #include "config.h"
     22 #endif
     23 
     24 //////////////////////////////////////////////////////////////////////
     25 
     26 #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)
     27 
     28     #ifdef __APPLE__
     29         #include "TargetConditionals.h"
     30     #endif
     31 
     32     #if defined(PALMOS_SDK_VERSION)
     33         #define SK_BUILD_FOR_PALM
     34     #elif defined(UNDER_CE)
     35         #define SK_BUILD_FOR_WINCE
     36     #elif defined(WIN32)
     37         #define SK_BUILD_FOR_WIN32
     38     #elif defined(__SYMBIAN32__)
     39         #define SK_BUILD_FOR_WIN32
     40     #elif defined(linux)
     41         #define SK_BUILD_FOR_UNIX
     42     #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
     43         #define SK_BUILD_FOR_IOS
     44     #else
     45         #define SK_BUILD_FOR_MAC
     46     #endif
     47 
     48     #if defined(ANDROID)
     49         #define SK_BUILD_FOR_ANDROID
     50     #endif
     51     #if defined(ANDROID_NDK)
     52         #define SK_BUILD_FOR_ANDROID_NDK
     53     #endif
     54 #endif
     55 
     56 //////////////////////////////////////////////////////////////////////
     57 
     58 #if !defined(SK_DEBUG) && !defined(SK_RELEASE)
     59     #ifdef NDEBUG
     60         #define SK_RELEASE
     61     #else
     62         #define SK_DEBUG
     63     #endif
     64 #endif
     65 
     66 #ifdef SK_BUILD_FOR_WIN32
     67     #define SK_RESTRICT
     68     #include "sk_stdint.h"
     69 #endif
     70 
     71 //////////////////////////////////////////////////////////////////////
     72 
     73 #if !defined(SK_RESTRICT)
     74     #define SK_RESTRICT __restrict__
     75 #endif
     76 
     77 //////////////////////////////////////////////////////////////////////
     78 
     79 #if !defined(SK_SCALAR_IS_FLOAT) && !defined(SK_SCALAR_IS_FIXED)
     80     #define SK_SCALAR_IS_FLOAT
     81     #define SK_CAN_USE_FLOAT
     82 #endif
     83 
     84 //////////////////////////////////////////////////////////////////////
     85 
     86 #if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
     87     #if defined (__ppc__) || defined(__ppc64__)
     88         #define SK_CPU_BENDIAN
     89     #else
     90         #define SK_CPU_LENDIAN
     91     #endif
     92 #endif
     93 
     94 //////////////////////////////////////////////////////////////////////
     95 
     96 #if (defined(__arm__) && !defined(__thumb__)) || defined(SK_BUILD_FOR_WINCE) || (defined(SK_BUILD_FOR_SYMBIAN) && !defined(__MARM_THUMB__))
     97     /* e.g. the ARM instructions have conditional execution, making tiny branches cheap */
     98     #define SK_CPU_HAS_CONDITIONAL_INSTR
     99 #endif
    100 
    101 //////////////////////////////////////////////////////////////////////
    102 
    103 #if !defined(SKIA_IMPLEMENTATION)
    104     #define SKIA_IMPLEMENTATION 0
    105 #endif
    106 
    107 #if defined(SKIA_DLL)
    108     #if defined(WIN32)
    109         #if SKIA_IMPLEMENTATION
    110             #define SK_API __declspec(dllexport)
    111         #else
    112             #define SK_API __declspec(dllimport)
    113         #endif
    114     #else
    115         #define SK_API __attribute__((visibility("default")))
    116     #endif
    117 #else
    118     #define SK_API
    119 #endif
    120 
    121 #endif
    122 
    123