11 #ifndef GrConfig_DEFINED
12 #define GrConfig_DEFINED
27 #if defined(__APPLE_CPP__) || defined(__APPLE_CC__)
28 #include <TargetConditionals.h>
35 #if !defined(GR_CACHE_STATS)
36 #if defined(SK_DEBUG) || defined(SK_DUMP_STATS)
37 #define GR_CACHE_STATS 1
39 #define GR_CACHE_STATS 0
43 #if !defined(GR_GPU_STATS)
44 #if defined(SK_DEBUG) || defined(SK_DUMP_STATS)
45 #define GR_GPU_STATS 1
47 #define GR_GPU_STATS 0
54 #if defined(SK_BUILD_FOR_WIN32)
56 typedef signed char int8_t;
57 typedef unsigned char uint8_t;
58 typedef short int16_t;
59 typedef unsigned short uint16_t;
61 typedef unsigned uint32_t;
62 typedef __int64 int64_t;
63 typedef unsigned __int64 uint64_t;
70 #ifndef __STDC_LIMIT_MACROS
71 #define __STDC_LIMIT_MACROS
73 #ifndef __STDC_CONSTANT_MACROS
74 #define __STDC_CONSTANT_MACROS
88 #define GR_STRING(X) GR_STRING_IMPL(X)
89 #define GR_STRING_IMPL(X) #X
95 #define GR_CONCAT(X,Y) GR_CONCAT_IMPL(X,Y)
96 #define GR_CONCAT_IMPL(X,Y) X##Y
101 #define GR_FILE_AND_LINE_STR __FILE__ "(" GR_STRING(__LINE__) ") : "
109 #if defined(_MSC_VER)
110 #define GR_WARN(MSG) (GR_FILE_AND_LINE_STR "WARNING: " MSG)
111 #else//__GNUC__ - may need other defines for different compilers
112 #define GR_WARN(MSG) ("WARNING: " MSG)
118 #if !defined(GR_ALWAYSBREAK)
119 #if defined(SK_BUILD_FOR_WIN32)
120 #define GR_ALWAYSBREAK SkNO_RETURN_HINT(); __debugbreak()
125 #define GR_ALWAYSBREAK SkNO_RETURN_HINT(); *((int*)(int64_t)(int32_t)0xbeefcafe) = 0;
132 #if !defined(GR_DEBUGBREAK)
134 #define GR_DEBUGBREAK GR_ALWAYSBREAK
136 #define GR_DEBUGBREAK
143 #if !defined(GR_ALWAYSASSERT)
144 #define GR_ALWAYSASSERT(COND) \
147 SkDebugf("%s %s failed\n", GR_FILE_AND_LINE_STR, #COND); \
156 #if !defined(GR_DEBUGASSERT)
158 #define GR_DEBUGASSERT(COND) GR_ALWAYSASSERT(COND)
160 #define GR_DEBUGASSERT(COND)
167 #define GrAlwaysAssert(COND) GR_ALWAYSASSERT(COND)
174 #define GR_STATIC_ASSERT(CONDITION) static_assert(CONDITION, "bug")