/*-
 * Copyright (c) 2010 The Android Open Source Project
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * 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>

/*
 * This file is almost the same as bionic/libm/sincos.c except
 * we declare the function to have hiddlen visibility.  The library
 * libstlport.so is linked against libm.so in the NDK, which does not
 * have sincos(), sincosf() and sincosl().  These functions are used
 * in code generated by gcc-4.6.0 so we need to provide them.  We don't
 * want to export these functions here, hence we declare them hidden.
 */
#define HIDDEN  __attribute__ ((visibility ("hidden")))

void HIDDEN sincos(double x, double *psin, double *pcos)
{
    *psin = sin(x);
    *pcos = cos(x);
}

void HIDDEN sincosf(float x, float *psin, float *pcos)
{
    *psin = sinf(x);
    *pcos = cosf(x);
}

void HIDDEN sincosl(long double x, long double *psin, long double *pcos)
{
    *psin = sin(x);
    *pcos = cos(x);
}
