mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
inc/xrt: Some MSVC and Windows support
This commit is contained in:
parent
3ff56f4a3c
commit
54f6aa2166
|
@ -58,6 +58,8 @@
|
||||||
*/
|
*/
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#define XRT_MAYBE_UNUSED __attribute__((unused))
|
#define XRT_MAYBE_UNUSED __attribute__((unused))
|
||||||
|
#elif defined(_MSC_VER) && defined(__cplusplus)
|
||||||
|
#define XRT_MAYBE_UNUSED [[maybe_unused]]
|
||||||
#else
|
#else
|
||||||
#define XRT_MAYBE_UNUSED
|
#define XRT_MAYBE_UNUSED
|
||||||
#endif
|
#endif
|
||||||
|
@ -68,6 +70,8 @@
|
||||||
*/
|
*/
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#define XRT_NO_INLINE __attribute__((noinline))
|
#define XRT_NO_INLINE __attribute__((noinline))
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define XRT_NO_INLINE __declspec(noinline)
|
||||||
#else
|
#else
|
||||||
#define XRT_NO_INLINE
|
#define XRT_NO_INLINE
|
||||||
#endif
|
#endif
|
||||||
|
@ -126,6 +130,14 @@ xrt_atomic_s32_cmpxchg(xrt_atomic_s32_t *p, int32_t old_, int32_t new_)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#ifdef XRT_64_BIT
|
||||||
|
typedef int64_t ssize_t;
|
||||||
|
#else
|
||||||
|
typedef int32_t ssize_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Get the holder from a pointer to a field.
|
* Get the holder from a pointer to a field.
|
||||||
*
|
*
|
||||||
|
|
|
@ -29,6 +29,10 @@
|
||||||
#define XRT_OS_WAS_AUTODETECTED
|
#define XRT_OS_WAS_AUTODETECTED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#define XRT_OS_WINDOWS
|
||||||
|
#define XRT_OS_WAS_AUTODETECTED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef XRT_OS_WAS_AUTODETECTED
|
#ifndef XRT_OS_WAS_AUTODETECTED
|
||||||
|
|
Loading…
Reference in a new issue