- Main Page
- Classes
- Files

# 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 |   standard C++ runtime
    00064 +---------------------------------------------------------------------*/
    00065 #define APT_CONFIG_HAVE_NEW_H
    00066
    00067 /*----------------------------------------------------------------------
    00068 |   platform specifics
    00069 +---------------------------------------------------------------------*/
    00070
    00071 /* Microsoft Platforms */
    00072 #if defined(_MSC_VER)
    00073 #define AP4_CONFIG_INT64_TYPE __int64
    00074 #if (_MSC_VER >= 1400) && !defined(_WIN32_WCE)
    00075 #define AP4_CONFIG_HAVE_FOPEN_S
    00076 #define AP4_snprintf(s,c,f,...) _snprintf_s(s,c,_TRUNCATE,f,__VA_ARGS__)
    00077 #define AP4_vsnprintf(s,c,f,a)  _vsnprintf_s(s,c,_TRUNCATE,f,a)
    00078 #define fileno _fileno
    00079 #define AP4_fseek _fseeki64
    00080 #define AP4_ftell _ftelli64
    00081 #else
    00082 #define AP4_snprintf   _snprintf
    00083 #define AP4_vsnprintf  _vsnprintf
    00084 #endif
    00085 #if defined(_WIN32_WCE)
    00086 #define AP4_fseek fseek
    00087 #define AP4_ftell ftell
    00088 #endif
    00089 #if defined(_DEBUG)
    00090 #define _CRTDBG_MAP_ALLOC
    00091 #endif
    00092 #endif
    00093
    00094 /* Cygwin */
    00095 #if defined(__CYGWIN__)
    00096 #define AP4_fseek fseek
    00097 #define AP4_ftell ftell
    00098 #endif
    00099
    00100 /* Symbian */
    00101 #if defined(__SYMBIAN32__)
    00102 #undef APT_CONFIG_HAVE_NEW_H
    00103 #include "e32std.h"
    00108 #define AP4_PLATFORM_BYTE_ORDER AP4_PLATFORM_BYTE_ORDER_LITTLE_ENDIAN
    00109 #define AP4_fseek fseek
    00110 #define AP4_ftell ftell
    00111 #define explicit
    00112 #endif
    00113
    00114 /*----------------------------------------------------------------------
    00115 |    defaults
    00116 +---------------------------------------------------------------------*/
    00117 #if !defined(AP4_CONFIG_INT64_TYPE)
    00118 #define AP4_CONFIG_INT64_TYPE long long
    00119 #endif
    00120
    00121 #if !defined(AP4_fseek)
    00122 #define AP4_fseek fseeko
    00123 #endif
    00124 #if !defined(AP4_ftell)
    00125 #define AP4_ftell ftello
    00126 #endif
    00127
    00128 /* some compilers (ex: MSVC 8) deprecate those, so we rename them */
    00129 #if !defined(AP4_snprintf)
    00130 #define AP4_snprintf snprintf
    00131 #endif
    00132 #if !defined(AP4_vsnprintf)
    00133 #define AP4_vsnprintf vsnprintf
    00134 #endif
    00135
    00136 #endif // _AP4_CONFIG_H_