1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 // -*- Mode: C++ -*- 3 // 4 // Copyright (C) 2016-2020 Red Hat, Inc. 5 // 6 // Author: Dodji Seketeli 7 8 #ifndef __ABG_INTERNAL_H__ 9 #define __ABG_INTERNAL_H__ 10 #include "config.h" 11 12 #ifdef HAS_GCC_VISIBILITY_ATTRIBUTE 13 14 /// This macro makes a declaration be hidden at the binary level. 15 /// 16 /// On ELF systems, this means that the symbol for the declaration 17 /// (function or variable) is going to be local to the file. External 18 /// ELF files won't be able to link against the symbol. 19 #define ABG_HIDDEN __attribute__((visibility("hidden"))) 20 21 /// This macro makes a declaration be exported at the binary level. 22 /// 23 /// On ELF systems, this means that the symbol for the declaration 24 ///(function or variable) is going to be global. External ELF files 25 ///will be able to link against the symbol. 26 #define ABG_EXPORTED __attribute__((visibility("default"))) 27 #define ABG_BEGIN_EXPORT_DECLARATIONS _Pragma("GCC visibility push(default)") 28 #define ABG_END_EXPORT_DECLARATIONS _Pragma("GCC visibility pop") 29 #else 30 #define ABG_HIDDEN 31 #define ABG_EXPORTED 32 #define ABG_BEGIN_EXPORT_DECLARATIONS 33 #define ABG_END_EXPORT_DECLARATIONS 34 #endif 35 #endif // __ABG_INTERNAL_H__ 36