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