Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

headers/openvr.h: Allow user to specify ABI type #894

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 16 additions & 3 deletions headers/openvr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1523,16 +1523,29 @@ struct ImuSample_t

#pragma pack( pop )

#define VR_ABI_WIN32 1
#define VR_ABI_UNIX 2

#ifndef VR_ABI
# if defined(_WIN32)
# define VR_ABI VR_ABI_WIN32
# elif defined(__GNUC__) || defined(COMPILER_GCC) || defined(__APPLE__)
# define VR_ABI VR_ABI_UNIX
# else
# error "Unsupported Platform."
# endif
#endif

// figure out how to import from the VR API dll
#if defined(_WIN32)
#if VR_ABI == VR_ABI_WIN32

#ifdef VR_API_EXPORT
#define VR_INTERFACE extern "C" __declspec( dllexport )
#else
#define VR_INTERFACE extern "C" __declspec( dllimport )
#endif

#elif defined(__GNUC__) || defined(COMPILER_GCC) || defined(__APPLE__)
#elif VR_ABI == VR_ABI_UNIX

#ifdef VR_API_EXPORT
#define VR_INTERFACE extern "C" __attribute__((visibility("default")))
Expand All @@ -1545,7 +1558,7 @@ struct ImuSample_t
#endif


#if defined( _WIN32 )
#if VR_ABI == VR_ABI_WIN32
#define VR_CALLTYPE __cdecl
#else
#define VR_CALLTYPE
Expand Down