Home | History | Annotate | Download | only in sksl
      1 /*
      2  * Copyright 2019 Google Inc.
      3  *
      4  * Use of this source code is governed by a BSD-style license that can be
      5  * found in the LICENSE file.
      6  */
      7 
      8 #ifndef SKSL_DEFINES
      9 #define SKSL_DEFINES
     10 #ifdef SKSL_STANDALONE
     11 #if defined(_WIN32) || defined(__SYMBIAN32__)
     12 #define SKSL_BUILD_FOR_WIN
     13 #endif
     14 #else
     15 #ifdef SK_BUILD_FOR_WIN
     16 #define SKSL_BUILD_FOR_WIN
     17 #endif // SK_BUILD_FOR_WIN
     18 #endif // SKSL_STANDALONE
     19 
     20 #ifdef SKSL_STANDALONE
     21 #define SkASSERT(x)
     22 #define SkAssertResult(x) x
     23 #define SkDEBUGCODE(x)
     24 #else
     25 #include "SkTypes.h"
     26 #endif
     27 
     28 #define SKSL_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
     29 
     30 #if defined(__clang__) || defined(__GNUC__)
     31 #define SKSL_PRINTF_LIKE(A, B) __attribute__((format(printf, (A), (B))))
     32 #else
     33 #define SKSL_PRINTF_LIKE(A, B)
     34 #endif
     35 
     36 #define ABORT(...) (printf(__VA_ARGS__), sksl_abort())
     37 
     38 #if _MSC_VER
     39 #define NORETURN __declspec(noreturn)
     40 #else
     41 #define NORETURN __attribute__((__noreturn__))
     42 #endif
     43 
     44 #endif
     45