1 /* 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_ 12 #define INCLUDE_LIBYUV_BASIC_TYPES_H_ 13 14 #include <stddef.h> // For size_t and NULL 15 16 #if !defined(INT_TYPES_DEFINED) && !defined(GG_LONGLONG) 17 #define INT_TYPES_DEFINED 18 19 #if defined(_MSC_VER) && (_MSC_VER < 1600) 20 #include <sys/types.h> // for uintptr_t on x86 21 typedef unsigned __int64 uint64_t; 22 typedef __int64 int64_t; 23 typedef unsigned int uint32_t; 24 typedef int int32_t; 25 typedef unsigned short uint16_t; 26 typedef short int16_t; 27 typedef unsigned char uint8_t; 28 typedef signed char int8_t; 29 #else 30 #include <stdint.h> // for uintptr_t and C99 types 31 #endif // defined(_MSC_VER) && (_MSC_VER < 1600) 32 // Types are deprecated. Enable this macro for legacy types. 33 #ifdef LIBYUV_LEGACY_TYPES 34 typedef uint64_t uint64; 35 typedef int64_t int64; 36 typedef uint32_t uint32; 37 typedef int32_t int32; 38 typedef uint16_t uint16; 39 typedef int16_t int16; 40 typedef uint8_t uint8; 41 typedef int8_t int8; 42 #endif // LIBYUV_LEGACY_TYPES 43 #endif // INT_TYPES_DEFINED 44 45 #if !defined(LIBYUV_API) 46 #if defined(_WIN32) || defined(__CYGWIN__) 47 #if defined(LIBYUV_BUILDING_SHARED_LIBRARY) 48 #define LIBYUV_API __declspec(dllexport) 49 #elif defined(LIBYUV_USING_SHARED_LIBRARY) 50 #define LIBYUV_API __declspec(dllimport) 51 #else 52 #define LIBYUV_API 53 #endif // LIBYUV_BUILDING_SHARED_LIBRARY 54 #elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__APPLE__) && \ 55 (defined(LIBYUV_BUILDING_SHARED_LIBRARY) || \ 56 defined(LIBYUV_USING_SHARED_LIBRARY)) 57 #define LIBYUV_API __attribute__((visibility("default"))) 58 #else 59 #define LIBYUV_API 60 #endif // __GNUC__ 61 #endif // LIBYUV_API 62 63 // TODO(fbarchard): Remove bool macros. 64 #define LIBYUV_BOOL int 65 #define LIBYUV_FALSE 0 66 #define LIBYUV_TRUE 1 67 68 #endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ 69