summaryrefslogtreecommitdiffstats
path: root/libm
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-08-18 16:04:03 -0700
committerElliott Hughes <enh@google.com>2014-08-18 16:04:03 -0700
commit5f5cc45cf0e027f6ca503dc229a4890fc7164b66 (patch)
tree36bebf629f486d24d8287e7a735662b0269044a6 /libm
parent205cc41556d44b104a21bc6839b7ea44f72df9ba (diff)
downloadbionic-5f5cc45cf0e027f6ca503dc229a4890fc7164b66.zip
bionic-5f5cc45cf0e027f6ca503dc229a4890fc7164b66.tar.gz
bionic-5f5cc45cf0e027f6ca503dc229a4890fc7164b66.tar.bz2
Fix <features.h> (_BSD_SOURCE and _GNU_SOURCE).
<features.h> is supposed to take user-settable stuff like _GNU_SOURCE and _BSD_SOURCE and turn them into __USE_GNU and __USE_BSD for use in the C library headers. Instead, bionic used to unconditionally define _BSD_SOURCE and _GNU_SOURCE, and then test _GNU_SOURCE in the header files (which makes no sense whatsoever). Bug: 14659579 Change-Id: Ice4cf21a364ea2e559071dc8329e995277d5b987
Diffstat (limited to 'libm')
-rw-r--r--libm/include/math.h5
-rw-r--r--libm/sincos.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/libm/include/math.h b/libm/include/math.h
index 4faec33..a808d8d 100644
--- a/libm/include/math.h
+++ b/libm/include/math.h
@@ -17,6 +17,7 @@
#ifndef _MATH_H_
#define _MATH_H_
+#include <features.h>
#include <sys/cdefs.h>
#include <limits.h>
@@ -462,11 +463,11 @@ long double truncl(long double);
#endif /* __ISO_C_VISIBLE >= 1999 */
-#if defined(_GNU_SOURCE)
+#if defined(__USE_GNU)
void sincos(double, double*, double*);
void sincosf(float, float*, float*);
void sincosl(long double, long double*, long double*);
-#endif /* _GNU_SOURCE */
+#endif /* __USE_GNU */
#pragma GCC visibility pop
__END_DECLS
diff --git a/libm/sincos.c b/libm/sincos.c
index ad75549..a5608cf 100644
--- a/libm/sincos.c
+++ b/libm/sincos.c
@@ -22,8 +22,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
*/
+
#define _GNU_SOURCE 1
#include <math.h>