diff options
author | halcanary <halcanary@google.com> | 2015-12-01 09:02:49 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-01 09:02:49 -0800 |
commit | 0cbe7ee765cf72f15e6ca10b308676aa077fb3e2 (patch) | |
tree | fb6c06bbf5b34e9bc72cb5b659ccd8ce46de3700 /include | |
parent | 9323dc6a72de301f23e1187adc2365395b4b23d8 (diff) |
CMake, include/: changes to make fiddle 2.0 better
cmake: remove unused directories from skia.h / ${public_includes}
SkPreConfig.h: work around buggy `#ifdef linux`
include: guard many platform-specific headers
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot
Review URL: https://codereview.chromium.org/1488813002
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkPreConfig.h | 6 | ||||
-rw-r--r-- | include/device/xps/SkXPSDevice.h | 5 | ||||
-rw-r--r-- | include/ports/SkTypeface_mac.h | 5 | ||||
-rw-r--r-- | include/ports/SkTypeface_win.h | 5 | ||||
-rw-r--r-- | include/utils/SkDebugUtils.h | 2 | ||||
-rw-r--r-- | include/utils/mac/SkCGUtils.h | 5 | ||||
-rw-r--r-- | include/utils/win/SkAutoCoInitialize.h | 5 | ||||
-rw-r--r-- | include/utils/win/SkHRESULT.h | 4 | ||||
-rw-r--r-- | include/utils/win/SkIStream.h | 7 | ||||
-rw-r--r-- | include/utils/win/SkTScopedComPtr.h | 5 |
10 files changed, 37 insertions, 12 deletions
diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h index 0c720010f7..a1a3037b94 100644 --- a/include/core/SkPreConfig.h +++ b/include/core/SkPreConfig.h @@ -28,9 +28,9 @@ #define SK_BUILD_FOR_WIN32 #elif defined(ANDROID) #define SK_BUILD_FOR_ANDROID - #elif defined(linux) || defined(__FreeBSD__) || defined(__OpenBSD__) || \ - defined(__sun) || defined(__NetBSD__) || defined(__DragonFly__) || \ - defined(__GLIBC__) || defined(__GNU__) + #elif defined(linux) || defined(__linux) || defined(__FreeBSD__) || \ + defined(__OpenBSD__) || defined(__sun) || defined(__NetBSD__) || \ + defined(__DragonFly__) || defined(__GLIBC__) || defined(__GNU__) #define SK_BUILD_FOR_UNIX #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR #define SK_BUILD_FOR_IOS diff --git a/include/device/xps/SkXPSDevice.h b/include/device/xps/SkXPSDevice.h index 9efb6f3dc8..57f314851e 100644 --- a/include/device/xps/SkXPSDevice.h +++ b/include/device/xps/SkXPSDevice.h @@ -10,6 +10,8 @@ #include "SkTypes.h" +#ifdef SK_BUILD_FOR_WIN + #include <ObjBase.h> #include <XpsObjectModel.h> @@ -318,4 +320,5 @@ private: typedef SkBitmapDevice INHERITED; }; -#endif +#endif // SK_BUILD_FOR_WIN +#endif // SkXPSDevice_DEFINED diff --git a/include/ports/SkTypeface_mac.h b/include/ports/SkTypeface_mac.h index 59bf77b106..14440b5383 100644 --- a/include/ports/SkTypeface_mac.h +++ b/include/ports/SkTypeface_mac.h @@ -10,6 +10,8 @@ #include "SkTypeface.h" +#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) + #include <CoreFoundation/CoreFoundation.h> #ifdef SK_BUILD_FOR_MAC @@ -43,4 +45,5 @@ SK_API extern SkTypeface* SkCreateTypefaceFromCTFont(CTFontRef, CFTypeRef = NULL */ SK_API extern CTFontRef SkTypeface_GetCTFontRef(const SkTypeface* face); -#endif +#endif // defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) +#endif // SkTypeface_mac_DEFINED diff --git a/include/ports/SkTypeface_win.h b/include/ports/SkTypeface_win.h index 07752d82f9..b7373986c9 100644 --- a/include/ports/SkTypeface_win.h +++ b/include/ports/SkTypeface_win.h @@ -10,6 +10,8 @@ #include "SkTypeface.h" +#ifdef SK_BUILD_FOR_WIN + /** * Like the other Typeface create methods, this returns a new reference to the * corresponding typeface for the specified logfont. The caller is responsible @@ -58,4 +60,5 @@ SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr*); */ SK_API SkRemotableFontMgr* SkRemotableFontMgr_New_DirectWrite(); -#endif +#endif // SK_BUILD_FOR_WIN +#endif // SkTypeface_win_DEFINED diff --git a/include/utils/SkDebugUtils.h b/include/utils/SkDebugUtils.h index fe276019ba..00ed41fecd 100644 --- a/include/utils/SkDebugUtils.h +++ b/include/utils/SkDebugUtils.h @@ -81,7 +81,7 @@ inline void SkDebugDumpMathematica<size_t>( const size_t val ) { } template<> -void SkDebugDumpMathematica<const char *>( const char * val ) { +inline void SkDebugDumpMathematica<const char *>( const char * val ) { SkDebugf("%s", val); } diff --git a/include/utils/mac/SkCGUtils.h b/include/utils/mac/SkCGUtils.h index 7ac0431b25..3d9aff4451 100644 --- a/include/utils/mac/SkCGUtils.h +++ b/include/utils/mac/SkCGUtils.h @@ -11,6 +11,8 @@ #include "SkSize.h" #include "SkImageInfo.h" +#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) + #ifdef SK_BUILD_FOR_MAC #include <ApplicationServices/ApplicationServices.h> #endif @@ -78,4 +80,5 @@ CGDataProviderRef SkCreateDataProviderFromStream(SkStream*); CGDataProviderRef SkCreateDataProviderFromData(SkData*); -#endif +#endif // defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) +#endif // SkCGUtils_DEFINED diff --git a/include/utils/win/SkAutoCoInitialize.h b/include/utils/win/SkAutoCoInitialize.h index 1123002b61..35fcce5b13 100644 --- a/include/utils/win/SkAutoCoInitialize.h +++ b/include/utils/win/SkAutoCoInitialize.h @@ -10,6 +10,8 @@ #include "SkTypes.h" +#ifdef SK_BUILD_FOR_WIN + /** * An instance of this class initializes COM on creation * and closes the COM library on destruction. @@ -23,4 +25,5 @@ public: bool succeeded(); }; -#endif +#endif // SK_BUILD_FOR_WIN +#endif // SkAutoCo_DEFINED diff --git a/include/utils/win/SkHRESULT.h b/include/utils/win/SkHRESULT.h index 4f9d1bec79..a6cc1d21b9 100644 --- a/include/utils/win/SkHRESULT.h +++ b/include/utils/win/SkHRESULT.h @@ -9,6 +9,7 @@ #define SkHRESULT_DEFINED #include "SkTypes.h" +#ifdef SK_BUILD_FOR_WIN void SkTraceHR(const char* file, unsigned long line, HRESULT hr, const char* msg); @@ -55,4 +56,5 @@ The HRZ variants will return 0 when FAILED. #define HRZ(ex) HR_GENERAL(ex, NULL, 0) #define HRZM(ex, msg) HR_GENERAL(ex, msg, 0) //@} -#endif +#endif // SK_BUILD_FOR_WIN +#endif // SkHRESULT_DEFINED diff --git a/include/utils/win/SkIStream.h b/include/utils/win/SkIStream.h index 9e04b7e472..4a72f5b729 100644 --- a/include/utils/win/SkIStream.h +++ b/include/utils/win/SkIStream.h @@ -10,6 +10,10 @@ #ifndef SkIStream_DEFINED #define SkIStream_DEFINED +#include "SkTypes.h" + +#ifdef SK_BUILD_FOR_WIN + #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <ole2.h> @@ -128,4 +132,5 @@ public: , DWORD grfStatFlag); }; -#endif +#endif // SK_BUILD_FOR_WIN +#endif // SkIStream_DEFINED diff --git a/include/utils/win/SkTScopedComPtr.h b/include/utils/win/SkTScopedComPtr.h index b906fb7c18..d2d925c56f 100644 --- a/include/utils/win/SkTScopedComPtr.h +++ b/include/utils/win/SkTScopedComPtr.h @@ -10,6 +10,8 @@ #include "SkTypes.h" +#ifdef SK_BUILD_FOR_WIN + template<typename T> class SkBlockComRef : public T { private: @@ -71,4 +73,5 @@ public: } }; -#endif +#endif // SK_BUILD_FOR_WIN +#endif // SkTScopedComPtr_DEFINED |