Commit 2d9f4e7c authored by conrad's avatar conrad

Clean up declarations for oggz_off_t:

	* Remove redundant copies of PRI_OGGZ_OFF_T definition
	* Move win32 defines straight into oggz_off_t.h
	* Rename generated file to oggz_off_t_generated.h
This allows user code (and oggz.h) to include <oggz/oggz_off_t.h> without
checking platform availability.


git-svn-id: http://svn.annodex.net/liboggz/trunk@2957 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 8e745f50
......@@ -242,11 +242,21 @@ case "$host_os" in
if test $SIZEOF_OGGZ_OFF_T = 4 ; then
OGGZ_OFF_MAX="0x7FFFFFFF"
PRI_OGGZ_OFF_T="l"
elif test $SIZEOF_OGGZ_OFF_T = 8 ; then
PRI_OGGZ_OFF_T="q"
fi
AC_DEFINE_UNQUOTED([TYPEOF_OGGZ_OFF_T],${TYPEOF_OGGZ_OFF_T}, [Set to long if unknown.])
dnl The following configured variables are written into the public header
dnl <oggz/oggz_off_t_generated.h>:
dnl oggz_off_t (typedef)
dnl PRI_OGGZ_OFF_T (printf format)
dnl AC_DEFINE_UNQUOTED([TYPEOF_OGGZ_OFF_T],${TYPEOF_OGGZ_OFF_T}, [Set to long if unknown.])
AC_SUBST(TYPEOF_OGGZ_OFF_T)
AC_SUBST(PRI_OGGZ_OFF_T)
AC_DEFINE_UNQUOTED([SIZEOF_OGGZ_OFF_T],${SIZEOF_OGGZ_OFF_T}, [Set to sizeof (long) if unknown.])
AC_SUBST(SIZEOF_OGGZ_OFF_T)
......@@ -362,7 +372,7 @@ doc/Makefile
doc/Doxyfile
include/Makefile
include/oggz/Makefile
include/oggz/oggz_off_t.h
include/oggz/oggz_off_t_generated.h
src/Makefile
src/liboggz/Version_script
src/liboggz/Makefile
......
## Process this file with automake to produce Makefile.in
EXTRA_DIST = oggz_off_t_generated.h.in
# Include files to install
oggzincludedir = $(includedir)/oggz
oggzinclude_HEADERS = oggz.h oggz_comments.h oggz_constants.h oggz_read.h \
oggz_seek.h oggz_write.h oggz_io.h oggz_table.h oggz_deprecated.h \
oggz_off_t.h
oggz_off_t.h oggz_off_t_generated.h
BUILT_SOURCES = oggz_off_t_generated.h
......@@ -563,18 +563,12 @@ int oggz_get_numtracks (OGGZ * oggz);
*/
long oggz_serialno_new (OGGZ * oggz);
/* define appropriate type for oggz_off_t */
#ifdef _WIN32
#include <oggz/oggz_off_t_win32.h>
#else
#include <oggz/oggz_off_t.h>
#endif
#include <oggz/oggz_comments.h>
#include <oggz/oggz_read.h>
#include <oggz/oggz_seek.h>
#include <oggz/oggz_write.h>
#include <oggz/oggz_io.h>
#include <oggz/oggz_comments.h>
#include <oggz/oggz_deprecated.h>
#ifdef __cplusplus
......
......@@ -34,44 +34,18 @@
#define __OGGZ_OFF_T_H__
/** \file
* Support for Large File Sizes on systems supporting 64-bit off_t types.
*
* This file is included by all files using loff_t for file
* position e.g.: \link config.h <config.h> \endlink,
* except on non-GNU Win32 systems \link ogg_off_t_w32.h \endlink is included
* instead.
*
* This file should never be included directly by user code.
*/
/**
* This typedef was determined on the system on which the documentation
* was generated.
*
* To query this on your system, do eg.
*
<pre>
echo "#include <config.h>" | gcc -E - | grep oggz_off_t
</pre>
*
* Architecture-dependent type and printf format for file position.
* Allows Large File Sizes on systems supporting 64-bit off_t types.
*/
#ifdef _WIN32
/* MSVC/Borland & Cygwin */
typedef off_t oggz_off_t;
#else
/* Linux/BSD/etc. */
# include <sys/types.h>
typedef loff_t oggz_off_t;
#endif
#define PRI_OGGZ_OFF_T "l"
/* Note: This is an ugly fix for proper display in printf but will work for now */
#if SIZEOF_OGGZ_OFF_T == 8
#define PRI_OGGZ_OFF_T "q"
#else
#define PRI_OGGZ_OFF_T "l"
#include <oggz/oggz_off_t_generated.h>
#endif
#endif /* __OGGZ_OFF_T__ */
......@@ -30,18 +30,19 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __OGGZ_OFF_T_H__
#define __OGGZ_OFF_T_H__
#ifndef __OGGZ_OFF_T_GENERATED_H__
#define __OGGZ_OFF_T_GENERATED_H__
/** \file
* Support for Large File Sizes on systems supporting 64-bit off_t types.
* Architecture-dependent type for oggz_off_t.
*
* This file is included by all files using @TYPEOF_OGGZ_OFF_T@ for file
* position e.g.: \link config.h <config.h> \endlink,
* except on non-GNU Win32 systems \link ogg_off_t_w32.h \endlink is included
* instead.
* This file should never be included directly by user code. Please include
* either of <oggz/oggz.h> or <oggz/oggz_off_t.h> instead.
*
* This file should never be included directly by user code.
* This file was generated when liboggz was built.
*
* Note that this file is only generated when using GNU autoconf.
* This file is not used on Win32 systems.
*/
/**
......@@ -51,27 +52,15 @@
* To query this on your system, do eg.
*
<pre>
echo "#include <config.h>" | gcc -E - | grep oggz_off_t
echo "gcc -E oggz.h | grep oggz_off_t
</pre>
*
*/
#ifdef _WIN32
/* MSVC/Borland & Cygwin */
typedef off_t oggz_off_t;
#else
/* Linux/BSD/etc. */
# include <sys/types.h>
typedef @TYPEOF_OGGZ_OFF_T@ oggz_off_t;
#include <sys/types.h>
#endif
typedef @TYPEOF_OGGZ_OFF_T@ oggz_off_t;
/* Note: This is an ugly fix for proper display in printf but will work for now */
#if SIZEOF_OGGZ_OFF_T == 8
#define PRI_OGGZ_OFF_T "q"
#else
#define PRI_OGGZ_OFF_T "l"
#endif
#define PRI_OGGZ_OFF_T "@PRI_OGGZ_OFF_T@"
#endif /* __OGGZ_OFF_T__ */
#endif /* __OGGZ_OFF_T_GENERATED__ */
/*
Copyright (C) 2007 Commonwealth Scientific and Industrial Research
Organisation (CSIRO) Australia
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 CSIRO Australia 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 ORGANISATION 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.
*/
#ifndef __OGGZ_OFF_T_H__
#define __OGGZ_OFF_T_H__
/** \file
* Support for Large File Sizes on systems supporting 64-bit off_t types.
*
* This file is included by all files using @TYPEOF_OGGZ_OFF_T@ for file
* position e.g.: \link config.h <config.h> \endlink,
* except on non-GNU Win32 systems \link ogg_off_t_w32.h \endlink is included
* instead.
*
* This file should never be included directly by user code.
*/
/**
* This typedef was determined on the system on which the documentation
* was generated.
*
* To query this on your system, do eg.
*
<pre>
echo "#include <config.h>" | gcc -E - | grep oggz_off_t
</pre>
*
*/
#ifdef _WIN32
/* MSVC/Borland & Cygwin */
typedef off_t oggz_off_t;
#else
/* Linux/BSD/etc. */
#include <sys/types.h>
typedef @TYPEOF_OGGZ_OFF_T@ oggz_off_t;
/* Note: This is an ugly fix for proper display in printf but will work for now */
#if SIZEOF_OGGZ_OFF_T == 8
#define PRI_OGGZ_OFF_T "q"
#else
#define PRI_OGGZ_OFF_T "l"
#endif
#endif
#endif /* __OGGZ_OFF_T__ */
......@@ -38,13 +38,7 @@
#include <ogg/ogg.h>
#include <oggz/oggz_constants.h>
/* define appropriate type for oggz_off_t */
#ifdef _WIN32
#include <oggz/oggz_off_t_win32.h>
#else
#include <oggz/oggz_off_t.h>
#endif
#include "oggz_macros.h"
#include "oggz_vector.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment