mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 11:19:10 +00:00
Add an hsDeprecated macro for declaring APIs deprecated
This commit is contained in:
@ -32,12 +32,24 @@ try_compile(HAVE_CPUID ${PROJECT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}/cmake/check_cpuid.cpp
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
if(HAVE_CPUID)
|
||||
add_definitions(-DHAVE_CPUID)
|
||||
message("CPUID header found -- using hardware math acceleration when available")
|
||||
else()
|
||||
message("CPUID header not found -- using software math")
|
||||
endif()
|
||||
|
||||
try_compile(HAVE_CXX14_DEPRECATED_ATTR ${PROJECT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}/cmake/check_deprecated_attribute.cpp
|
||||
COMPILE_DEFINITIONS -DTRY_ATTRIBUTE
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
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)
|
||||
|
||||
set(CoreLib_SOURCES
|
||||
HeadSpin.cpp
|
||||
hsBitVector.cpp
|
||||
|
@ -42,6 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#ifndef HeadSpinHDefined
|
||||
#define HeadSpinHDefined
|
||||
|
||||
// Ensure these get set consistently regardless of what module includes it
|
||||
#include "hsCompilerSpecific.h"
|
||||
|
||||
#if (defined(_DEBUG) || defined(UNIX_DEBUG))
|
||||
# define HS_DEBUGGING
|
||||
#endif // defined(_DEBUG) || defined(UNIX_DENUG)
|
||||
@ -138,6 +141,15 @@ typedef uint32_t hsGSeedValue;
|
||||
|
||||
#define hsFourByteTag(a, b, c, d) (((uint32_t)(a) << 24) | ((uint32_t)(b) << 16) | ((uint32_t)(c) << 8) | (d))
|
||||
|
||||
#if defined(HAVE_CXX14_DEPRECATED_ATTR)
|
||||
# define hsDeprecated(message) [[deprecated(message)]]
|
||||
#elif defined(HAVE_GCC_DEPRECATED_ATTR)
|
||||
# define hsDeprecated(message) __attribute__((deprecated(message)))
|
||||
#elif defined(HAVE_MSVC_DEPRECATED_ATTR)
|
||||
# define hsDeprecated(message) __declspec(deprecated(message))
|
||||
#else
|
||||
# define hsDeprecated(message)
|
||||
#endif
|
||||
|
||||
//======================================
|
||||
// Endian swap funcitions
|
||||
|
@ -40,6 +40,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsCompilerSpecific.h"
|
||||
|
||||
#if defined(HAVE_CPUID)
|
||||
# if defined(_MSC_VER) || ((defined(_WIN32) || defined(_WIN64)) && defined(__INTEL_COMPILER))
|
||||
# include <intrin.h>
|
||||
|
@ -43,12 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#ifndef plString_Defined
|
||||
#define plString_Defined
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cctype>
|
||||
#include "HeadSpin.h"
|
||||
#include <vector>
|
||||
|
||||
/** Single Unicode character code unit */
|
||||
@ -409,12 +404,14 @@ public:
|
||||
double ToDouble() const;
|
||||
|
||||
/** Construct a plString using a printf-like format string. */
|
||||
hsDeprecated("plString::Format is deprecated -- use plFormat instead")
|
||||
static plString Format(const char *fmt, ...);
|
||||
|
||||
/** Construct a plString using a printf-like format string.
|
||||
* This function should be called inside of vararg functions, such as
|
||||
* plString::Format().
|
||||
*/
|
||||
hsDeprecated("plString::IFormat is deprecated -- use plFormat instead")
|
||||
static plString IFormat(const char *fmt, va_list vptr);
|
||||
|
||||
enum CaseSensitivity {
|
||||
|
Reference in New Issue
Block a user