Home | History | Annotate | Download | only in vpx
      1 /*
      2  *  Copyright (c) 2010 The WebM 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 VPX_VPX_INTEGER_H_
     12 #define VPX_VPX_INTEGER_H_
     13 
     14 /* get ptrdiff_t, size_t, wchar_t, NULL */
     15 #include <stddef.h>
     16 
     17 #if defined(_MSC_VER)
     18 #define VPX_FORCE_INLINE __forceinline
     19 #define VPX_INLINE __inline
     20 #else
     21 #define VPX_FORCE_INLINE __inline__ __attribute__(always_inline)
     22 // TODO(jbb): Allow a way to force inline off for older compilers.
     23 #define VPX_INLINE inline
     24 #endif
     25 
     26 #if defined(VPX_EMULATE_INTTYPES)
     27 typedef signed char int8_t;
     28 typedef signed short int16_t;
     29 typedef signed int int32_t;
     30 
     31 typedef unsigned char uint8_t;
     32 typedef unsigned short uint16_t;
     33 typedef unsigned int uint32_t;
     34 
     35 #ifndef _UINTPTR_T_DEFINED
     36 typedef size_t uintptr_t;
     37 #endif
     38 
     39 #else
     40 
     41 /* Most platforms have the C99 standard integer types. */
     42 
     43 #if defined(__cplusplus)
     44 #if !defined(__STDC_FORMAT_MACROS)
     45 #define __STDC_FORMAT_MACROS
     46 #endif
     47 #if !defined(__STDC_LIMIT_MACROS)
     48 #define __STDC_LIMIT_MACROS
     49 #endif
     50 #endif  // __cplusplus
     51 
     52 #include <stdint.h>
     53 
     54 #endif
     55 
     56 /* VS2010 defines stdint.h, but not inttypes.h */
     57 #if defined(_MSC_VER) && _MSC_VER < 1800
     58 #define PRId64 "I64d"
     59 #else
     60 #include <inttypes.h>
     61 #endif
     62 
     63 #endif  // VPX_VPX_INTEGER_H_
     64