Mercurial > hg > audiostuff
comparison spandsp-0.0.6pre17/config/ax_c99_features.m4 @ 4:26cd8f1ef0b1
import spandsp-0.0.6pre17
author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
---|---|
date | Fri, 25 Jun 2010 15:50:58 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:c6c5a16ce2f2 | 4:26cd8f1ef0b1 |
---|---|
1 # @synopsis AX_C99_FLEXIBLE_ARRAY | |
2 # | |
3 # Does the compiler support the 1999 ISO C Standard "struct hack". | |
4 # @version 1.1 Mar 15 2004 | |
5 # @author Erik de Castro Lopo <erikd AT mega-nerd DOT com> | |
6 # | |
7 # Permission to use, copy, modify, distribute, and sell this file for any | |
8 # purpose is hereby granted without fee, provided that the above copyright | |
9 # and this permission notice appear in all copies. No representations are | |
10 # made about the suitability of this software for any purpose. It is | |
11 # provided "as is" without express or implied warranty. | |
12 | |
13 AC_DEFUN([AX_C99_FLEXIBLE_ARRAY], | |
14 [AC_CACHE_CHECK(if have C99 struct flexible array support, | |
15 ac_cv_c99_flexible_array, | |
16 | |
17 # Initialize to unknown | |
18 ac_cv_c99_flexible_array=no | |
19 | |
20 AC_TRY_LINK([[ | |
21 #include <stdlib.h> | |
22 | |
23 typedef struct { | |
24 int k; | |
25 char buffer [] ; | |
26 } MY_STRUCT ; | |
27 ]], | |
28 [ MY_STRUCT *p = calloc (1, sizeof (MY_STRUCT) + 42); ], | |
29 ac_cv_c99_flexible_array=yes, | |
30 ac_cv_c99_flexible_array=no | |
31 ))] | |
32 ) # AX_C99_FLEXIBLE_ARRAY | |
33 | |
34 # @synopsis AX_C99_FUNC_LRINT | |
35 # | |
36 # Check whether C99's lrint function is available. | |
37 # @version 1.3 Feb 12 2002 | |
38 # @author Erik de Castro Lopo <erikd AT mega-nerd DOT com> | |
39 # | |
40 # Permission to use, copy, modify, distribute, and sell this file for any | |
41 # purpose is hereby granted without fee, provided that the above copyright | |
42 # and this permission notice appear in all copies. No representations are | |
43 # made about the suitability of this software for any purpose. It is | |
44 # provided "as is" without express or implied warranty. | |
45 # | |
46 AC_DEFUN([AX_C99_FUNC_LRINT], | |
47 [AC_CACHE_CHECK(for lrint, | |
48 ac_cv_c99_lrint, | |
49 [ | |
50 lrint_save_CFLAGS=$CFLAGS | |
51 CFLAGS="-lm" | |
52 AC_TRY_LINK([ | |
53 #define _ISOC9X_SOURCE 1 | |
54 #define _ISOC99_SOURCE 1 | |
55 #define __USE_ISOC99 1 | |
56 #define __USE_ISOC9X 1 | |
57 | |
58 #include <math.h> | |
59 ], if (!lrint(3.14159)) lrint(2.7183);, ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no) | |
60 | |
61 CFLAGS=$lrint_save_CFLAGS | |
62 | |
63 ]) | |
64 | |
65 if test "$ac_cv_c99_lrint" = yes; then | |
66 AC_DEFINE(HAVE_LRINT, 1, | |
67 [Define if you have C99's lrint function.]) | |
68 fi | |
69 ])# AX_C99_FUNC_LRINT | |
70 | |
71 # @synopsis AX_C99_FUNC_LRINTF | |
72 # | |
73 # Check whether C99's lrintf function is available. | |
74 # @version 1.3 Feb 12 2002 | |
75 # @author Erik de Castro Lopo <erikd AT mega-nerd DOT com> | |
76 # | |
77 # Permission to use, copy, modify, distribute, and sell this file for any | |
78 # purpose is hereby granted without fee, provided that the above copyright | |
79 # and this permission notice appear in all copies. No representations are | |
80 # made about the suitability of this software for any purpose. It is | |
81 # provided "as is" without express or implied warranty. | |
82 # | |
83 AC_DEFUN([AX_C99_FUNC_LRINTF], | |
84 [AC_CACHE_CHECK(for lrintf, | |
85 ac_cv_c99_lrintf, | |
86 [ | |
87 lrintf_save_CFLAGS=$CFLAGS | |
88 CFLAGS="-lm" | |
89 AC_TRY_LINK([ | |
90 #define _ISOC9X_SOURCE 1 | |
91 #define _ISOC99_SOURCE 1 | |
92 #define __USE_ISOC99 1 | |
93 #define __USE_ISOC9X 1 | |
94 | |
95 #include <math.h> | |
96 ], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no) | |
97 | |
98 CFLAGS=$lrintf_save_CFLAGS | |
99 | |
100 ]) | |
101 | |
102 if test "$ac_cv_c99_lrintf" = yes; then | |
103 AC_DEFINE(HAVE_LRINTF, 1, | |
104 [Define if you have C99's lrintf function.]) | |
105 fi | |
106 ])# AX_C99_FUNC_LRINTF | |
107 | |
108 # @synopsis AX_C99_FUNC_LLRINT | |
109 # | |
110 # Check whether C99's llrint function is available. | |
111 # @version 1.1 Sep 30 2002 | |
112 # @author Erik de Castro Lopo <erikd AT mega-nerd DOT com> | |
113 # | |
114 # Permission to use, copy, modify, distribute, and sell this file for any | |
115 # purpose is hereby granted without fee, provided that the above copyright | |
116 # and this permission notice appear in all copies. No representations are | |
117 # made about the suitability of this software for any purpose. It is | |
118 # provided "as is" without express or implied warranty. | |
119 # | |
120 AC_DEFUN([AX_C99_FUNC_LLRINT], | |
121 [AC_CACHE_CHECK(for llrint, | |
122 ac_cv_c99_llrint, | |
123 [ | |
124 llrint_save_CFLAGS=$CFLAGS | |
125 CFLAGS="-lm" | |
126 AC_TRY_LINK([ | |
127 #define ISOC9X_SOURCE 1 | |
128 #define _ISOC99_SOURCE 1 | |
129 #define __USE_ISOC99 1 | |
130 #define __USE_ISOC9X 1 | |
131 | |
132 #include <math.h> | |
133 ], long long int x ; x = llrint(3.14159) ;, ac_cv_c99_llrint=yes, ac_cv_c99_llrint=no) | |
134 | |
135 CFLAGS=$llrint_save_CFLAGS | |
136 | |
137 ]) | |
138 | |
139 if test "$ac_cv_c99_llrint" = yes; then | |
140 AC_DEFINE(HAVE_LLRINT, 1, | |
141 [Define if you have C99's llrint function.]) | |
142 fi | |
143 ])# AX_C99_FUNC_LLRINT | |
144 | |
145 | |
146 # @synopsis AX_C99_FUNC_LLRINTF | |
147 # | |
148 # Check whether C99's llrintf function is available. | |
149 # @version 1.1 Sep 30 2002 | |
150 # @author Erik de Castro Lopo <erikd AT mega-nerd DOT com> | |
151 # | |
152 # Permission to use, copy, modify, distribute, and sell this file for any | |
153 # purpose is hereby granted without fee, provided that the above copyright | |
154 # and this permission notice appear in all copies. No representations are | |
155 # made about the suitability of this software for any purpose. It is | |
156 # provided "as is" without express or implied warranty. | |
157 # | |
158 AC_DEFUN([AX_C99_FUNC_LLRINTF], | |
159 [AC_CACHE_CHECK(for llrintf, | |
160 ac_cv_c99_llrintf, | |
161 [ | |
162 llrintf_save_CFLAGS=$CFLAGS | |
163 CFLAGS="-lm" | |
164 AC_TRY_LINK([ | |
165 #define _ISOC9X_SOURCE 1 | |
166 #define _ISOC99_SOURCE 1 | |
167 #define __USE_ISOC99 1 | |
168 #define __USE_ISOC9X 1 | |
169 | |
170 #include <math.h> | |
171 ], long long int x ; x = llrintf(3.14159) ;, ac_cv_c99_llrintf=yes, ac_cv_c99_llrintf=no) | |
172 | |
173 CFLAGS=$llrintf_save_CFLAGS | |
174 | |
175 ]) | |
176 | |
177 if test "$ac_cv_c99_llrintf" = yes; then | |
178 AC_DEFINE(HAVE_LLRINTF, 1, | |
179 [Define if you have C99's llrintf function.]) | |
180 fi | |
181 ])# AX_C99_FUNC_LLRINTF |