libclap 1.0.0
Command Line Argument Parser for C
Loading...
Searching...
No Matches
clap_export.h
Go to the documentation of this file.
1
21#ifndef CLAP_EXPORT_H
22#define CLAP_EXPORT_H
23
24/* CLAP_STATIC: must be defined by consumers linking statically */
25#if defined(CLAP_STATIC)
26# define CLAP_EXPORT
27
28/* Windows: dllexport when building, dllimport when consuming */
29#elif defined(_WIN32)
30# ifdef BUILDING_CLAP
31# define CLAP_EXPORT __declspec(dllexport)
32# else
33# define CLAP_EXPORT __declspec(dllimport)
34# endif
35
36/* Linux/macOS: restore default visibility when library uses -fvisibility=hidden */
37#elif defined(BUILDING_CLAP) && defined(CLAP_HIDDEN_SYMBOLS)
38# define CLAP_EXPORT __attribute__((visibility("default")))
39
40/* Default: no decoration needed */
41#else
42# define CLAP_EXPORT
43#endif
44
45/* ============================================================================
46 * Deprecation annotation
47 * ============================================================================ */
48
49#if defined(__GNUC__) || defined(__clang__)
50# define CLAP_DEPRECATED(msg) __attribute__((deprecated(msg)))
51#elif defined(_MSC_VER) && _MSC_VER >= 1900
52# define CLAP_DEPRECATED(msg) __declspec(deprecated(msg))
53#else
54# define CLAP_DEPRECATED(msg)
55#endif
56
57#endif /* CLAP_EXPORT_H */