gitlab-ci: enable sanitizers for the meson builds
[mesa-waffle.git] / src / waffle / api / waffle_error.c
blobd7b22eed3231716ef8b339d2d744bb9f8f629ac2
1 // SPDX-FileCopyrightText: Copyright 2012 Intel Corporation
2 // SPDX-License-Identifier: BSD-2-Clause
4 #include <string.h>
6 #include "api_priv.h"
8 #include "wcore_error.h"
10 WAFFLE_API enum waffle_error
11 waffle_error_get_code(void)
13 return wcore_error_get_code();
16 WAFFLE_API const struct waffle_error_info*
17 waffle_error_get_info(void)
19 return wcore_error_get_info();
22 WAFFLE_API const char*
23 waffle_error_to_string(enum waffle_error e)
25 switch (e) {
26 #define CASE(x) case x: return #x
27 CASE(WAFFLE_NO_ERROR);
28 CASE(WAFFLE_ERROR_FATAL);
29 CASE(WAFFLE_ERROR_UNKNOWN);
30 CASE(WAFFLE_ERROR_INTERNAL);
31 CASE(WAFFLE_ERROR_BAD_ALLOC);
32 CASE(WAFFLE_ERROR_NOT_INITIALIZED);
33 CASE(WAFFLE_ERROR_ALREADY_INITIALIZED);
34 CASE(WAFFLE_ERROR_BAD_ATTRIBUTE);
35 CASE(WAFFLE_ERROR_BAD_PARAMETER);
36 CASE(WAFFLE_ERROR_BAD_DISPLAY_MATCH);
37 CASE(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM);
38 CASE(WAFFLE_ERROR_BUILT_WITHOUT_SUPPORT);
39 default: return 0;
40 #undef CASE