diff options
author | Shri Borde <shri@google.com> | 2011-11-02 13:20:24 -0700 |
---|---|---|
committer | Shri Borde <shri@google.com> | 2011-11-02 13:20:24 -0700 |
commit | 7cd8149e2cbad8b1ff6d481c37a4775d3c8cf2fa (patch) | |
tree | b33940212e8eae6d9df454f5461279da919629cf /files/include/libyuv/basic_types.h | |
parent | 2398a6ec900d592b1433dc24eeeecf442794eb10 (diff) | |
download | libyuv-7cd8149e2cbad8b1ff6d481c37a4775d3c8cf2fa.tar.gz |
Initial population of libyuv
Change-Id: I46a6a1525aebaba979b0f2ca5b58be2004901410
Diffstat (limited to 'files/include/libyuv/basic_types.h')
-rw-r--r-- | files/include/libyuv/basic_types.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/files/include/libyuv/basic_types.h b/files/include/libyuv/basic_types.h new file mode 100644 index 00000000..5adc2bfd --- /dev/null +++ b/files/include/libyuv/basic_types.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2011 The LibYuv project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_ +#define INCLUDE_LIBYUV_BASIC_TYPES_H_ + +#include <stddef.h> // for NULL, size_t + +#ifndef WIN32 +#include <stdint.h> // for uintptr_t +#endif + +#ifndef INT_TYPES_DEFINED +#define INT_TYPES_DEFINED +#ifdef COMPILER_MSVC +typedef __int64 int64; +#else +typedef long long int64; +#endif /* COMPILER_MSVC */ +typedef int int32; +typedef short int16; +typedef char int8; + +#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 +typedef unsigned long long uint64; +typedef long long int64; +#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 /* COMPILER_MSVC */ +typedef unsigned int uint32; +typedef unsigned short uint16; +typedef unsigned char uint8; +#endif // INT_TYPES_DEFINED + +// Detect compiler is for x86 or x64. +#if defined(__x86_64__) || defined(_M_X64) || \ + defined(__i386__) || defined(_M_IX86) +#define CPU_X86 1 +#endif + +#define IS_ALIGNED(p, a) (0==(reinterpret_cast<uintptr_t>(p) & ((a)-1))) +#define ALIGNP(p, t) \ + (reinterpret_cast<uint8*>(((reinterpret_cast<uintptr_t>(p) + \ + ((t)-1)) & ~((t)-1)))) + +#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ |