mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +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__)
|
||||
#define XRT_MAYBE_UNUSED __attribute__((unused))
|
||||
#elif defined(_MSC_VER) && defined(__cplusplus)
|
||||
#define XRT_MAYBE_UNUSED [[maybe_unused]]
|
||||
#else
|
||||
#define XRT_MAYBE_UNUSED
|
||||
#endif
|
||||
|
@ -68,6 +70,8 @@
|
|||
*/
|
||||
#if defined(__GNUC__)
|
||||
#define XRT_NO_INLINE __attribute__((noinline))
|
||||
#elif defined(_MSC_VER)
|
||||
#define XRT_NO_INLINE __declspec(noinline)
|
||||
#else
|
||||
#define XRT_NO_INLINE
|
||||
#endif
|
||||
|
@ -126,6 +130,14 @@ xrt_atomic_s32_cmpxchg(xrt_atomic_s32_t *p, int32_t old_, int32_t new_)
|
|||
#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.
|
||||
*
|
||||
|
|
|
@ -29,6 +29,10 @@
|
|||
#define XRT_OS_WAS_AUTODETECTED
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define XRT_OS_WINDOWS
|
||||
#define XRT_OS_WAS_AUTODETECTED
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef XRT_OS_WAS_AUTODETECTED
|
||||
|
|
Loading…
Reference in a new issue