[xiph-commits] r3467 - in liboggz/trunk: . src/tools

conrad at svn.annodex.net conrad at svn.annodex.net
Fri Feb 15 00:40:21 PST 2008


Author: conrad
Date: 2008-02-15 00:40:21 -0800 (Fri, 15 Feb 2008)
New Revision: 3467

Modified:
   liboggz/trunk/configure.ac
   liboggz/trunk/src/tools/oggz-sort.c
Log:
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.


Modified: liboggz/trunk/configure.ac
===================================================================
--- liboggz/trunk/configure.ac	2008-02-15 08:19:08 UTC (rev 3466)
+++ liboggz/trunk/configure.ac	2008-02-15 08:40:21 UTC (rev 3467)
@@ -285,6 +285,29 @@
 
 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.

Modified: liboggz/trunk/src/tools/oggz-sort.c
===================================================================
--- liboggz/trunk/src/tools/oggz-sort.c	2008-02-15 08:19:08 UTC (rev 3466)
+++ liboggz/trunk/src/tools/oggz-sort.c	2008-02-15 08:40:21 UTC (rev 3467)
@@ -1,5 +1,5 @@
 /*
-   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 @@
 {
   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;
 



More information about the commits mailing list