1 /* 2 * Copyright (c) 2021-2022 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 applicable 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 FOUNDATION_ACE_FRAMEWORKS_BASE_UTILS_MACROS_H 17 #define FOUNDATION_ACE_FRAMEWORKS_BASE_UTILS_MACROS_H 18 19 #define ACE_WEAK_SYM __attribute__((weak)) 20 21 #ifndef ACE_FORCE_EXPORT 22 #ifndef WINDOWS_PLATFORM 23 #define ACE_FORCE_EXPORT __attribute__((visibility("default"))) 24 #else 25 #define ACE_FORCE_EXPORT __declspec(dllexport) 26 #endif 27 #endif 28 29 #ifndef ACE_EXPORT 30 #if !defined(HIDDEN_SYMBOL) && !defined(WINDOWS_PLATFORM) 31 #define ACE_EXPORT ACE_FORCE_EXPORT 32 #else 33 #define ACE_EXPORT 34 #endif 35 #endif 36 37 #ifdef ACE_DEBUG 38 39 #ifdef NDEBUG 40 #define CANCEL_NDEBUG 41 #undef NDEBUG 42 #endif // NDEBUG 43 44 #include <cassert> 45 46 #ifdef CANCEL_NDEBUG 47 #define NDEBUG 48 #undef CANCEL_NDEBUG 49 #endif // CANCEL_NDEBUG 50 51 #define ACE_DCHECK(expr) assert(expr) 52 #else 53 #define ACE_DCHECK(expr) ((void)0) 54 55 #endif // ACE_DEBUG 56 57 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_UTILS_MACROS_H 58