diff options
author | Hendrik Dahlkamp <hendrik@google.com> | 2013-01-23 18:27:37 -0800 |
---|---|---|
committer | Adam Hampson <ahampson@google.com> | 2013-01-28 15:39:41 -0800 |
commit | 33cfdeb7b267ab635413797fffb046b73272f7ec (patch) | |
tree | 8ff16b765a83ba911233a1d7bfa27cce9cee3b7c /files/include/libyuv/basic_types.h | |
parent | a88a10a6ed9f9801852929bac34bdf10510116f4 (diff) | |
download | libyuv-33cfdeb7b267ab635413797fffb046b73272f7ec.tar.gz |
Update libyuv to r397
Change-Id: I70f5a527de52ae8ae80b189873c9a094035dfa2c
Signed-off-by: Hendrik Dahlkamp <hendrik@google.com>
Diffstat (limited to 'files/include/libyuv/basic_types.h')
-rw-r--r-- | files/include/libyuv/basic_types.h | 71 |
1 files changed, 50 insertions, 21 deletions
diff --git a/files/include/libyuv/basic_types.h b/files/include/libyuv/basic_types.h index 5adc2bfd..9e9f2abc 100644 --- a/files/include/libyuv/basic_types.h +++ b/files/include/libyuv/basic_types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The LibYuv project authors. All Rights Reserved. + * Copyright 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 @@ -8,27 +8,18 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_ +#ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_ // NOLINT #define INCLUDE_LIBYUV_BASIC_TYPES_H_ #include <stddef.h> // for NULL, size_t -#ifndef WIN32 +#if !(defined(_MSC_VER) && (_MSC_VER < 1600)) #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 @@ -38,9 +29,20 @@ typedef __int64 int64; #define UINT64_C(x) x ## UI64 #endif #define INT64_F "I64" -#else -typedef unsigned long long uint64; -typedef long long int64; +#else // COMPILER_MSVC +#ifdef __LP64__ +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 // __LP64__ +typedef unsigned long long uint64; // NOLINT +typedef long long int64; // NOLINT #ifndef INT64_C #define INT64_C(x) x ## LL #endif @@ -48,10 +50,14 @@ typedef long long int64; #define UINT64_C(x) x ## ULL #endif #define INT64_F "ll" -#endif /* COMPILER_MSVC */ +#endif // __LP64__ +#endif // COMPILER_MSVC typedef unsigned int uint32; -typedef unsigned short uint16; +typedef int int32; +typedef unsigned short uint16; // NOLINT +typedef short int16; // NOLINT typedef unsigned char uint8; +typedef signed char int8; #endif // INT_TYPES_DEFINED // Detect compiler is for x86 or x64. @@ -59,10 +65,33 @@ typedef unsigned char uint8; 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 -#define IS_ALIGNED(p, a) (0==(reinterpret_cast<uintptr_t>(p) & ((a)-1))) +#ifndef ALIGNP #define ALIGNP(p, t) \ - (reinterpret_cast<uint8*>(((reinterpret_cast<uintptr_t>(p) + \ - ((t)-1)) & ~((t)-1)))) + (reinterpret_cast<uint8*>(((reinterpret_cast<uintptr_t>(p) + \ + ((t) - 1)) & ~((t) - 1)))) +#endif + +#if !defined(LIBYUV_API) +#if defined(_WIN32) || defined(__CYGWIN__) +#if defined(LIBYUV_BUILDING_SHARED_LIBRARY) +#define LIBYUV_API __declspec(dllexport) +#elif defined(LIBYUV_USING_SHARED_LIBRARY) +#define LIBYUV_API __declspec(dllimport) +#else +#define LIBYUV_API +#endif // LIBYUV_BUILDING_SHARED_LIBRARY +#elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__APPLE__) && \ + (defined(LIBYUV_BUILDING_SHARED_LIBRARY) || \ + defined(LIBYUV_USING_SHARED_LIBRARY)) +#define LIBYUV_API __attribute__ ((visibility ("default"))) +#else +#define LIBYUV_API +#endif // __GNUC__ +#endif // LIBYUV_API -#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ +#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ NOLINT |