Home | History | Annotate | Download | only in core
      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) && !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(ANDROID_NDK)
     34         #define SK_BUILD_FOR_ANDROID_NDK
     35     #elif defined(ANDROID)
     36         #define SK_BUILD_FOR_ANDROID
     37     #elif defined(linux) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
     38           defined(__sun) || defined(__NetBSD__) || defined(__DragonFly__)
     39         #define SK_BUILD_FOR_UNIX
     40     #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
     41         #define SK_BUILD_FOR_IOS
     42     #else
     43         #define SK_BUILD_FOR_MAC
     44     #endif
     45 
     46 #endif
     47 
     48 /* Even if the user only defined the NDK variant we still need to build
     49  * the default Android code. Therefore, when attempting to include/exclude
     50  * something from the NDK variant check first that we are building for
     51  * Android then check the status of the NDK define.
     52  */
     53 #if defined(SK_BUILD_FOR_ANDROID_NDK) && !defined(SK_BUILD_FOR_ANDROID)
     54     #define SK_BUILD_FOR_ANDROID
     55 #endif
     56 
     57 //////////////////////////////////////////////////////////////////////
     58 
     59 #if !defined(SK_DEBUG) && !defined(SK_RELEASE)
     60     #ifdef NDEBUG
     61         #define SK_RELEASE
     62     #else
     63         #define SK_DEBUG
     64     #endif
     65 #endif
     66 
     67 #ifdef SK_BUILD_FOR_WIN32
     68     #if !defined(SK_RESTRICT)
     69         #define SK_RESTRICT __restrict
     70     #endif
     71     #include "sk_stdint.h"
     72 #endif
     73 
     74 //////////////////////////////////////////////////////////////////////
     75 
     76 #if !defined(SK_RESTRICT)
     77     #define SK_RESTRICT __restrict__
     78 #endif
     79 
     80 //////////////////////////////////////////////////////////////////////
     81 
     82 #if !defined(SK_SCALAR_IS_FLOAT) && !defined(SK_SCALAR_IS_FIXED)
     83     #define SK_SCALAR_IS_FLOAT
     84     #define SK_CAN_USE_FLOAT
     85 #endif
     86 
     87 //////////////////////////////////////////////////////////////////////
     88 
     89 #if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
     90     #if defined (__ppc__) || defined(__ppc64__)
     91         #define SK_CPU_BENDIAN
     92     #else
     93         #define SK_CPU_LENDIAN
     94     #endif
     95 #endif
     96 
     97 //////////////////////////////////////////////////////////////////////
     98 
     99 #if (defined(__arm__) && !defined(__thumb__)) || defined(SK_BUILD_FOR_WINCE) || (defined(SK_BUILD_FOR_SYMBIAN) && !defined(__MARM_THUMB__))
    100     /* e.g. the ARM instructions have conditional execution, making tiny branches cheap */
    101     #define SK_CPU_HAS_CONDITIONAL_INSTR
    102 #endif
    103 
    104 //////////////////////////////////////////////////////////////////////
    105 
    106 #if !defined(SKIA_IMPLEMENTATION)
    107     #define SKIA_IMPLEMENTATION 0
    108 #endif
    109 
    110 #if defined(SKIA_DLL)
    111     #if defined(WIN32)
    112         #if SKIA_IMPLEMENTATION
    113             #define SK_API __declspec(dllexport)
    114         #else
    115             #define SK_API __declspec(dllimport)
    116         #endif
    117     #else
    118         #define SK_API __attribute__((visibility("default")))
    119     #endif
    120 #else
    121     #define SK_API
    122 #endif
    123 
    124 #endif
    125 
    126