Commit 63c6a5f3 authored by ogg Upstream's avatar ogg Upstream Committed by Shawn Waldon
Browse files

ogg 2018-02-02 (33d970e7)

Code extracted from:

    https://gitlab.kitware.com/third-party/ogg.git

at commit 33d970e786c757105c67da4351adf0c0c00bed1c (for/vtk-old).
parents
* -whitespace
if (FALSE)
cmake_minimum_required(VERSION 2.8.7)
endif ()
project(libogg)
# Required modules
if (FALSE)
include(GNUInstallDirs)
endif ()
include(CheckIncludeFiles)
# Build options
if (FALSE)
option(BUILD_SHARED_LIBS "Build shared library" OFF)
if(APPLE)
option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF)
endif()
else ()
set(BUILD_FRAMEWORK OFF)
endif ()
if (FALSE)
# Extract project version from configure.ac
file(READ configure.ac CONFIGURE_AC_CONTENTS)
string(REGEX MATCH "AC_INIT\\(\\[libogg\\],\\[([0-9]*).([0-9]*).([0-9]*)" DUMMY ${CONFIGURE_AC_CONTENTS})
set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1})
set(PROJECT_VERSION_MINOR ${CMAKE_MATCH_2})
set(PROJECT_VERSION_PATCH ${CMAKE_MATCH_3})
else ()
set(PROJECT_VERSION_MAJOR 1)
set(PROJECT_VERSION_MINOR 3)
set(PROJECT_VERSION_PATCH 3)
endif ()
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
# Helper function to get version-info
function(get_version_info result current_var_name age_var_name revision_var_name)
string(REGEX MATCH "${current_var_name}=([0-9]*)" DUMMY ${CONFIGURE_AC_CONTENTS})
set(VERSION_INFO_CURRENT ${CMAKE_MATCH_1})
string(REGEX MATCH "${age_var_name}=([0-9]*)" DUMMY ${CONFIGURE_AC_CONTENTS})
set(VERSION_INFO_AGE ${CMAKE_MATCH_1})
string(REGEX MATCH "${revision_var_name}=([0-9]*)" DUMMY ${CONFIGURE_AC_CONTENTS})
set(VERSION_INFO_REVISION ${CMAKE_MATCH_1})
math(EXPR VERSION_INFO_CURRENT_MINUS_AGE "${VERSION_INFO_CURRENT} - ${VERSION_INFO_AGE}")
set(${result} "${VERSION_INFO_CURRENT_MINUS_AGE}.${VERSION_INFO_AGE}.${VERSION_INFO_REVISION}" PARENT_SCOPE)
endfunction()
# Helper function to configure pkg-config files
function(configure_pkg_config_file pkg_config_file_in)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_FULL_BINDIR})
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set(VERSION ${PROJECT_VERSION})
string(REPLACE ".in" "" pkg_config_file ${pkg_config_file_in})
configure_file(${pkg_config_file_in} ${CMAKE_CURRENT_BINARY_DIR}/${pkg_config_file} @ONLY)
endfunction()
#message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}")
# Configure config_type.h
check_include_files(inttypes.h INCLUDE_INTTYPES_H)
check_include_files(stdint.h INCLUDE_STDINT_H)
check_include_files(sys/types.h INCLUDE_SYS_TYPES_H)
set(SIZE16 int16_t)
set(USIZE16 uint16_t)
set(SIZE32 int32_t)
set(USIZE32 uint32_t)
set(SIZE64 int64_t)
configure_file(include/ogg/config_types.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/ogg/config_types.h @ONLY)
set(OGG_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/include/ogg/config_types.h
include/ogg/ogg.h
include/ogg/os_types.h
include/ogg/vtk_ogg_mangle.h
"${CMAKE_CURRENT_BINARY_DIR}/include/ogg/vtkogg_export.h"
)
set(OGG_SOURCES
src/bitwise.c
src/framing.c
)
if (FALSE)
if(MSVC)
list(APPEND OGG_SOURCES win32/ogg.def)
endif()
endif ()
if(BUILD_FRAMEWORK)
set(BUILD_SHARED_LIBS TRUE)
endif()
if (FALSE)
include_directories(include ${CMAKE_CURRENT_BINARY_DIR}/include)
add_library(ogg ${OGG_HEADERS} ${OGG_SOURCES})
get_version_info(OGG_VERSION_INFO "LIB_CURRENT" "LIB_AGE" "LIB_REVISION")
set_target_properties(
ogg PROPERTIES
SOVERSION ${OGG_VERSION_INFO}
PUBLIC_HEADER "${OGG_HEADERS}"
)
if(BUILD_FRAMEWORK)
set_target_properties(ogg PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${PROJECT_VERSION}
MACOSX_FRAMEWORK_IDENTIFIER org.xiph.ogg
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PROJECT_VERSION}
MACOSX_FRAMEWORK_BUNDLE_VERSION ${PROJECT_VERSION}
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
OUTPUT_NAME Ogg
)
endif()
configure_pkg_config_file(ogg.pc.in)
install(TARGETS ogg
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ogg
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ogg.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
else ()
vtk_add_library(vtkogg ${OGG_SOURCES} ${OGG_HEADERS})
if (NOT VTK_INSTALL_NO_DEVELOPMENT)
install(FILES
${OGG_HEADERS}
DESTINATION "${VTK_INSTALL_INCLUDE_DIR}/vtkogg/include/ogg"
COMPONENT Development)
endif()
include(GenerateExportHeader)
generate_export_header(vtkogg
EXPORT_MACRO_NAME vtkogg_EXPORT
EXPORT_FILE_NAME include/ogg/vtkogg_export.h)
target_include_directories(vtkogg
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
"$<INSTALL_INTERFACE:${_vtk_build_HEADERS_DESTINATION}/vtkogg/include>")
endif ()
Copyright (c) 2002, Xiph.org Foundation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ogg fork for VTK
This branch contains changes required to embed ogg into VTK. This
includes changes made primarily to the build system to allow it to be embedded
into another source tree as well as a header to facilitate mangling of the
symbols to avoid conflicts with other copies of the library within a single
process.
* Ignore whitespace errors for VTK's commit checks.
* Integrate the CMake build with VTK's module system.
* Mangle all exported symbols to have a `vtkogg_` prefix.
# Ogg
[![Travis Build Status](https://travis-ci.org/xiph/ogg.svg?branch=master)](https://travis-ci.org/xiph/ogg)
[![Jenkins Build Status](https://mf4.xiph.org/jenkins/job/libogg/badge/icon)](https://mf4.xiph.org/jenkins/job/libogg/)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/xiph/ogg?branch=master&svg=true)](https://ci.appveyor.com/project/rillian/ogg)
Ogg project codecs use the Ogg bitstream format to arrange the raw,
compressed bitstream into a more robust, useful form. For example,
the Ogg bitstream makes seeking, time stamping and error recovery
possible, as well as mixing several sepearate, concurrent media
streams into a single physical bitstream.
## What's here ##
This source distribution includes libogg and nothing else. Other modules
(eg, the modules libvorbis, vorbis-tools for the Vorbis music codec,
libtheora for the Theora video codec) contain the codec libraries for
use with Ogg bitstreams.
Directory:
- `src` The source for libogg, a BSD-license inplementation of the public domain Ogg bitstream format
- `include` Library API headers
- `doc` Ogg specification and libogg API documents
- `win32` Win32 projects and build automation
- `macosx` Mac OS X project and build files
## Contact ##
The Ogg homepage is located at https://www.xiph.org/ogg/ .
Up to date technical documents, contact information, source code and
pre-built utilities may be found there.
## Building ##
#### Building from tarball distributions ####
./configure
make
and optionally (as root):
make install
This will install the Ogg libraries (static and shared) into
/usr/local/lib, includes into /usr/local/include and API
documentation into /usr/local/share/doc.
#### Building from repository source ####
A standard svn build should consist of nothing more than:
./autogen.sh
./configure
make
and as root if desired :
make install
#### Building on Windows ####
Use the project file in the win32 directory. It should compile out of the box.
#### Cross-compiling from Linux to Windows ####
It is also possible to cross compile from Linux to windows using the MinGW
cross tools and even to run the test suite under Wine, the Linux/*nix
windows emulator.
On Debian and Ubuntu systems, these cross compiler tools can be installed
by doing:
sudo apt-get mingw32 mingw32-binutils mingw32-runtime wine
Once these tools are installed its possible to compile and test by
executing the following commands, or something similar depending on
your system:
./configure --host=i586-mingw32msvc --target=i586-mingw32msvc --build=i586-linux
make
make check
(Build instructions for Ogg codecs such as vorbis are similar and may
be found in those source modules' README files)
## Building with CMake ##
Ogg supports building using [CMake](http://www.cmake.org/). CMake is a meta build system that generates native projects for each platform.
To generate projects just run cmake replacing `YOUR-PROJECT-GENERATOR` with a proper generator from a list [here](http://www.cmake.org/cmake/help/v3.2/manual/cmake-generators.7.html):
cmake -G YOUR-PROJECT-GENERATOR .
Note that by default cmake generates projects that will build static libraries.
To generate projects that will build dynamic library use `BUILD_SHARED_LIBS` option like this:
cmake -G YOUR-PROJECT-GENERATOR -DBUILD_SHARED_LIBS=1 .
After projects are generated use them as usual
#### Building on Windows ####
Use proper generator for your Visual Studio version like:
cmake -G "Visual Studio 12 2013" .
#### Building on Mac OS X ####
Use Xcode generator. To build framework run:
cmake -G Xcode -DBUILD_FRAMEWORK=1 .
#### Building on Linux ####
Use Makefile generator which is default one.
cmake .
make
## License ##
THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.
USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS
GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE
IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.
THE OggVorbis SOURCE CODE IS COPYRIGHT (C) 1994-2015
by the Xiph.Org Foundation https://www.xiph.org/
#ifndef __CONFIG_TYPES_H__
#define __CONFIG_TYPES_H__
/* these are filled in by configure */
#define INCLUDE_INTTYPES_H @INCLUDE_INTTYPES_H@
#define INCLUDE_STDINT_H @INCLUDE_STDINT_H@
#define INCLUDE_SYS_TYPES_H @INCLUDE_SYS_TYPES_H@
#if INCLUDE_INTTYPES_H
# include <inttypes.h>
#endif
#if INCLUDE_STDINT_H
# include <stdint.h>
#endif
#if INCLUDE_SYS_TYPES_H
# include <sys/types.h>
#endif
typedef @SIZE16@ ogg_int16_t;
typedef @USIZE16@ ogg_uint16_t;
typedef @SIZE32@ ogg_int32_t;
typedef @USIZE32@ ogg_uint32_t;
typedef @SIZE64@ ogg_int64_t;
#endif
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel libogg include
last mod: $Id$
********************************************************************/
#ifndef _OGG_H
#define _OGG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <ogg/vtk_ogg_mangle.h>
#include <ogg/vtkogg_export.h>
#include <stddef.h>
#include <ogg/os_types.h>
typedef struct {
void *iov_base;
size_t iov_len;
} ogg_iovec_t;
typedef struct {
long endbyte;
int endbit;
unsigned char *buffer;
unsigned char *ptr;
long storage;
} oggpack_buffer;
/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/
typedef struct {
unsigned char *header;
long header_len;
unsigned char *body;
long body_len;
} ogg_page;
/* ogg_stream_state contains the current encode/decode state of a logical
Ogg bitstream **********************************************************/
typedef struct {
unsigned char *body_data; /* bytes from packet bodies */
long body_storage; /* storage elements allocated */
long body_fill; /* elements stored; fill mark */
long body_returned; /* elements of fill returned */
int *lacing_vals; /* The values that will go to the segment table */
ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact
this way, but it is simple coupled to the
lacing fifo */
long lacing_storage;
long lacing_fill;
long lacing_packet;
long lacing_returned;
unsigned char header[282]; /* working space for header encode */
int header_fill;
int e_o_s; /* set when we have buffered the last packet in the
logical bitstream */
int b_o_s; /* set after we've written the initial page
of a logical bitstream */
long serialno;
long pageno;
ogg_int64_t packetno; /* sequence number for decode; the framing
knows where there's a hole in the data,
but we need coupling so that the codec
(which is in a separate abstraction
layer) also knows about the gap */
ogg_int64_t granulepos;
} ogg_stream_state;
/* ogg_packet is used to encapsulate the data and metadata belonging
to a single raw Ogg/Vorbis packet *************************************/
typedef struct {
unsigned char *packet;
long bytes;
long b_o_s;
long e_o_s;
ogg_int64_t granulepos;
ogg_int64_t packetno; /* sequence number for decode; the framing
knows where there's a hole in the data,
but we need coupling so that the codec
(which is in a separate abstraction
layer) also knows about the gap */
} ogg_packet;
typedef struct {
unsigned char *data;
int storage;
int fill;
int returned;
int unsynced;
int headerbytes;
int bodybytes;
} ogg_sync_state;
/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/
vtkogg_EXPORT void oggpack_writeinit(oggpack_buffer *b);
vtkogg_EXPORT int oggpack_writecheck(oggpack_buffer *b);
vtkogg_EXPORT void oggpack_writetrunc(oggpack_buffer *b,long bits);
vtkogg_EXPORT void oggpack_writealign(oggpack_buffer *b);
vtkogg_EXPORT void oggpack_writecopy(oggpack_buffer *b,void *source,long bits);
vtkogg_EXPORT void oggpack_reset(oggpack_buffer *b);
vtkogg_EXPORT void oggpack_writeclear(oggpack_buffer *b);
vtkogg_EXPORT void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
vtkogg_EXPORT void oggpack_write(oggpack_buffer *b,unsigned long value,int bits);
vtkogg_EXPORT long oggpack_look(oggpack_buffer *b,int bits);
vtkogg_EXPORT long oggpack_look1(oggpack_buffer *b);
vtkogg_EXPORT void oggpack_adv(oggpack_buffer *b,int bits);
vtkogg_EXPORT void oggpack_adv1(oggpack_buffer *b);
vtkogg_EXPORT long oggpack_read(oggpack_buffer *b,int bits);
vtkogg_EXPORT long oggpack_read1(oggpack_buffer *b);
vtkogg_EXPORT long oggpack_bytes(oggpack_buffer *b);
vtkogg_EXPORT long oggpack_bits(oggpack_buffer *b);
vtkogg_EXPORT unsigned char *oggpack_get_buffer(oggpack_buffer *b);
vtkogg_EXPORT void oggpackB_writeinit(oggpack_buffer *b);
vtkogg_EXPORT int oggpackB_writecheck(oggpack_buffer *b);
vtkogg_EXPORT void oggpackB_writetrunc(oggpack_buffer *b,long bits);
vtkogg_EXPORT void oggpackB_writealign(oggpack_buffer *b);
vtkogg_EXPORT void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits);
vtkogg_EXPORT void oggpackB_reset(oggpack_buffer *b);
vtkogg_EXPORT void oggpackB_writeclear(oggpack_buffer *b);
vtkogg_EXPORT void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
vtkogg_EXPORT void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits);
vtkogg_EXPORT long oggpackB_look(oggpack_buffer *b,int bits);
vtkogg_EXPORT long oggpackB_look1(oggpack_buffer *b);
vtkogg_EXPORT void oggpackB_adv(oggpack_buffer *b,int bits);
vtkogg_EXPORT void oggpackB_adv1(oggpack_buffer *b);
vtkogg_EXPORT long oggpackB_read(oggpack_buffer *b,int bits);
vtkogg_EXPORT long oggpackB_read1(oggpack_buffer *b);
vtkogg_EXPORT long oggpackB_bytes(oggpack_buffer *b);
vtkogg_EXPORT long oggpackB_bits(oggpack_buffer *b);
vtkogg_EXPORT unsigned char *oggpackB_get_buffer(oggpack_buffer *b);
/* Ogg BITSTREAM PRIMITIVES: encoding **************************/
vtkogg_EXPORT int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
vtkogg_EXPORT int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov,
int count, long e_o_s, ogg_int64_t granulepos);
vtkogg_EXPORT int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
vtkogg_EXPORT int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill);
vtkogg_EXPORT int ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
vtkogg_EXPORT int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill);
/* Ogg BITSTREAM PRIMITIVES: decoding **************************/
vtkogg_EXPORT int ogg_sync_init(ogg_sync_state *oy);
vtkogg_EXPORT int ogg_sync_clear(ogg_sync_state *oy);
vtkogg_EXPORT int ogg_sync_reset(ogg_sync_state *oy);
vtkogg_EXPORT int ogg_sync_destroy(ogg_sync_state *oy);
vtkogg_EXPORT int ogg_sync_check(ogg_sync_state *oy);
vtkogg_EXPORT char *ogg_sync_buffer(ogg_sync_state *oy, long size);
vtkogg_EXPORT int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
vtkogg_EXPORT long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
vtkogg_EXPORT int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
vtkogg_EXPORT int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
vtkogg_EXPORT int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
vtkogg_EXPORT int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
/* Ogg BITSTREAM PRIMITIVES: general ***************************/
vtkogg_EXPORT int ogg_stream_init(ogg_stream_state *os,int serialno);
vtkogg_EXPORT int ogg_stream_clear(ogg_stream_state *os);
vtkogg_EXPORT int ogg_stream_reset(ogg_stream_state *os);
vtkogg_EXPORT int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
vtkogg_EXPORT int ogg_stream_destroy(ogg_stream_state *os);
vtkogg_EXPORT int ogg_stream_check(ogg_stream_state *os);
vtkogg_EXPORT int ogg_stream_eos(ogg_stream_state *os);
vtkogg_EXPORT void ogg_page_checksum_set(ogg_page *og);
vtkogg_EXPORT int ogg_page_version(const ogg_page *og);
vtkogg_EXPORT int ogg_page_continued(const ogg_page *og);
vtkogg_EXPORT int ogg_page_bos(const ogg_page *og);
vtkogg_EXPORT int ogg_page_eos(const ogg_page *og);
vtkogg_EXPORT ogg_int64_t ogg_page_granulepos(const ogg_page *og);
vtkogg_EXPORT int ogg_page_serialno(const ogg_page *og);
vtkogg_EXPORT long ogg_page_pageno(const ogg_page *og);
vtkogg_EXPORT int ogg_page_packets(const ogg_page *og);
vtkogg_EXPORT void ogg_packet_clear(ogg_packet *op);
#ifdef __cplusplus
}
#endif
#endif /* _OGG_H */
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal.
last mod: $Id$
********************************************************************/
#ifndef _OS_TYPES_H
#define _OS_TYPES_H
/* make it easy on the folks that want to compile the libs with a
different malloc than stdlib */
#define _ogg_malloc malloc
#define _ogg_calloc calloc
#define _ogg_realloc realloc
#define _ogg_free free
#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <stdint.h>
typedef int16_t ogg_int16_t;
typedef uint16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;
typedef uint32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;
typedef uint64_t ogg_uint64_t;
# elif defined(__MINGW32__)
# include <sys/types.h>
typedef short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long ogg_int64_t;
typedef unsigned long long ogg_uint64_t;
# elif defined(__MWERKS__)
typedef long long ogg_int64_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
# else
# if defined(_MSC_VER) && (_MSC_VER >= 1800) /* MSVC 2013 and newer */
# include <stdint.h>
typedef int16_t ogg_int16_t;
typedef uint16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;
typedef uint32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;
typedef uint64_t ogg_uint64_t;
# else
/* MSVC/Borland */
typedef __int64 ogg_int64_t;
typedef __int32 ogg_int32_t;
typedef unsigned __int32 ogg_uint32_t;
typedef __int16 ogg_int16_t;
typedef unsigned __int16 ogg_uint16_t;
# endif
# endif