Contents of /trunk/libfaad2/patches/libfaad2-2.0-lrintf.patch
Parent Directory | Revision Log
Revision 144 -
(show annotations)
(download)
Tue May 8 20:06:05 2007 UTC (17 years, 4 months ago) by niro
File size: 2033 byte(s)
Tue May 8 20:06:05 2007 UTC (17 years, 4 months ago) by niro
File size: 2033 byte(s)
-import
1 | Index: faad2/configure.in |
2 | =================================================================== |
3 | --- faad2.orig/configure.in |
4 | +++ faad2/configure.in |
5 | @@ -47,6 +47,43 @@ AC_DEFUN(MY_CHECK_TYPEDEF_FROM_INCLUDE, |
6 | fi |
7 | ]) |
8 | |
9 | +dnl @synopsis AC_C99_FUNC_LRINTF |
10 | +dnl |
11 | +dnl Check whether C99's lrintf function is available. |
12 | +dnl @version 1.3 Feb 12 2002 |
13 | +dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com> |
14 | +dnl |
15 | +dnl Permission to use, copy, modify, distribute, and sell this file for any |
16 | +dnl purpose is hereby granted without fee, provided that the above copyright |
17 | +dnl and this permission notice appear in all copies. No representations are |
18 | +dnl made about the suitability of this software for any purpose. It is |
19 | +dnl provided "as is" without express or implied warranty. |
20 | +dnl |
21 | +AC_DEFUN([AC_C99_FUNC_LRINTF], |
22 | +[AC_CACHE_CHECK(for lrintf, |
23 | + ac_cv_c99_lrintf, |
24 | +[ |
25 | +lrintf_save_CFLAGS=$CFLAGS |
26 | +CFLAGS="-O -lm" |
27 | +AC_TRY_LINK([ |
28 | +#define _ISOC9X_SOURCE 1 |
29 | +#define _ISOC99_SOURCE 1 |
30 | +#define __USE_ISOC99 1 |
31 | +#define __USE_ISOC9X 1 |
32 | + |
33 | +#include <math.h> |
34 | +], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no) |
35 | + |
36 | +CFLAGS=$lrintf_save_CFLAGS |
37 | + |
38 | +]) |
39 | + |
40 | +if test "$ac_cv_c99_lrintf" = yes; then |
41 | + AC_DEFINE(HAVE_LRINTF, 1, |
42 | + [Define if you have C99's lrintf function.]) |
43 | +fi |
44 | +])# AC_C99_FUNC_LRINTF |
45 | +AC_C99_FUNC_LRINTF |
46 | |
47 | MY_CHECK_TYPEDEF_FROM_INCLUDE([float32_t temp], |
48 | [#include <sys/types.h>, |
49 | Index: faad2/libfaad/common.h |
50 | =================================================================== |
51 | --- faad2.orig/libfaad/common.h |
52 | +++ faad2/libfaad/common.h |
53 | @@ -316,6 +316,7 @@ char *strchr(), *strrchr(); |
54 | return i; |
55 | } |
56 | #elif (defined(__i386__) && defined(__GNUC__)) |
57 | + #ifndef HAVE_LRINTF |
58 | #define HAS_LRINTF |
59 | // from http://www.stereopsis.com/FPU.html |
60 | static INLINE int lrintf(float f) |
61 | @@ -328,6 +329,7 @@ char *strchr(), *strrchr(); |
62 | : "m" (f)); |
63 | return i; |
64 | } |
65 | + #endif /* HAVE_LRINTF */ |
66 | #endif |
67 | |
68 |