12 #if defined(__x86_64__) || defined(__powerpc64__) || defined(__powerpc64__) || defined(_WIN64) || \ 13 defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || \ 14 defined(__s390x__) || defined(__arm64) || defined(__aarch64__) || defined(__amd64__) || \ 15 defined(_M_AMD64) || defined(_M_X64) 22 #if !defined(YI_DEBUG) && !defined(_DEBUG) && !defined(DEBUG) && !defined(NDEBUG) 23 #error None of the expected debugging (or release) macros can be found. YI_DEBUG must be defined for debug builds, and NDEBUG must be defined for release builds. 25 #if defined(YI_DEBUG) || defined(_DEBUG) || defined(DEBUG) 26 #if !defined(YI_DEBUG) 36 #if defined(YI_DEBUG) && defined(NDEBUG) 37 #error YI_DEBUG and NDEBUG cannot both be defined at the same time. 40 #include <framework/YiPredefPlatform.h> 44 #if !defined(YI_DISABLE_SECURITY) 45 #define strcat(dst, src) YI_ERROR("strcat: Does not check for buffer overflows when concatenating to destination (CWE-120). Consider using YI_STRNCAT, strcat_s, or strlcat (warning, YI_STRNCAT is easily misused).") 46 #define strcpy(dst, src) YI_ERROR("strcpy: Does not check for buffer overflows when copying to destination (CWE-120). Consider using YI_STRNCPY, strcpy_s, or strlcpy (warning, YI_STRNCAT is easily misused).") 47 #define sprintf(str, fmt, ...) YI_ERROR("sprintf: Does not check for buffer overflows (CWE-120). Use YI_SNPRINTF, YI_VSNPRINTF, or sprintf_s.") 48 #define gets(str) YI_ERROR("gets: Does not check for buffer overflows (CWE-120, CWE-20). Use fgets() instead.") 49 #define wcscpy(dst, src) YI_ERROR("wcscpy: Does not check for buffer overflows when copying to destination (CWE-120). Consider using a function version that stops copying at the end of the buffer.") 50 #define wcscat(dst, src) YI_ERROR("wcscat: Does not check for buffer overflows when concatenating to destination (CWE-120).") 51 #define swprintf(str, fmt, ...) YI_ERROR("swprintf: Does not check for buffer overflows (CWE-120). Use YI_SNPRINTF, YI_VSNPRINTF, or sprintf_s.") 56 #define YI_DISABLE_URL_SECURITY 61 #define YI_WTEXT(quote) (const wchar_t *)L##quote 62 #define YI_TEXT(quote) (const char *)quote 63 #define YI_TEXT16(quote) (const char16_t *)L##quote 64 #define YI_TEXT32(quote) (const char32_t *)L##quote 70 #define YI_INLINE __inline 71 #define YI_EXTERNINLINE extern __inline 74 #define YI_EXTERNINLINE 79 #define YI_MAX_PATH 260 80 #define YI_MAX_BUFFER 1024 82 #define YI_MIN(a, b) (((a) < (b)) ? (a) : (b)) 83 #define YI_MAX(a, b) (((a) < (b)) ? (b) : (a)) 84 #define YI_FLOAT_EQUAL(a, b) ((a) >= ((b) - FLT_EPSILON) && (a) <= ((b) + FLT_EPSILON)) 85 #define YI_UNUSED(param) (void)(param) 89 #define YI_UNUSED_ATTRIBUTE 91 #define YI_UNUSED_ATTRIBUTE __attribute__((unused)) 94 #if defined(__clang__) || defined(__GNUC__) 95 #define YI_FORCE_INLINE __attribute__((always_inline)) inline 96 #elif defined(_MSC_VER) 97 #define YI_FORCE_INLINE __forceinline 99 #define YI_FORCE_INLINE inline 103 #if defined(_MSC_VER) 104 # if _MSC_VER != 1800 // there's a bug in vs2013 that prevents template specializations from working in some cases (e.g. when used with YiEnableIf) 105 # define YI_FUNCTION_SPECIALIZATION_FULLY_SUPPORTED 108 # define YI_FUNCTION_SPECIALIZATION_FULLY_SUPPORTED 114 #define YI_DISALLOW_COPY_AND_ASSIGN(TypeName) \ 115 TypeName(const TypeName &) = delete; \ 116 TypeName &operator=(const TypeName &) = delete; 121 #define YI_DEFAULT_MOVE_AND_COPY(TypeName) \ 122 TypeName &operator=(const TypeName &) = default; \ 123 TypeName &operator=(TypeName &&) = default; \ 124 TypeName(const TypeName &) = default; \ 125 TypeName(TypeName &&) = default; 130 #define YI_DEFAULT_MOVE_NO_COPY(TypeName) \ 131 TypeName &operator=(const TypeName &) = delete; \ 132 TypeName &operator=(TypeName &&) = default; \ 133 TypeName(const TypeName &) = delete; \ 134 TypeName(TypeName &&) = default; 139 #define YI_DEFAULT_MOVE(TypeName) \ 140 TypeName &operator=(TypeName &&) = default; \ 141 TypeName(TypeName &&) = default; 146 #define YI_DEFAULT_COPY(TypeName) \ 147 TypeName &operator=(const TypeName &) = default; \ 148 TypeName(const TypeName &) = default; 150 #if !defined(DOXY) && defined(YI_WIN32) 151 #define YI_REMOVE_CONSTANT_CONDITION(x) \ 152 __pragma(warning(push)) \ 153 __pragma(warning(disable:4127)) \ 154 do { x } while ((void)0, 0) \ 155 __pragma(warning(pop)) 166 #define YI_REMOVE_CONSTANT_CONDITION(x) do { x } while ((void)0, 0) 192 if(nLeft < other.
nLeft)
196 else if(nLeft == other.
nLeft)
198 if(nTop < other.
nTop)
202 else if(nTop == other.
nTop)
208 else if(nRight == other.
nRight)
231 return !(rLHS == rRHS);
239 YI_RECT_REL(int32_t x, int32_t y, int32_t width, int32_t height) :
246 void Set(int32_t x, int32_t y, int32_t width, int32_t height)
262 return (rLHS.
nX == rRHS.
nX ) &&
263 (rLHS.
nY == rRHS.
nY ) &&
270 return !(rLHS == rRHS);
339 return !(rLHS == rRHS);
354 void Set(
float x,
float y,
float width,
float height)
378 return !(rLHS == rRHS);
396 #if defined(__BIG_ENDIAN__) 397 #define YI_LITTLE_ENDIAN_16(a) (((a & 0xff) << 8) | ((a & 0xff00) >> 8)) 398 #define YI_LITTLE_ENDIAN_24(a) (((a >> 16) & 0xff) | (a & 0xff00)| ((a&0xff)<<16)) 399 #define YI_LITTLE_ENDIAN_32(a) (((a >> 24) & 0xff) | ((a >> 8) & 0xff00) | ((a & 0xff00) << 8) | ((a & 0xff) << 24)) 401 #define YI_LITTLE_ENDIAN_64(a) (((a >> 56) & 0xff) | ((a >> 40) & 0xff00) | ((a >> 24) & 0xff0000) | ((a >> 8) & 0xff000000) | \ 402 ((a << 8) & DECL_U64(0xff00000000)) | ((a << 24) & DECL_U64(0xff0000000000)) | \ 403 ((a << 40) & DECL_U64(0xff000000000000)) | ((a << 56) & DECL_U64(0xff00000000000000))) 405 #define YI_LITTLE_ENDIAN_64(a) (((a >> 56) & 0xff) | ((a >> 40) & 0xff00) | ((a >> 24) & 0xff0000) | ((a >> 8) & 0xff000000) | \ 406 ((a << 8) & 0xff00000000LLU) | ((a << 24) & 0xff0000000000LLU) | \ 407 ((a << 40) & 0xff000000000000LLU) | ((a << 56) & 0xff00000000000000LLU)) 410 #define YI_LITTLE_ENDIAN_16(a) (a) 411 #define YI_LITTLE_ENDIAN_24(a) (a) 412 #define YI_LITTLE_ENDIAN_32(a) (a) 413 #define YI_LITTLE_ENDIAN_64(a) (a) 422 #endif // _YI_PREDEF_H_ YI_FLOAT_RECT_REL(float x, float y, float width, float height)
Definition: YiPredef.h:347
Definition: YiPredef.h:392
float fX
Definition: YiPredef.h:362
bool operator>=(const YI_FLOAT_RECT &lhs, const YI_FLOAT_RECT &rhs)
Definition: YiPredef.h:324
int32_t nHeight
Definition: YiPredef.h:257
YI_FLOAT_RECT_REL()
Definition: YiPredef.h:344
int32_t nBottom
Definition: YiPredef.h:188
Definition: YiPredef.h:234
float fWidth
Definition: YiPredef.h:364
void Set(float x, float y, float width, float height)
Definition: YiPredef.h:354
int32_t nTop
Definition: YiPredef.h:186
Definition: YiPredef.h:183
bool operator==(const YI_RECT &rLHS, const YI_RECT &rRHS)
Definition: YiPredef.h:221
float fRight
Definition: YiPredef.h:277
Definition: YiPredef.h:390
float fBottom
Definition: YiPredef.h:278
float fX
Definition: YiPredef.h:179
Definition: YiPredef.h:387
bool operator<(const YI_FLOAT_RECT &lhs, const YI_FLOAT_RECT &rhs)
Definition: YiPredef.h:282
Definition: YiPredef.h:273
float fLeft
Definition: YiPredef.h:275
Definition: YiPredef.h:388
Definition: YiPredef.h:386
YI_RECT_REL(int32_t x, int32_t y, int32_t width, int32_t height)
Definition: YiPredef.h:239
YI_BUFFER_REORENT
Definition: YiPredef.h:384
int32_t nY
Definition: YiPredef.h:174
bool operator!=(const YI_RECT &rLHS, const YI_RECT &rRHS)
Definition: YiPredef.h:229
float fY
Definition: YiPredef.h:180
float fHeight
Definition: YiPredef.h:365
int32_t nRight
Definition: YiPredef.h:187
Definition: YiPredef.h:171
float fTop
Definition: YiPredef.h:276
int32_t nY
Definition: YiPredef.h:255
bool operator<(YI_RECT const &other) const
Definition: YiPredef.h:190
Definition: YiPredef.h:342
int32_t nX
Definition: YiPredef.h:173
void Set(int32_t x, int32_t y, int32_t width, int32_t height)
Definition: YiPredef.h:246
YI_RECT_REL()
Definition: YiPredef.h:236
int32_t nWidth
Definition: YiPredef.h:256
int32_t nLeft
Definition: YiPredef.h:185
Definition: YiPredef.h:177
bool operator<=(const YI_FLOAT_RECT &lhs, const YI_FLOAT_RECT &rhs)
Definition: YiPredef.h:319
bool operator>(const YI_FLOAT_RECT &lhs, const YI_FLOAT_RECT &rhs)
Definition: YiPredef.h:314
Definition: YiPredef.h:389
float fY
Definition: YiPredef.h:363
#define YI_FLOAT_EQUAL(a, b)
Definition: YiPredef.h:84
int32_t nX
Definition: YiPredef.h:254
Definition: YiPredef.h:391