Code quality: Added possibility to pinpoint MSVC warnings C4251, C4275

This commit is contained in:
Philippe Tillet
2015-08-05 10:10:43 -07:00
parent 1a42494411
commit f82b954614
4 changed files with 189 additions and 170 deletions

View File

@@ -11,4 +11,17 @@
#define ISAACAPI __attribute__((visibility("default")))
#endif
#if defined(_WIN32) || defined(_MSC_VER)
#define DISABLE_MSVC_WARNING_C4251 __pragma(warning(disable: 4251))
#define RESTORE_MSVC_WARNING_C4251 __pragma(warning(default: 4251))
#define DISABLE_MSVC_WARNING_C4275 __pragma(warning(disable: 4275))
#define RESTORE_MSVC_WARNING_C4275 __pragma(warning(disable: 4275))
#else
#define DISABLE_MSVC_WARNING_C4251
#define RESTORE_MSVC_WARNING_C4251
#define DISABLE_MSVC_WARNING_C4275
#define RESTORE_MSVC_WARNING_C4275
#endif
#endif

View File

@@ -12,6 +12,8 @@
#endif
#include "isaac/defines.h"
DISABLE_MSVC_WARNING_C4275
namespace isaac
{
namespace driver
@@ -204,4 +206,6 @@ ISAACAPI void check(cl_int err);
}
}
RESTORE_MSVC_WARNING_C4275
#endif

View File

@@ -53,8 +53,10 @@ public:
~Handle();
private:
DISABLE_MSVC_WARNING_C4251
std::shared_ptr<CLType> cl_;
std::shared_ptr<CUType> cu_;
RESTORE_MSVC_WARNING_C4251
private:
backend_type backend_;
bool has_ownership_;