[MPlayer-dev-eng] libvo/gtf.c error: static declaration of 'round' follows non-static declaration
Steven M. Schultz
sms at 2BSD.COM
Tue May 10 02:18:12 CEST 2005
On Sun, 8 May 2005, Steven M. Schultz wrote:
> Hi -
>
> It's going slow but MPlayer is getting closer to building on OS/X 10.4
>
> round() is defined in <math.h> so the static version in libvo/gtf.c
> triggers the error:
>
> gmake -C libvo
> cc -c -I../libvo -I../../libvo -I/usr/X11R6/include -O4 -faltivec -pipe -ffast-math -fomit-frame-pointer -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I. -I.. -I../osdep -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/local/include/SDL -D_THREAD_SAFE -I/usr/X11R6/include -DMPG12PLAY -o gtf.o gtf.c
> gtf.c:28: error: static declaration of 'round' follows non-static declaration
> gmake[1]: *** [gtf.o] Error 1
> gmake: *** [libvo/libvo.a] Error 2
I have redone the patch using the current (as of 10 minutes ago ;))
cvs version of MPlayer.
The patch adds a check for round() to ./configure and ifdef's the
use of the local round() function in libvo/gtf.c
Cheers,
Steven Schultz
-------------- next part --------------
--- configure.dist 2005-05-09 17:01:23.000000000 -0700
+++ configure 2005-05-09 17:03:58.000000000 -0700
@@ -2410,6 +2410,19 @@
fi
echores "$_lrintf"
+echocheck "round"
+cat > $TMPC << EOF
+#include <math.h>
+int main(void) { (void) round(0.0); return 0; }
+EOF
+_round=no
+cc_check $_ld_lm && _round=yes
+if test "$_round" = yes ; then
+ _def_round="#define HAVE_ROUND 1"
+else
+ _def_round="#undef HAVE_ROUND"
+fi
+echores "$_round"
echocheck "nanosleep"
# also check for nanosleep
@@ -7406,6 +7419,9 @@
/* C99 lrintf function available */
$_def_lrintf
+/* round function is available */
+$_def_round
+
/* yes, we have inttypes.h */
#define HAVE_INTTYPES_H 1
--- libvo/gtf.c.dist 2002-08-22 16:03:50.000000000 -0700
+++ libvo/gtf.c 2005-05-08 19:13:12.000000000 -0700
@@ -9,6 +9,7 @@
*/
//Version 0.4
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@@ -24,10 +25,12 @@
static GTF_constants GTF_given_constants = { 3.0,550.0,1,8,1.8,8,40,20,128,600 };
+#ifndef HAVE_ROUND
static double round(double v)
{
return floor(v + 0.5);
}
+#endif
static void GetRoundedConstants(GTF_constants *c)
{
More information about the MPlayer-dev-eng
mailing list