USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-ga1b5c4ae
UHD and USRP Manual
config.h
Go to the documentation of this file.
1 //
2 // Copyright 2015-2016 Ettus Research LLC
3 // Copyright 2018 Ettus Research, a National Instruments Company
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 
8 #ifndef INCLUDED_UHD_CONFIG_H
9 #define INCLUDED_UHD_CONFIG_H
10 
11 #ifdef _MSC_VER
12 // Bring in "and", "or", and "not"
13 #include <iso646.h>
14 
15 // Define ssize_t
16 #include <stddef.h>
17 typedef ptrdiff_t ssize_t;
18 
19 #endif /* _MSC_VER */
20 
21 // Define cross-platform macros
22 #if defined(_MSC_VER)
23  #define UHD_EXPORT __declspec(dllexport)
24  #define UHD_IMPORT __declspec(dllimport)
25  #define UHD_INLINE __forceinline
26  #define UHD_DEPRECATED __declspec(deprecated)
27  #define UHD_ALIGNED(x) __declspec(align(x))
28  #define UHD_UNUSED(x) x
29 #elif defined(__MINGW32__)
30  #define UHD_EXPORT __declspec(dllexport)
31  #define UHD_IMPORT __declspec(dllimport)
32  #define UHD_INLINE inline
33  #define UHD_DEPRECATED __declspec(deprecated)
34  #define UHD_ALIGNED(x) __declspec(align(x))
35  #define UHD_UNUSED(x) x __attribute__((unused))
36 #elif defined(__GNUC__) && __GNUC__ >= 4
37  #define UHD_EXPORT __attribute__((visibility("default")))
38  #define UHD_IMPORT __attribute__((visibility("default")))
39  #define UHD_INLINE inline __attribute__((always_inline))
40  #define UHD_DEPRECATED __attribute__((deprecated))
41  #define UHD_ALIGNED(x) __attribute__((aligned(x)))
42  #define UHD_UNUSED(x) x __attribute__((unused))
43 #elif defined(__clang__)
44  #define UHD_EXPORT __attribute__((visibility("default")))
45  #define UHD_IMPORT __attribute__((visibility("default")))
46  #define UHD_INLINE inline __attribute__((always_inline))
47  #define UHD_DEPRECATED __attribute__((deprecated))
48  #define UHD_ALIGNED(x) __attribute__((aligned(x)))
49  #define UHD_UNUSED(x) x __attribute__((unused))
50 #else
51  #define UHD_EXPORT
52  #define UHD_IMPORT
53  #define UHD_INLINE inline
54  #define UHD_DEPRECATED
55  #define UHD_ALIGNED(x)
56  #define UHD_UNUSED(x) x
57 #endif
58 
59 // API declaration macro
60 #ifdef UHD_DLL_EXPORTS
61  #define UHD_API UHD_EXPORT
62 #else
63  #define UHD_API UHD_IMPORT
64 #endif // UHD_DLL_EXPORTS
65 
66 // Platform defines for conditional code:
67 // Taken from boost/config/select_platform_config.hpp,
68 // However, we define macros, not strings, for platforms.
69 #if (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GLIBC__)) && !defined(_CRAYC) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
70  #define UHD_PLATFORM_LINUX
71 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
72  #define UHD_PLATFORM_WIN32
73 #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
74  #define UHD_PLATFORM_MACOS
75 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
76  #define UHD_PLATFORM_BSD
77 #endif
78 
79 #endif /* INCLUDED_UHD_CONFIG_H */