USRP Hardware Driver and USRP Manual Version: 4.0.0.0
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#pragma once
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>
16typedef 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
60// Define API declaration macro
61#ifdef UHD_STATIC_LIB
62 #define UHD_API
63#else
64 #ifdef UHD_DLL_EXPORTS
65 #define UHD_API UHD_EXPORT
66 #else
67 #define UHD_API UHD_IMPORT
68 #endif // UHD_DLL_EXPORTS
69#endif // UHD_STATIC_LIB
70
71// Platform defines for conditional code:
72// Taken from boost/config/select_platform_config.hpp,
73// However, we define macros, not strings, for platforms.
74#if (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GLIBC__)) && !defined(_CRAYC) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
75 #define UHD_PLATFORM_LINUX
76#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
77 #define UHD_PLATFORM_WIN32
78#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
79 #define UHD_PLATFORM_MACOS
80#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
81 #define UHD_PLATFORM_BSD
82#endif