Commit c76b5b82 authored by conrad's avatar conrad

check for type signature of system ogg_page_bos(), and adjust oggz-sort

appropriately, so as not to bomb out on existing systems where the installed
libogg is not const clean.


git-svn-id: http://svn.annodex.net/liboggz/trunk@3467 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 08bbd7cd
......@@ -285,6 +285,29 @@ fi
AM_CONDITIONAL(HAVE_OGG, [test "x$HAVE_OGG" = "xyes"])
dnl Check for type signature of ogg_page_bos(); In earlier libogg releases,
dnl this was:
dnl ogg_page_bos (ogg_page * og);
dnl but in more recent versions:
dnl ogg_page_bos (const ogg_page * og);
dnl As we are compiling with -Werror, we need to know this
if test "x$HAVE_OGG" = "xyes" ; then
AC_MSG_CHECKING([if ogg_page_bos() takes a const argument])
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS -Wall -Werror $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
AC_TRY_COMPILE([#include <ogg/ogg.h>],
[int f(const ogg_page * cog){return ogg_page_bos(cog);}],
[ AC_DEFINE([OGG_PAGE_BOS_CONST], [], [Define if ogg_page_bos() takes a const argument.])
AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no) ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
......
/*
Copyright (C) 2007 Annodex Association
Copyright (C) 2008 Annodex Association
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
......@@ -163,9 +163,15 @@ read_page_add_input (OGGZ * oggz, const ogg_page * og, long serialno,
{
OSData * osdata = (OSData *)user_data;
OSInput * input;
int nfiles;
int is_bos, nfiles;
if (ogg_page_bos(og)) {
#ifdef OGG_PAGE_BOS_CONST
is_bos = ogg_page_bos (og);
#else
is_bos = ogg_page_bos ((ogg_page *)og);
#endif
if (is_bos) {
input = (OSInput *) malloc (sizeof (OSInput));
if (input == NULL) return -1;
......
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