summaryrefslogtreecommitdiff
path: root/src/internal/slibtool_visibility_impl.h
blob: 44ab2ddc377ea1c85a78084669007427dcdc5ac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef SLIBTOOL_VISIBILITY_IMPL_H
#define SLIBTOOL_VISIBILITY_IMPL_H

/**********************************************************************/
/* PE targets: __dllexport suffices for the purpose of exporting only */
/* the desired subset of global symbols; this makes the visibility    */
/* attribute not only redundant, but also tricky if not properly      */
/* supported by the toolchain.                                        */
/*                                                                    */
/* When targeting Midipix hosts, where elf-like visibility is fully   */
/* supported and may be detected via the __PE_VISIBILITY__ macro,     */
/* we utilize the attribute to render private symbols invisibile      */
/* to dlsym(), as well as reduce the size of the .gotstrs section.    */
/**********************************************************************/

#if defined(__PE_VISIBILITY__)
#define slbt_hidden _ATTR_VISIBILITY_HIDDEN
#elif defined(__PE__)
#define slbt_hidden
#elif defined(_ATTR_VISIBILITY_HIDDEN)
#define slbt_hidden _ATTR_VISIBILITY_HIDDEN
#else
#define slbt_hidden
#endif

#endif