Changeset 2957

Show
Ignore:
Timestamp:
2007-06-16 04:59:04 (2 years ago)
Author:
conrad
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • liboggz/trunk/configure.ac

    r2955 r2957  
    243243if test $SIZEOF_OGGZ_OFF_T = 4 ; then 
    244244    OGGZ_OFF_MAX="0x7FFFFFFF" 
    245 fi 
    246  
    247 AC_DEFINE_UNQUOTED([TYPEOF_OGGZ_OFF_T],${TYPEOF_OGGZ_OFF_T}, [Set to long if unknown.]) 
     245    PRI_OGGZ_OFF_T="l" 
     246elif test $SIZEOF_OGGZ_OFF_T = 8 ; then 
     247    PRI_OGGZ_OFF_T="q" 
     248fi 
     249 
     250dnl The following configured variables are written into the public header 
     251dnl <oggz/oggz_off_t_generated.h>: 
     252dnl   oggz_off_t (typedef) 
     253dnl   PRI_OGGZ_OFF_T (printf format) 
     254 
     255dnl AC_DEFINE_UNQUOTED([TYPEOF_OGGZ_OFF_T],${TYPEOF_OGGZ_OFF_T}, [Set to long if unknown.]) 
    248256AC_SUBST(TYPEOF_OGGZ_OFF_T) 
     257 
     258AC_SUBST(PRI_OGGZ_OFF_T) 
    249259 
    250260AC_DEFINE_UNQUOTED([SIZEOF_OGGZ_OFF_T],${SIZEOF_OGGZ_OFF_T}, [Set to sizeof (long) if unknown.]) 
     
    363373include/Makefile 
    364374include/oggz/Makefile 
    365 include/oggz/oggz_off_t.h 
     375include/oggz/oggz_off_t_generated.h 
    366376src/Makefile 
    367377src/liboggz/Version_script 
  • liboggz/trunk/include/oggz/Makefile.am

    r2608 r2957  
    11## Process this file with automake to produce Makefile.in 
     2 
     3EXTRA_DIST = oggz_off_t_generated.h.in 
    24 
    35# Include files to install 
     
    57oggzinclude_HEADERS = oggz.h oggz_comments.h oggz_constants.h oggz_read.h \ 
    68        oggz_seek.h oggz_write.h oggz_io.h oggz_table.h oggz_deprecated.h \ 
    7         oggz_off_t.h 
     9        oggz_off_t.h oggz_off_t_generated.h 
    810 
     11BUILT_SOURCES = oggz_off_t_generated.h 
  • liboggz/trunk/include/oggz/oggz.h

    r2885 r2957  
    564564long oggz_serialno_new (OGGZ * oggz); 
    565565 
    566 /* define appropriate type for oggz_off_t */ 
    567 #ifdef _WIN32 
    568 #include <oggz/oggz_off_t_win32.h> 
    569 #else 
    570566#include <oggz/oggz_off_t.h> 
    571 #endif 
    572  
    573 #include <oggz/oggz_comments.h> 
    574567#include <oggz/oggz_read.h> 
    575568#include <oggz/oggz_seek.h> 
    576569#include <oggz/oggz_write.h> 
    577570#include <oggz/oggz_io.h> 
     571#include <oggz/oggz_comments.h> 
    578572#include <oggz/oggz_deprecated.h> 
    579573 
  • liboggz/trunk/include/oggz/oggz_off_t.h

    r2956 r2957  
    3535 
    3636/** \file 
    37  * Support for Large File Sizes on systems supporting 64-bit off_t types. 
    38  * 
    39  * This file is included by all files using loff_t for file  
    40  * position e.g.: \link config.h <config.h> \endlink, 
    41  * except on non-GNU Win32 systems \link ogg_off_t_w32.h \endlink is included 
    42  * instead. 
    43  * 
    44  * This file should never be included directly by user code. 
    45  */ 
    46  
    47 /** 
    48  * This typedef was determined on the system on which the documentation 
    49  * was generated. 
    50  * 
    51  * To query this on your system, do eg. 
    52  * 
    53  <pre> 
    54    echo "#include <config.h>" | gcc -E - | grep oggz_off_t 
    55  </pre> 
    56  *  
     37 * Architecture-dependent type and printf format for file position. 
     38 * Allows Large File Sizes on systems supporting 64-bit off_t types. 
    5739 */ 
    5840 
     
    6042  /* MSVC/Borland & Cygwin */ 
    6143   typedef off_t oggz_off_t; 
     44 
     45#define PRI_OGGZ_OFF_T "l" 
     46 
    6247#else 
    63    
    64    /* Linux/BSD/etc. */ 
    65 #  include <sys/types.h> 
    66    typedef loff_t oggz_off_t; 
    67  
    68 #endif 
    69  
    70 /* Note: This is an ugly fix for proper display in printf but will work for now */ 
    71 #if SIZEOF_OGGZ_OFF_T == 8 
    72 #define PRI_OGGZ_OFF_T "q" 
    73 #else 
    74 #define PRI_OGGZ_OFF_T "l" 
     48#include <oggz/oggz_off_t_generated.h> 
    7549#endif 
    7650 
  • liboggz/trunk/include/oggz/oggz_off_t_generated.h.in

    r2956 r2957  
    3131*/ 
    3232 
    33 #ifndef __OGGZ_OFF_T_H__ 
    34 #define __OGGZ_OFF_T_H__ 
     33#ifndef __OGGZ_OFF_T_GENERATED_H__ 
     34#define __OGGZ_OFF_T_GENERATED_H__ 
    3535 
    3636/** \file 
    37  * Support for Large File Sizes on systems supporting 64-bit off_t types
     37 * Architecture-dependent type for oggz_off_t
    3838 * 
    39  * This file is included by all files using @TYPEOF_OGGZ_OFF_T@ for file  
    40  * position e.g.: \link config.h <config.h> \endlink, 
    41  * except on non-GNU Win32 systems \link ogg_off_t_w32.h \endlink is included 
    42  * instead. 
     39 * This file should never be included directly by user code. Please include 
     40 * either of <oggz/oggz.h> or <oggz/oggz_off_t.h> instead. 
    4341 * 
    44  * This file should never be included directly by user code. 
     42 * This file was generated when liboggz was built. 
     43 * 
     44 * Note that this file is only generated when using GNU autoconf. 
     45 * This file is not used on Win32 systems. 
    4546 */ 
    4647 
     
    5253 * 
    5354 <pre> 
    54    echo "#include <config.h>" | gcc -E - | grep oggz_off_t 
     55   echo "gcc -E oggz.h | grep oggz_off_t 
    5556 </pre> 
    5657 *  
    5758 */ 
    5859 
    59 #ifdef _WIN32 
    60   /* MSVC/Borland & Cygwin */ 
    61    typedef off_t oggz_off_t; 
    62 #else 
    63    
    64    /* Linux/BSD/etc. */ 
    65 #  include <sys/types.h> 
    66    typedef @TYPEOF_OGGZ_OFF_T@ oggz_off_t; 
     60#include <sys/types.h> 
    6761 
    68 #endif 
     62typedef @TYPEOF_OGGZ_OFF_T@ oggz_off_t; 
    6963 
    70 /* Note: This is an ugly fix for proper display in printf but will work for now */ 
    71 #if SIZEOF_OGGZ_OFF_T == 8 
    72 #define PRI_OGGZ_OFF_T "q" 
    73 #else 
    74 #define PRI_OGGZ_OFF_T "l" 
    75 #endif 
     64#define PRI_OGGZ_OFF_T "@PRI_OGGZ_OFF_T@" 
    7665 
    77 #endif /* __OGGZ_OFF_T__ */ 
     66#endif /* __OGGZ_OFF_T_GENERATED__ */ 
  • liboggz/trunk/src/liboggz/oggz_private.h

    r2955 r2957  
    3939#include <ogg/ogg.h> 
    4040#include <oggz/oggz_constants.h> 
    41  
    42 /* define appropriate type for oggz_off_t */ 
    43 #ifdef _WIN32 
    44 #include <oggz/oggz_off_t_win32.h> 
    45 #else 
    4641#include <oggz/oggz_off_t.h> 
    47 #endif 
    4842 
    4943#include "oggz_macros.h"