OVRWrapper.hh 1.69 KB
Newer Older
Robert Menzel's avatar
Robert Menzel committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
/**
 *
 * Includes the Oculus Rift LibOVR but tries to suppress as much compiler warnings
 * as possible.
 *
 */

#ifdef ACGL_USE_OCULUS_RIFT

/////////////////////////////////////////////////////////////////////////////////////
// ignore compiler warnings from LibOVR:
//
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning ( disable : 4201 )
#pragma warning ( disable : 4100 )
#pragma warning ( disable : 4996 )
#pragma warning ( disable : 4244 )
#endif

#if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4))
#define COMPILER_IS_GCC_4_6_OR_NEWER
#endif

#ifdef __clang__
//   clang/llvm:
#    pragma clang diagnostic push
#    pragma clang diagnostic ignored "-Wuninitialized"
#    pragma clang diagnostic ignored "-Wunused-parameter"
#elif defined __GNUC__
#  ifdef COMPILER_IS_GCC_4_6_OR_NEWER
//    gcc >= 4.6:
#     pragma GCC diagnostic push
#     pragma GCC diagnostic ignored "-Wtype-limits"
#     pragma GCC diagnostic ignored "-Wstrict-aliasing"
#     pragma GCC diagnostic ignored "-Wattributes"
#     pragma GCC diagnostic ignored "-Wreorder"
#  endif
// gcc:
#  pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
//
/////////////////////////////////////////////////////////////////////////////////////

#include <OVR.h>
#include <OVRVersion.h>

/////////////////////////////////////////////////////////////////////////////////////
// reactivate compiler warnings:
//
#ifdef __clang__
// clang/llvm:
#  pragma clang diagnostic pop
#elif defined COMPILER_IS_GCC_4_6_OR_NEWER
// gcc >= 4.6:
#  pragma GCC diagnostic pop
#endif

#ifdef _MSC_VER
#pragma warning( pop )
#endif
//
/////////////////////////////////////////////////////////////////////////////////////


#endif // ACGL_USE_OCULUS_RIFT