diff options
author | Chong Zhang <chz@google.com> | 2019-06-27 14:28:37 -0700 |
---|---|---|
committer | Chong Zhang <chz@google.com> | 2019-06-27 16:38:44 -0700 |
commit | ab123ac62c872f89e20f10c96e651ead21414ffc (patch) | |
tree | 61f45a95ef42e952ec121583ed73b8649e058bc1 /files/include/libyuv/basic_types.h | |
parent | ad97fd58c110036d9dfcdce8bf98282e92707a89 (diff) | |
download | libyuv-ab123ac62c872f89e20f10c96e651ead21414ffc.tar.gz |
libyuv roll to r1722 to pick up a few methods
that we've been manually cherry-picking.
bug: 132357297
test: MediaMetadataRetriever test; manual testing
thumbnails in Photos.
Exempt-From-Owner-Approval:
files/infra/config/OWNERS owner names are not in android
gerrit, CL fail to push with these. Delete of file need
to bypass owner.
Change-Id: Ic22346e45671452429716be8b0a1999eeaea0d7b
Diffstat (limited to 'files/include/libyuv/basic_types.h')
-rw-r--r-- | files/include/libyuv/basic_types.h | 101 |
1 files changed, 26 insertions, 75 deletions
diff --git a/files/include/libyuv/basic_types.h b/files/include/libyuv/basic_types.h index 7d98bb93..1bea67f2 100644 --- a/files/include/libyuv/basic_types.h +++ b/files/include/libyuv/basic_types.h @@ -11,79 +11,36 @@ #ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_ #define INCLUDE_LIBYUV_BASIC_TYPES_H_ -#include <stddef.h> // for NULL, size_t +#include <stddef.h> // For size_t and NULL + +#if !defined(INT_TYPES_DEFINED) && !defined(GG_LONGLONG) +#define INT_TYPES_DEFINED #if defined(_MSC_VER) && (_MSC_VER < 1600) #include <sys/types.h> // for uintptr_t on x86 +typedef unsigned __int64 uint64_t; +typedef __int64 int64_t; +typedef unsigned int uint32_t; +typedef int int32_t; +typedef unsigned short uint16_t; +typedef short int16_t; +typedef unsigned char uint8_t; +typedef signed char int8_t; #else -#include <stdint.h> // for uintptr_t -#endif - -#ifndef GG_LONGLONG -#ifndef INT_TYPES_DEFINED -#define INT_TYPES_DEFINED -#ifdef COMPILER_MSVC -typedef unsigned __int64 uint64; -typedef __int64 int64; -#ifndef INT64_C -#define INT64_C(x) x##I64 -#endif -#ifndef UINT64_C -#define UINT64_C(x) x##UI64 -#endif -#define INT64_F "I64" -#else // COMPILER_MSVC -#if defined(__LP64__) && !defined(__OpenBSD__) && !defined(__APPLE__) -typedef unsigned long uint64; // NOLINT -typedef long int64; // NOLINT -#ifndef INT64_C -#define INT64_C(x) x##L -#endif -#ifndef UINT64_C -#define UINT64_C(x) x##UL -#endif -#define INT64_F "l" -#else // defined(__LP64__) && !defined(__OpenBSD__) && !defined(__APPLE__) -typedef unsigned long long uint64; // NOLINT -typedef long long int64; // NOLINT -#ifndef INT64_C -#define INT64_C(x) x##LL -#endif -#ifndef UINT64_C -#define UINT64_C(x) x##ULL -#endif -#define INT64_F "ll" -#endif // __LP64__ -#endif // COMPILER_MSVC -typedef unsigned int uint32; -typedef int int32; -typedef unsigned short uint16; // NOLINT -typedef short int16; // NOLINT -typedef unsigned char uint8; -typedef signed char int8; +#include <stdint.h> // for uintptr_t and C99 types +#endif // defined(_MSC_VER) && (_MSC_VER < 1600) +// Types are deprecated. Enable this macro for legacy types. +#ifdef LIBYUV_LEGACY_TYPES +typedef uint64_t uint64; +typedef int64_t int64; +typedef uint32_t uint32; +typedef int32_t int32; +typedef uint16_t uint16; +typedef int16_t int16; +typedef uint8_t uint8; +typedef int8_t int8; +#endif // LIBYUV_LEGACY_TYPES #endif // INT_TYPES_DEFINED -#endif // GG_LONGLONG - -// Detect compiler is for x86 or x64. -#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \ - defined(_M_IX86) -#define CPU_X86 1 -#endif -// Detect compiler is for ARM. -#if defined(__arm__) || defined(_M_ARM) -#define CPU_ARM 1 -#endif - -#ifndef ALIGNP -#ifdef __cplusplus -#define ALIGNP(p, t) \ - reinterpret_cast<uint8*>( \ - ((reinterpret_cast<uintptr_t>(p) + ((t)-1)) & ~((t)-1))) -#else -#define ALIGNP(p, t) \ - (uint8*)((((uintptr_t)(p) + ((t)-1)) & ~((t)-1))) /* NOLINT */ -#endif -#endif #if !defined(LIBYUV_API) #if defined(_WIN32) || defined(__CYGWIN__) @@ -103,15 +60,9 @@ typedef signed char int8; #endif // __GNUC__ #endif // LIBYUV_API +// TODO(fbarchard): Remove bool macros. #define LIBYUV_BOOL int #define LIBYUV_FALSE 0 #define LIBYUV_TRUE 1 -// Visual C x86 or GCC little endian. -#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \ - defined(_M_IX86) || defined(__arm__) || defined(_M_ARM) || \ - (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) -#define LIBYUV_LITTLE_ENDIAN -#endif - #endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ |