Ap4Config.h

Go to the documentation of this file.
00001 /*****************************************************************
00002 |
00003 |    AP4 - Target Platform and Compiler Configuration
00004 |
00005 |    Copyright 2002-2006 Gilles Boccon-Gibod
00006 |
00007 |
00008 |    This file is part of Bento4/AP4 (MP4 Atom Processing Library).
00009 |
00010 |    Unless you have obtained Bento4 under a difference license,
00011 |    this version of Bento4 is Bento4|GPL.
00012 |    Bento4|GPL is free software; you can redistribute it and/or modify
00013 |    it under the terms of the GNU General Public License as published by
00014 |    the Free Software Foundation; either version 2, or (at your option)
00015 |    any later version.
00016 |
00017 |    Bento4|GPL is distributed in the hope that it will be useful,
00018 |    but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 |    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 |    GNU General Public License for more details.
00021 |
00022 |    You should have received a copy of the GNU General Public License
00023 |    along with Bento4|GPL; see the file COPYING.  If not, write to the
00024 |    Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
00025 |    02111-1307, USA.
00026 |
00027  ****************************************************************/
00032 #ifndef _AP4_CONFIG_H_
00033 #define _AP4_CONFIG_H_
00034 
00035 /*----------------------------------------------------------------------
00036 |   defaults
00037 +---------------------------------------------------------------------*/
00038 #define AP4_CONFIG_HAVE_STDIO_H
00039 #define AP4_CONFIG_HAVE_ASSERT_H
00040 #define AP4_CONFIG_HAVE_STRING_H
00041 
00042 #define AP4_CONFIG_HAVE_SNPRINTF
00043 #define AP4_CONFIG_HAVE_VSNPRINTF
00044 
00045 #define AP4_CONFIG_HAVE_INT64
00046 
00047 /*----------------------------------------------------------------------
00048 |   byte order
00049 +---------------------------------------------------------------------*/
00050 // define AP4_PLATFORM_BYTE_ORDER to one of these two choices
00051 #define AP4_PLATFORM_BYTE_ORDER_BIG_ENDIAN    0
00052 #define AP4_PLATFORM_BYTE_ORDER_LITTLE_ENDIAN 1
00053 
00054 #if !defined(AP4_PLATFORM_BYTE_ORDER)
00055 #if defined(__ppc__)
00056 #define AP4_PLATFORM_BYTE_ORDER AP4_PLATFORM_BYTE_ORDER_BIG_ENDIAN
00057 #elif defined(__i386__)
00058 #define AP4_PLATFORM_BYTE_ORDER AP4_PLATFORM_BYTE_ORDER_LITTLE_ENDIAN
00059 #endif
00060 #endif
00061 
00062 /*----------------------------------------------------------------------
00063 |   platform specifics
00064 +---------------------------------------------------------------------*/
00065 
00066 /* Microsoft Platforms */
00067 #if defined(_MSC_VER)
00068 #define AP4_CONFIG_INT64_TYPE __int64
00069 #if (_MSC_VER >= 1400) && !defined(_WIN32_WCE)
00070 #define AP4_CONFIG_HAVE_FOPEN_S
00071 #define AP4_snprintf(s,c,f,...) _snprintf_s(s,c,_TRUNCATE,f,__VA_ARGS__)
00072 #define AP4_vsnprintf(s,c,f,a)  _vsnprintf_s(s,c,_TRUNCATE,f,a)
00073 #define fileno _fileno
00074 #define AP4_fseek _fseeki64
00075 #define AP4_ftell _ftelli64
00076 #else
00077 #define AP4_snprintf   _snprintf
00078 #define AP4_vsnprintf  _vsnprintf
00079 #endif
00080 #if defined(_WIN32_WCE)
00081 #define AP4_fseek fseek
00082 #define AP4_ftell ftell
00083 #endif
00084 #if defined(_DEBUG)
00085 #define _CRTDBG_MAP_ALLOC
00086 #endif
00087 #endif
00088 
00089 /* Cygwin */
00090 #if defined(__CYGWIN__)
00091 #define AP4_fseek fseek
00092 #define AP4_ftell ftell
00093 #endif
00094 
00095 /*----------------------------------------------------------------------
00096 |    defaults
00097 +---------------------------------------------------------------------*/
00098 #if !defined(AP4_CONFIG_INT64_TYPE)
00099 #define AP4_CONFIG_INT64_TYPE long long
00100 #endif
00101 
00102 #if !defined(AP4_fseek)
00103 #define AP4_fseek fseeko
00104 #endif
00105 #if !defined(AP4_ftell)
00106 #define AP4_ftell ftello
00107 #endif
00108 
00109 /* some compilers (ex: MSVC 8) deprecate those, so we rename them */
00110 #if !defined(AP4_snprintf)
00111 #define AP4_snprintf snprintf
00112 #endif
00113 #if !defined(AP4_vsnprintf)
00114 #define AP4_vsnprintf vsnprintf
00115 #endif
00116 
00117 #endif // _AP4_CONFIG_H_

Generated on Thu Mar 15 16:06:10 2007 for Bento4 MP4 SDK by  doxygen 1.5.1-p1