Browse Source

ASSume that MSVC is the only compiler who uses the __declspec() syntax

Michael Hansen 11 years ago
parent
commit
e331cbd4f7
  1. 2
      Sources/Plasma/CoreLib/HeadSpin.h
  2. 4
      cmake/CompilerChecks.cmake
  3. 2
      cmake/check_deprecated_attribute.cpp
  4. 1
      cmake/hsCompilerSpecific.h.cmake

2
Sources/Plasma/CoreLib/HeadSpin.h

@ -145,7 +145,7 @@ typedef uint32_t hsGSeedValue;
# define hsDeprecated(message) [[deprecated(message)]]
#elif defined(HAVE_GCC_DEPRECATED_ATTR)
# define hsDeprecated(message) __attribute__((deprecated(message)))
#elif defined(HAVE_MSVC_DEPRECATED_ATTR)
#elif defined(_MSC_VER)
# define hsDeprecated(message) __declspec(deprecated(message))
#else
# define hsDeprecated(message)

4
cmake/CompilerChecks.cmake

@ -47,10 +47,6 @@ try_compile(HAVE_GCC_DEPRECATED_ATTR ${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/cmake/check_deprecated_attribute.cpp
COMPILE_DEFINITIONS -DTRY_GCC_ATTR
OUTPUT_VARIABLE OUTPUT)
try_compile(HAVE_MSVC_DEPRECATED_ATTR ${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/cmake/check_deprecated_attribute.cpp
COMPILE_DEFINITIONS -DTRY_MSVC_ATTR
OUTPUT_VARIABLE OUTPUT)
configure_file(${PROJECT_SOURCE_DIR}/cmake/hsCompilerSpecific.h.cmake
${PROJECT_BINARY_DIR}/hsCompilerSpecific.h)

2
cmake/check_deprecated_attribute.cpp

@ -4,8 +4,6 @@
[[deprecated("derp_func is deprecated -- use func instead")]]
#elif defined(TRY_GCC_ATTR)
__attribute__((deprecated("derp_func is deprecated -- use func instead")))
#elif defined(TRY_MSVC_ATTR)
__declspec(deprecated("derp_func is deprecated -- use func instead"))
#else
# error "DERP"
#endif

1
cmake/hsCompilerSpecific.h.cmake

@ -50,6 +50,5 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#cmakedefine HAVE_CXX14_DEPRECATED_ATTR
#cmakedefine HAVE_GCC_DEPRECATED_ATTR
#cmakedefine HAVE_MSVC_DEPRECATED_ATTR
#endif

Loading…
Cancel
Save