SkPreConfig.h revision 63debae4c1020fa1e0ccd92ef3cbfdc8735acf8e
18a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/*
28a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * Copyright (C) 2006 The Android Open Source Project
38a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com *
48a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * Licensed under the Apache License, Version 2.0 (the "License");
58a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * you may not use this file except in compliance with the License.
68a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * You may obtain a copy of the License at
78a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com *
88a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com *      http://www.apache.org/licenses/LICENSE-2.0
98a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com *
108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * Unless required by applicable law or agreed to in writing, software
118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * distributed under the License is distributed on an "AS IS" BASIS,
128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * See the License for the specific language governing permissions and
148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * limitations under the License.
158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */
168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifndef SkPreConfig_DEFINED
188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#define SkPreConfig_DEFINED
198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com//////////////////////////////////////////////////////////////////////
218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
22671cd656785de5e84564b6ffe4831625d7016dedreed@android.com#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) && !defined(SK_BUILD_FOR_SDL)
238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
248a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #if defined(PALMOS_SDK_VERSION)
258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        #define SK_BUILD_FOR_PALM
268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #elif defined(UNDER_CE)
278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        #define SK_BUILD_FOR_WINCE
288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #elif defined(WIN32)
298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        #define SK_BUILD_FOR_WIN32
308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #elif defined(__SYMBIAN32__)
318a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        #define SK_BUILD_FOR_WIN32
328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #elif defined(linux)
338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        #define SK_BUILD_FOR_UNIX
348a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #else
358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        #define SK_BUILD_FOR_MAC
368a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #endif
378a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com//////////////////////////////////////////////////////////////////////
418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#if !defined(SK_DEBUG) && !defined(SK_RELEASE)
438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #ifdef NDEBUG
448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        #define SK_RELEASE
458a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #else
468a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        #define SK_DEBUG
478a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #endif
488a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
498a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
5063debae4c1020fa1e0ccd92ef3cbfdc8735acf8ereed@android.com#ifdef SK_BUILD_FOR_WIN32
5163debae4c1020fa1e0ccd92ef3cbfdc8735acf8ereed@android.com	#define SK_RESTRICT
5263debae4c1020fa1e0ccd92ef3cbfdc8735acf8ereed@android.com    #include "sk_stdint.h"
5363debae4c1020fa1e0ccd92ef3cbfdc8735acf8ereed@android.com#endif
5463debae4c1020fa1e0ccd92ef3cbfdc8735acf8ereed@android.com
558a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com//////////////////////////////////////////////////////////////////////
568a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
575c80ea17d4e4a795bfaeb260fc27e952ba471f1dreed@android.com#if !defined(SK_RESTRICT)
585c80ea17d4e4a795bfaeb260fc27e952ba471f1dreed@android.com    #define SK_RESTRICT __restrict__
595c80ea17d4e4a795bfaeb260fc27e952ba471f1dreed@android.com#endif
608a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
618a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com//////////////////////////////////////////////////////////////////////
628a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
635c80ea17d4e4a795bfaeb260fc27e952ba471f1dreed@android.com#if !defined(SK_SCALAR_IS_FLOAT) && !defined(SK_SCALAR_IS_FIXED)
645c80ea17d4e4a795bfaeb260fc27e952ba471f1dreed@android.com    #define SK_SCALAR_IS_FLOAT
655c80ea17d4e4a795bfaeb260fc27e952ba471f1dreed@android.com    #define SK_CAN_USE_FLOAT
668a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
678a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
688a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com//////////////////////////////////////////////////////////////////////
698a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
708a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
718a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #if defined (__ppc__) || defined(__ppc64__)
728a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        #define SK_CPU_BENDIAN
738a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #else
748a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        #define SK_CPU_LENDIAN
758a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #endif
768a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
778a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
788a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com//////////////////////////////////////////////////////////////////////
798a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
808a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#if (defined(__arm__) && !defined(__thumb__)) || defined(SK_BUILD_FOR_BREW) || defined(SK_BUILD_FOR_WINCE) || (defined(SK_BUILD_FOR_SYMBIAN) && !defined(__MARM_THUMB__))
818a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    /* e.g. the ARM instructions have conditional execution, making tiny branches cheap */
828a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    #define SK_CPU_HAS_CONDITIONAL_INSTR
838a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
848a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
858a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
868a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
87