nros C API
Lightweight ROS 2 client for embedded real-time systems
Loading...
Searching...
No Matches
visibility_control.h
Go to the documentation of this file.
1
11#ifndef NROS_VISIBILITY_H
12#define NROS_VISIBILITY_H
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18// Visibility macros for shared library support
19#if defined(_WIN32)
20#if defined(NROS_BUILDING_DLL)
21#define NROS_PUBLIC __declspec(dllexport)
22#elif defined(NROS_USING_DLL)
23#define NROS_PUBLIC __declspec(dllimport)
24#else
25#define NROS_PUBLIC
26#endif
27#define NROS_LOCAL
28#else
29#if __GNUC__ >= 4
30#define NROS_PUBLIC __attribute__((visibility("default")))
31#define NROS_LOCAL __attribute__((visibility("hidden")))
32#else
33#define NROS_PUBLIC
34#define NROS_LOCAL
35#endif
36#endif
37
38// Warn unused result
39#if defined(__GNUC__) || defined(__clang__)
40#define NROS_WARN_UNUSED __attribute__((warn_unused_result))
41#else
42#define NROS_WARN_UNUSED
43#endif
44
45#ifdef __cplusplus
46}
47#endif
48
49#endif // NROS_VISIBILITY_H