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_FORCE_EXPORT __attribute__((visibility("default"))) 20 21 #ifndef ACE_EXPORT 22 #ifndef HIDDEN_SYMBOL 23 #define ACE_EXPORT ACE_FORCE_EXPORT 24 #else 25 #define ACE_EXPORT 26 #endif 27 #endif 28 29 // The macro "ACE_FORCE_EXPORT_WITH_PREVIEW" is used to replace the macro "ACE_FORCE_EXPORT" 30 // when adapting the napi to the previewer. 31 #ifndef ACE_FORCE_EXPORT_WITH_PREVIEW 32 #ifndef WINDOWS_PLATFORM 33 #define ACE_FORCE_EXPORT_WITH_PREVIEW ACE_FORCE_EXPORT 34 #else 35 #define ACE_FORCE_EXPORT_WITH_PREVIEW __declspec(dllexport) 36 #endif 37 #endif 38 39 // The macro "ACE_EXPORT_WITH_PREVIEW" is used to replace the macro "ACE_EXPORT" 40 // when adapting the napi to the previewer. 41 #ifndef ACE_EXPORT_WITH_PREVIEW 42 #ifndef WINDOWS_PLATFORM 43 #define ACE_EXPORT_WITH_PREVIEW ACE_EXPORT 44 #else 45 #ifndef WEARABLE_PRODUCT 46 #define ACE_EXPORT_WITH_PREVIEW __declspec(dllexport) 47 #else 48 #define ACE_EXPORT_WITH_PREVIEW 49 #endif 50 #endif 51 #endif 52 53 #ifdef ACE_DEBUG 54 55 #ifdef NDEBUG 56 #define CANCEL_NDEBUG 57 #undef NDEBUG 58 #endif // NDEBUG 59 60 #include <cassert> 61 62 #ifdef CANCEL_NDEBUG 63 #define NDEBUG 64 #undef CANCEL_NDEBUG 65 #endif // CANCEL_NDEBUG 66 67 #define ACE_DCHECK(expr) assert(expr) 68 #else 69 #define ACE_DCHECK(expr) ((void)0) 70 71 #endif // ACE_DEBUG 72 73 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_UTILS_MACROS_H 74