1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef ENCODE_HEIF_LOG_FUZZ
17#define ENCODE_HEIF_LOG_FUZZ
18
19#include "hdf_log.h"
20#define HDF_LOG_TAG codec_heif_encoder
21
22#define IF_TRUE_RETURN(cond)  \
23    do {                               \
24        if (cond) {                    \
25            return;                \
26        }                              \
27    } while (0)
28
29#define IF_TRUE_RETURN_WITH_MSG(cond, msg, ...) \
30    do {                                                 \
31        if (cond) {                                      \
32            HDF_LOGE(msg, ##__VA_ARGS__);                \
33            return;                                  \
34        }                                                \
35    } while (0)
36
37#define IF_TRUE_RETURN_VAL(cond, val)  \
38    do {                               \
39        if (cond) {                    \
40            return val;                \
41        }                              \
42    } while (0)
43
44#define IF_TRUE_RETURN_VAL_WITH_MSG(cond, val, msg, ...) \
45    do {                                                 \
46        if (cond) {                                      \
47            HDF_LOGE(msg, ##__VA_ARGS__);                \
48            return val;                                  \
49        }                                                \
50    } while (0)
51
52#endif // ENCODE_HEIF_LOG_FUZZ