1cb93a386Sopenharmony_ci/*
2cb93a386Sopenharmony_ci * Copyright 2017 Google Inc.
3cb93a386Sopenharmony_ci *
4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be
5cb93a386Sopenharmony_ci * found in the LICENSE file.
6cb93a386Sopenharmony_ci */
7cb93a386Sopenharmony_ci
8cb93a386Sopenharmony_ci#ifndef SKSL_LEXUTIL
9cb93a386Sopenharmony_ci#define SKSL_LEXUTIL
10cb93a386Sopenharmony_ci
11cb93a386Sopenharmony_ci#include <cstdlib>
12cb93a386Sopenharmony_ci
13cb93a386Sopenharmony_ci#define INVALID -1
14cb93a386Sopenharmony_ci
15cb93a386Sopenharmony_ci#define SK_ABORT(...) (fprintf(stderr, __VA_ARGS__), abort())
16cb93a386Sopenharmony_ci#define SkASSERT(x) \
17cb93a386Sopenharmony_ci    (void)((x) || (SK_ABORT("failed SkASSERT(%s): %s:%d\n", #x, __FILE__, __LINE__), 0))
18cb93a386Sopenharmony_ci#define SkUNREACHABLE (SK_ABORT("unreachable"))
19cb93a386Sopenharmony_ci
20cb93a386Sopenharmony_ci#endif
21