1 /* 2 * Copyright (c) 2023 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 OHOS_HDI_LPP_BASE_TYPE_H 17 #define OHOS_HDI_LPP_BASE_TYPE_H 18 19 #include <string> 20 #include <map> 21 22 #ifdef LOG_DOMAIN 23 #undef LOG_DOMAIN 24 #endif 25 #define LOG_DOMAIN 0xD002B90 26 27 #ifdef HDF_LOG_TAG 28 #undef HDF_LOG_TAG 29 #endif 30 namespace OHOS { 31 namespace HDI { 32 namespace LowPowerPlayer { 33 namespace V1_0 { 34 35 #define CHECK_NULLPOINTER_RETURN_VALUE(pointer, ret) do { \ 36 if ((pointer) == NULL) { \ 37 HDF_LOGE("%s: pointer is null", __func__); \ 38 return (ret); \ 39 } \ 40 } while (0) 41 42 #define CHECK_NULLPOINTER_RETURN(pointer) do { \ 43 if ((pointer) == NULL) { \ 44 HDF_LOGE("%s: pointer is null", __func__); \ 45 return; \ 46 } \ 47 } while (0) 48 49 #define CHECK_TRUE_RETURN_RET_LOG(cond, ret, fmt, ...) \ 50 do { \ 51 if ((cond)) { \ 52 HDF_LOGE(fmt, ##__VA_ARGS__); \ 53 return ret; \ 54 } \ 55 } while (0) 56 57 } 58 } 59 } 60 } 61 #endif // OHOS_HDI_LPP_V1_0_BASE_TYPE_H