CELT 0.11.1
libcelt/celt_types.h
Go to the documentation of this file.
00001 /* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */
00002 /* Modified by Jean-Marc Valin */
00003 /*
00004    Redistribution and use in source and binary forms, with or without
00005    modification, are permitted provided that the following conditions
00006    are met:
00007 
00008    - Redistributions of source code must retain the above copyright
00009    notice, this list of conditions and the following disclaimer.
00010 
00011    - Redistributions in binary form must reproduce the above copyright
00012    notice, this list of conditions and the following disclaimer in the
00013    documentation and/or other materials provided with the distribution.
00014 
00015    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00016    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00017    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00018    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
00019    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00020    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00021    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00022    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00023    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00024    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00025    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 */
00027 /* celt_types.h taken from libogg */
00028 
00033 #ifndef _CELT_TYPES_H
00034 #define _CELT_TYPES_H
00035 
00036 /* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */
00037 #if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
00038 #include <stdint.h>
00039 
00040    typedef int16_t celt_int16;
00041    typedef uint16_t celt_uint16;
00042    typedef int32_t celt_int32;
00043    typedef uint32_t celt_uint32;
00044 #elif defined(_WIN32) 
00045 
00046 #  if defined(__CYGWIN__)
00047 #    include <_G_config.h>
00048      typedef _G_int32_t celt_int32;
00049      typedef _G_uint32_t celt_uint32;
00050      typedef _G_int16 celt_int16;
00051      typedef _G_uint16 celt_uint16;
00052 #  elif defined(__MINGW32__)
00053      typedef short celt_int16;
00054      typedef unsigned short celt_uint16;
00055      typedef int celt_int32;
00056      typedef unsigned int celt_uint32;
00057 #  elif defined(__MWERKS__)
00058      typedef int celt_int32;
00059      typedef unsigned int celt_uint32;
00060      typedef short celt_int16;
00061      typedef unsigned short celt_uint16;
00062 #  else
00063      /* MSVC/Borland */
00064      typedef __int32 celt_int32;
00065      typedef unsigned __int32 celt_uint32;
00066      typedef __int16 celt_int16;
00067      typedef unsigned __int16 celt_uint16;
00068 #  endif
00069 
00070 #elif defined(__MACOS__)
00071 
00072 #  include <sys/types.h>
00073    typedef SInt16 celt_int16;
00074    typedef UInt16 celt_uint16;
00075    typedef SInt32 celt_int32;
00076    typedef UInt32 celt_uint32;
00077 
00078 #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
00079 
00080 #  include <sys/types.h>
00081    typedef int16_t celt_int16;
00082    typedef u_int16_t celt_uint16;
00083    typedef int32_t celt_int32;
00084    typedef u_int32_t celt_uint32;
00085 
00086 #elif defined(__BEOS__)
00087 
00088    /* Be */
00089 #  include <inttypes.h>
00090    typedef int16 celt_int16;
00091    typedef u_int16 celt_uint16;
00092    typedef int32_t celt_int32;
00093    typedef u_int32_t celt_uint32;
00094 
00095 #elif defined (__EMX__)
00096 
00097    /* OS/2 GCC */
00098    typedef short celt_int16;
00099    typedef unsigned short celt_uint16;
00100    typedef int celt_int32;
00101    typedef unsigned int celt_uint32;
00102 
00103 #elif defined (DJGPP)
00104 
00105    /* DJGPP */
00106    typedef short celt_int16;
00107    typedef unsigned short celt_uint16;
00108    typedef int celt_int32;
00109    typedef unsigned int celt_uint32;
00110 
00111 #elif defined(R5900)
00112 
00113    /* PS2 EE */
00114    typedef int celt_int32;
00115    typedef unsigned celt_uint32;
00116    typedef short celt_int16;
00117    typedef unsigned short celt_uint16;
00118 
00119 #elif defined(__SYMBIAN32__)
00120 
00121    /* Symbian GCC */
00122    typedef signed short celt_int16;
00123    typedef unsigned short celt_uint16;
00124    typedef signed int celt_int32;
00125    typedef unsigned int celt_uint32;
00126 
00127 #elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
00128 
00129    typedef short celt_int16;
00130    typedef unsigned short celt_uint16;
00131    typedef long celt_int32;
00132    typedef unsigned long celt_uint32;
00133 
00134 #elif defined(CONFIG_TI_C6X)
00135 
00136    typedef short celt_int16;
00137    typedef unsigned short celt_uint16;
00138    typedef int celt_int32;
00139    typedef unsigned int celt_uint32;
00140 
00141 #else
00142 
00143    /* Give up, take a reasonable guess */
00144    typedef short celt_int16;
00145    typedef unsigned short celt_uint16;
00146    typedef int celt_int32;
00147    typedef unsigned int celt_uint32;
00148 
00149 #endif
00150 
00151 #endif  /* _CELT_TYPES_H */