File: api.h

package info (click to toggle)
graphviz 14.0.5-2
  • links: PTS
  • area: main
  • in suites: forky
  • size: 139,388 kB
  • sloc: ansic: 141,938; cpp: 11,957; python: 7,766; makefile: 4,043; yacc: 3,030; xml: 2,972; tcl: 2,495; sh: 1,388; objc: 1,159; java: 560; lex: 423; perl: 243; awk: 156; pascal: 139; php: 58; ruby: 49; cs: 31; sed: 1
file content (28 lines) | stat: -rw-r--r-- 1,263 bytes parent folder | download | duplicates (2)
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
27
28
/// @file
/// @brief macro for API hiding/exposing

#pragma once

/// hide a symbol outside of its containing library
///
/// This should be used for functions that are only called from within the same
/// containing library. That is, functions that would be `static` if the entire
/// library was within a single translation unit. The purpose of this annotation
/// is to reduce symbol conflicts and symbol table bloat in downstream targets
/// that do not need this symbol exposed.
#if !defined(__CYGWIN__) && defined(__GNUC__) && !defined(__MINGW32__)
#define PRIVATE __attribute__((visibility("hidden")))
#else
#define PRIVATE /* Nothing required. In other toolchains, symbol hiding is the \
                   default. */
#endif

/// use this macro to hide libutil’s symbols by default
///
/// The expectation is that users of this library (applications, shared
/// libraries, or static libraries) want to call some of the exposed functions
/// but not re-export them to their users. This annotation is only correct while
/// the containing library is built statically. If it were built as a shared
/// library, API symbols would need to have `default` visibility (and thus be
/// unavoidably re-exported) in order to be callable.
#define UTIL_API PRIVATE