OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkPostConfig_DEFINED | 10 #ifndef SkPostConfig_DEFINED |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #endif | 56 #endif |
57 | 57 |
58 #if !defined(SK_HAS_COMPILER_FEATURE) | 58 #if !defined(SK_HAS_COMPILER_FEATURE) |
59 #if defined(__has_feature) | 59 #if defined(__has_feature) |
60 #define SK_HAS_COMPILER_FEATURE(x) __has_feature(x) | 60 #define SK_HAS_COMPILER_FEATURE(x) __has_feature(x) |
61 #else | 61 #else |
62 #define SK_HAS_COMPILER_FEATURE(x) 0 | 62 #define SK_HAS_COMPILER_FEATURE(x) 0 |
63 #endif | 63 #endif |
64 #endif | 64 #endif |
65 | 65 |
| 66 #if !defined(SK_ATTRIBUTE) |
| 67 #if defined(__clang__) || defined(__GNUC__) |
| 68 #define SK_ATTRIBUTE(attr) __attribute__((attr)) |
| 69 #else |
| 70 #define SK_ATTRIBUTE(attr) |
| 71 #endif |
| 72 #endif |
| 73 |
66 #if !defined(SK_SUPPORT_GPU) | 74 #if !defined(SK_SUPPORT_GPU) |
67 #define SK_SUPPORT_GPU 1 | 75 #define SK_SUPPORT_GPU 1 |
68 #endif | 76 #endif |
69 | 77 |
70 /** | 78 /** |
71 * The clang static analyzer likes to know that when the program is not | 79 * The clang static analyzer likes to know that when the program is not |
72 * expected to continue (crash, assertion failure, etc). It will notice that | 80 * expected to continue (crash, assertion failure, etc). It will notice that |
73 * some combination of parameters lead to a function call that does not return. | 81 * some combination of parameters lead to a function call that does not return. |
74 * It can then make appropriate assumptions about the parameters in code | 82 * It can then make appropriate assumptions about the parameters in code |
75 * executed only if the non-returning function was *not* called. | 83 * executed only if the non-returning function was *not* called. |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 #endif | 355 #endif |
348 #endif | 356 #endif |
349 #else | 357 #else |
350 // Linux GCC ignores "__attribute__((override))" and rejects "override". | 358 // Linux GCC ignores "__attribute__((override))" and rejects "override". |
351 #define SK_OVERRIDE | 359 #define SK_OVERRIDE |
352 #endif | 360 #endif |
353 #endif | 361 #endif |
354 | 362 |
355 ////////////////////////////////////////////////////////////////////// | 363 ////////////////////////////////////////////////////////////////////// |
356 | 364 |
| 365 #if !defined(SK_UNUSED) |
| 366 #define SK_UNUSED SK_ATTRIBUTE(unused) |
| 367 #endif |
| 368 |
| 369 ////////////////////////////////////////////////////////////////////// |
| 370 |
357 #ifndef SK_PRINTF_LIKE | 371 #ifndef SK_PRINTF_LIKE |
358 #if defined(__clang__) || defined(__GNUC__) | 372 #if defined(__clang__) || defined(__GNUC__) |
359 #define SK_PRINTF_LIKE(A, B) __attribute__((format(printf, (A), (B)))) | 373 #define SK_PRINTF_LIKE(A, B) __attribute__((format(printf, (A), (B)))) |
360 #else | 374 #else |
361 #define SK_PRINTF_LIKE(A, B) | 375 #define SK_PRINTF_LIKE(A, B) |
362 #endif | 376 #endif |
363 #endif | 377 #endif |
364 | 378 |
365 ////////////////////////////////////////////////////////////////////// | 379 ////////////////////////////////////////////////////////////////////// |
366 | 380 |
367 #ifndef SK_SIZE_T_SPECIFIER | 381 #ifndef SK_SIZE_T_SPECIFIER |
368 #if defined(_MSC_VER) | 382 #if defined(_MSC_VER) |
369 #define SK_SIZE_T_SPECIFIER "%Iu" | 383 #define SK_SIZE_T_SPECIFIER "%Iu" |
370 #else | 384 #else |
371 #define SK_SIZE_T_SPECIFIER "%zu" | 385 #define SK_SIZE_T_SPECIFIER "%zu" |
372 #endif | 386 #endif |
373 #endif | 387 #endif |
374 | 388 |
375 ////////////////////////////////////////////////////////////////////// | 389 ////////////////////////////////////////////////////////////////////// |
376 | 390 |
377 #ifndef SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 391 #ifndef SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
378 #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 1 | 392 #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 1 |
379 #endif | 393 #endif |
OLD | NEW |