Fix Clang warnings on Windows

- Align DLLEXPORT in definitions and declations. There is still a few
  cases left, where the declation in the compiler's complex.h disagrees
  with the implementation here. For now we can't do anything about that,
  but maybe should be revisited in the future.
- Fix the syntax on an .ascii directive that gcc accepted mistakingly, but
  clang does not.
This commit is contained in:
Keno Fischer 2016-03-13 06:09:25 +00:00
parent 4fcad1584a
commit 81053b7fcb
11 changed files with 236 additions and 224 deletions

View File

@ -76,7 +76,7 @@
#define _START_ENTRY_WIN .code; _START_ENTRY
#endif
#define _ENTRY(x) _START_ENTRY_WIN; \
.globl CNAME(x); .section .drectve; .ascii " -export:" #x; \
.globl CNAME(x); .section .drectve; .ascii " -export:", #x; \
.section .text; .def CNAME(x); .scl 2; .type 32; .endef; CNAME(x):
#endif

View File

@ -125,8 +125,8 @@ fegetexceptflag(fexcept_t *__flagp, int __excepts)
return (0);
}
int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
int feraiseexcept(int __excepts);
DLLEXPORT int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
DLLEXPORT int feraiseexcept(int __excepts);
__fenv_static __attribute__((always_inline)) inline int
fetestexcept(int __excepts)
@ -176,8 +176,8 @@ fesetround(int __round)
return (0);
}
int fegetenv(fenv_t *__envp);
int feholdexcept(fenv_t *__envp);
DLLEXPORT int fegetenv(fenv_t *__envp);
DLLEXPORT int feholdexcept(fenv_t *__envp);
__fenv_static inline int
fesetenv(const fenv_t *__envp)
@ -196,12 +196,12 @@ fesetenv(const fenv_t *__envp)
return (0);
}
int feupdateenv(const fenv_t *__envp);
DLLEXPORT int feupdateenv(const fenv_t *__envp);
#if __BSD_VISIBLE
int feenableexcept(int __mask);
int fedisableexcept(int __mask);
DLLEXPORT int feenableexcept(int __mask);
DLLEXPORT int fedisableexcept(int __mask);
/* We currently provide no external definition of fegetexcept(). */
static inline int

View File

@ -33,6 +33,16 @@
#define __pure2
#endif
#ifdef _WIN32
# ifdef IMPORT_EXPORTS
# define DLLEXPORT __declspec(dllimport)
# else
# define DLLEXPORT __declspec(dllexport)
# endif
#else
#define DLLEXPORT __attribute__ ((visibility("default")))
#endif
/*
* ANSI/POSIX
*/
@ -200,286 +210,286 @@ int isopenlibm(void);
/*
* ANSI/POSIX
*/
int __fpclassifyd(double) __pure2;
int __fpclassifyf(float) __pure2;
int __fpclassifyl(long double) __pure2;
int __isfinitef(float) __pure2;
int __isfinite(double) __pure2;
int __isfinitel(long double) __pure2;
int __isinff(float) __pure2;
int __isinfl(long double) __pure2;
int __isnanf(float) __pure2;
int __isnanl(long double) __pure2;
int __isnormalf(float) __pure2;
int __isnormal(double) __pure2;
int __isnormall(long double) __pure2;
int __signbit(double) __pure2;
int __signbitf(float) __pure2;
int __signbitl(long double) __pure2;
DLLEXPORT int __fpclassifyd(double) __pure2;
DLLEXPORT int __fpclassifyf(float) __pure2;
DLLEXPORT int __fpclassifyl(long double) __pure2;
DLLEXPORT int __isfinitef(float) __pure2;
DLLEXPORT int __isfinite(double) __pure2;
DLLEXPORT int __isfinitel(long double) __pure2;
DLLEXPORT int __isinff(float) __pure2;
DLLEXPORT int __isinfl(long double) __pure2;
DLLEXPORT int __isnanf(float) __pure2;
DLLEXPORT int __isnanl(long double) __pure2;
DLLEXPORT int __isnormalf(float) __pure2;
DLLEXPORT int __isnormal(double) __pure2;
DLLEXPORT int __isnormall(long double) __pure2;
DLLEXPORT int __signbit(double) __pure2;
DLLEXPORT int __signbitf(float) __pure2;
DLLEXPORT int __signbitl(long double) __pure2;
double acos(double);
double asin(double);
double atan(double);
double atan2(double, double);
double cos(double);
double sin(double);
double tan(double);
DLLEXPORT double acos(double);
DLLEXPORT double asin(double);
DLLEXPORT double atan(double);
DLLEXPORT double atan2(double, double);
DLLEXPORT double cos(double);
DLLEXPORT double sin(double);
DLLEXPORT double tan(double);
double cosh(double);
double sinh(double);
double tanh(double);
DLLEXPORT double cosh(double);
DLLEXPORT double sinh(double);
DLLEXPORT double tanh(double);
double exp(double);
double frexp(double, int *); /* fundamentally !__pure2 */
double ldexp(double, int);
double log(double);
double log10(double);
double modf(double, double *); /* fundamentally !__pure2 */
DLLEXPORT double exp(double);
DLLEXPORT double frexp(double, int *); /* fundamentally !__pure2 */
DLLEXPORT double ldexp(double, int);
DLLEXPORT double log(double);
DLLEXPORT double log10(double);
DLLEXPORT double modf(double, double *); /* fundamentally !__pure2 */
double pow(double, double);
double sqrt(double);
DLLEXPORT double pow(double, double);
DLLEXPORT double sqrt(double);
double ceil(double);
double fabs(double) __pure2;
double floor(double);
double fmod(double, double);
DLLEXPORT double ceil(double);
DLLEXPORT double fabs(double) __pure2;
DLLEXPORT double floor(double);
DLLEXPORT double fmod(double, double);
/*
* These functions are not in C90.
*/
#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE
double acosh(double);
double asinh(double);
double atanh(double);
double cbrt(double);
double erf(double);
double erfc(double);
double exp2(double);
double expm1(double);
double fma(double, double, double);
double hypot(double, double);
int ilogb(double) __pure2;
int (isinf)(double) __pure2;
int (isnan)(double) __pure2;
double lgamma(double);
long long llrint(double);
long long llround(double);
double log1p(double);
double log2(double);
double logb(double);
long lrint(double);
long lround(double);
double nan(const char *) __pure2;
double nextafter(double, double);
double remainder(double, double);
double remquo(double, double, int *);
double rint(double);
DLLEXPORT double acosh(double);
DLLEXPORT double asinh(double);
DLLEXPORT double atanh(double);
DLLEXPORT double cbrt(double);
DLLEXPORT double erf(double);
DLLEXPORT double erfc(double);
DLLEXPORT double exp2(double);
DLLEXPORT double expm1(double);
DLLEXPORT double fma(double, double, double);
DLLEXPORT double hypot(double, double);
DLLEXPORT int ilogb(double) __pure2;
DLLEXPORT int (isinf)(double) __pure2;
DLLEXPORT int (isnan)(double) __pure2;
DLLEXPORT double lgamma(double);
DLLEXPORT long long llrint(double);
DLLEXPORT long long llround(double);
DLLEXPORT double log1p(double);
DLLEXPORT double log2(double);
DLLEXPORT double logb(double);
DLLEXPORT long lrint(double);
DLLEXPORT long lround(double);
DLLEXPORT double nan(const char *) __pure2;
DLLEXPORT double nextafter(double, double);
DLLEXPORT double remainder(double, double);
DLLEXPORT double remquo(double, double, int *);
DLLEXPORT double rint(double);
#endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
#if __BSD_VISIBLE || __XSI_VISIBLE
double j0(double);
double j1(double);
double jn(int, double);
double y0(double);
double y1(double);
double yn(int, double);
DLLEXPORT double j0(double);
DLLEXPORT double j1(double);
DLLEXPORT double jn(int, double);
DLLEXPORT double y0(double);
DLLEXPORT double y1(double);
DLLEXPORT double yn(int, double);
#endif /* __BSD_VISIBLE || __XSI_VISIBLE */
#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999
double copysign(double, double) __pure2;
double fdim(double, double);
double fmax(double, double) __pure2;
double fmin(double, double) __pure2;
double nearbyint(double);
double round(double);
double scalbln(double, long);
double scalbn(double, int);
double tgamma(double);
double trunc(double);
DLLEXPORT double copysign(double, double) __pure2;
DLLEXPORT double fdim(double, double);
DLLEXPORT double fmax(double, double) __pure2;
DLLEXPORT double fmin(double, double) __pure2;
DLLEXPORT double nearbyint(double);
DLLEXPORT double round(double);
DLLEXPORT double scalbln(double, long);
DLLEXPORT double scalbn(double, int);
DLLEXPORT double tgamma(double);
DLLEXPORT double trunc(double);
#endif
/*
* BSD math library entry points
*/
#if __BSD_VISIBLE
int isnanf(float) __pure2;
DLLEXPORT int isnanf(float) __pure2;
/*
* Reentrant version of lgamma; passes signgam back by reference as the
* second argument; user must allocate space for signgam.
*/
double lgamma_r(double, int *);
DLLEXPORT double lgamma_r(double, int *);
/*
* Single sine/cosine function.
*/
void sincos(double, double *, double *);
DLLEXPORT void sincos(double, double *, double *);
#endif /* __BSD_VISIBLE */
/* float versions of ANSI/POSIX functions */
#if __ISO_C_VISIBLE >= 1999
float acosf(float);
float asinf(float);
float atanf(float);
float atan2f(float, float);
float cosf(float);
float sinf(float);
float tanf(float);
DLLEXPORT float acosf(float);
DLLEXPORT float asinf(float);
DLLEXPORT float atanf(float);
DLLEXPORT float atan2f(float, float);
DLLEXPORT float cosf(float);
DLLEXPORT float sinf(float);
DLLEXPORT float tanf(float);
float coshf(float);
float sinhf(float);
float tanhf(float);
DLLEXPORT float coshf(float);
DLLEXPORT float sinhf(float);
DLLEXPORT float tanhf(float);
float exp2f(float);
float expf(float);
float expm1f(float);
float frexpf(float, int *); /* fundamentally !__pure2 */
int ilogbf(float) __pure2;
float ldexpf(float, int);
float log10f(float);
float log1pf(float);
float log2f(float);
float logf(float);
float modff(float, float *); /* fundamentally !__pure2 */
DLLEXPORT float exp2f(float);
DLLEXPORT float expf(float);
DLLEXPORT float expm1f(float);
DLLEXPORT float frexpf(float, int *); /* fundamentally !__pure2 */
DLLEXPORT int ilogbf(float) __pure2;
DLLEXPORT float ldexpf(float, int);
DLLEXPORT float log10f(float);
DLLEXPORT float log1pf(float);
DLLEXPORT float log2f(float);
DLLEXPORT float logf(float);
DLLEXPORT float modff(float, float *); /* fundamentally !__pure2 */
float powf(float, float);
float sqrtf(float);
DLLEXPORT float powf(float, float);
DLLEXPORT float sqrtf(float);
float ceilf(float);
float fabsf(float) __pure2;
float floorf(float);
float fmodf(float, float);
float roundf(float);
DLLEXPORT float ceilf(float);
DLLEXPORT float fabsf(float) __pure2;
DLLEXPORT float floorf(float);
DLLEXPORT float fmodf(float, float);
DLLEXPORT float roundf(float);
float erff(float);
float erfcf(float);
float hypotf(float, float);
float lgammaf(float);
float tgammaf(float);
DLLEXPORT float erff(float);
DLLEXPORT float erfcf(float);
DLLEXPORT float hypotf(float, float);
DLLEXPORT float lgammaf(float);
DLLEXPORT float tgammaf(float);
float acoshf(float);
float asinhf(float);
float atanhf(float);
float cbrtf(float);
float logbf(float);
float copysignf(float, float) __pure2;
long long llrintf(float);
long long llroundf(float);
long lrintf(float);
long lroundf(float);
float nanf(const char *) __pure2;
float nearbyintf(float);
float nextafterf(float, float);
float remainderf(float, float);
float remquof(float, float, int *);
float rintf(float);
float scalblnf(float, long);
float scalbnf(float, int);
float truncf(float);
DLLEXPORT float acoshf(float);
DLLEXPORT float asinhf(float);
DLLEXPORT float atanhf(float);
DLLEXPORT float cbrtf(float);
DLLEXPORT float logbf(float);
DLLEXPORT float copysignf(float, float) __pure2;
DLLEXPORT long long llrintf(float);
DLLEXPORT long long llroundf(float);
DLLEXPORT long lrintf(float);
DLLEXPORT long lroundf(float);
DLLEXPORT float nanf(const char *) __pure2;
DLLEXPORT float nearbyintf(float);
DLLEXPORT float nextafterf(float, float);
DLLEXPORT float remainderf(float, float);
DLLEXPORT float remquof(float, float, int *);
DLLEXPORT float rintf(float);
DLLEXPORT float scalblnf(float, long);
DLLEXPORT float scalbnf(float, int);
DLLEXPORT float truncf(float);
float fdimf(float, float);
float fmaf(float, float, float);
float fmaxf(float, float) __pure2;
float fminf(float, float) __pure2;
DLLEXPORT float fdimf(float, float);
DLLEXPORT float fmaf(float, float, float);
DLLEXPORT float fmaxf(float, float) __pure2;
DLLEXPORT float fminf(float, float) __pure2;
#endif
/*
* float versions of BSD math library entry points
*/
#if __BSD_VISIBLE
float dremf(float, float);
float j0f(float);
float j1f(float);
float jnf(int, float);
float y0f(float);
float y1f(float);
float ynf(int, float);
DLLEXPORT float dremf(float, float);
DLLEXPORT float j0f(float);
DLLEXPORT float j1f(float);
DLLEXPORT float jnf(int, float);
DLLEXPORT float y0f(float);
DLLEXPORT float y1f(float);
DLLEXPORT float ynf(int, float);
/*
* Float versions of reentrant version of lgamma; passes signgam back by
* reference as the second argument; user must allocate space for signgam.
*/
float lgammaf_r(float, int *);
DLLEXPORT float lgammaf_r(float, int *);
/*
* Single sine/cosine function.
*/
void sincosf(float, float *, float *);
DLLEXPORT void sincosf(float, float *, float *);
#endif /* __BSD_VISIBLE */
/*
* long double versions of ISO/POSIX math functions
*/
#if __ISO_C_VISIBLE >= 1999
long double acoshl(long double);
long double acosl(long double);
long double asinhl(long double);
long double asinl(long double);
long double atan2l(long double, long double);
long double atanhl(long double);
long double atanl(long double);
long double cbrtl(long double);
long double ceill(long double);
long double copysignl(long double, long double) __pure2;
long double coshl(long double);
long double cosl(long double);
long double erfcl(long double);
long double erfl(long double);
long double exp2l(long double);
long double expl(long double);
long double expm1l(long double);
long double fabsl(long double) __pure2;
long double fdiml(long double, long double);
long double floorl(long double);
long double fmal(long double, long double, long double);
long double fmaxl(long double, long double) __pure2;
long double fminl(long double, long double) __pure2;
long double fmodl(long double, long double);
long double frexpl(long double value, int *); /* fundamentally !__pure2 */
long double hypotl(long double, long double);
int ilogbl(long double) __pure2;
long double ldexpl(long double, int);
long double lgammal(long double);
long long llrintl(long double);
long long llroundl(long double);
long double log10l(long double);
long double log1pl(long double);
long double log2l(long double);
long double logbl(long double);
long double logl(long double);
long lrintl(long double);
long lroundl(long double);
long double modfl(long double, long double *); /* fundamentally !__pure2 */
long double nanl(const char *) __pure2;
long double nearbyintl(long double);
long double nextafterl(long double, long double);
double nexttoward(double, long double);
float nexttowardf(float, long double);
long double nexttowardl(long double, long double);
long double powl(long double, long double);
long double remainderl(long double, long double);
long double remquol(long double, long double, int *);
long double rintl(long double);
long double roundl(long double);
long double scalblnl(long double, long);
long double scalbnl(long double, int);
long double sinhl(long double);
long double sinl(long double);
long double sqrtl(long double);
long double tanhl(long double);
long double tanl(long double);
long double tgammal(long double);
long double truncl(long double);
DLLEXPORT long double acoshl(long double);
DLLEXPORT long double acosl(long double);
DLLEXPORT long double asinhl(long double);
DLLEXPORT long double asinl(long double);
DLLEXPORT long double atan2l(long double, long double);
DLLEXPORT long double atanhl(long double);
DLLEXPORT long double atanl(long double);
DLLEXPORT long double cbrtl(long double);
DLLEXPORT long double ceill(long double);
DLLEXPORT long double copysignl(long double, long double) __pure2;
DLLEXPORT long double coshl(long double);
DLLEXPORT long double cosl(long double);
DLLEXPORT long double erfcl(long double);
DLLEXPORT long double erfl(long double);
DLLEXPORT long double exp2l(long double);
DLLEXPORT long double expl(long double);
DLLEXPORT long double expm1l(long double);
DLLEXPORT long double fabsl(long double) __pure2;
DLLEXPORT long double fdiml(long double, long double);
DLLEXPORT long double floorl(long double);
DLLEXPORT long double fmal(long double, long double, long double);
DLLEXPORT long double fmaxl(long double, long double) __pure2;
DLLEXPORT long double fminl(long double, long double) __pure2;
DLLEXPORT long double fmodl(long double, long double);
DLLEXPORT long double frexpl(long double value, int *); /* fundamentally !__pure2 */
DLLEXPORT long double hypotl(long double, long double);
DLLEXPORT int ilogbl(long double) __pure2;
DLLEXPORT long double ldexpl(long double, int);
DLLEXPORT long double lgammal(long double);
DLLEXPORT long long llrintl(long double);
DLLEXPORT long long llroundl(long double);
DLLEXPORT long double log10l(long double);
DLLEXPORT long double log1pl(long double);
DLLEXPORT long double log2l(long double);
DLLEXPORT long double logbl(long double);
DLLEXPORT long double logl(long double);
DLLEXPORT long lrintl(long double);
DLLEXPORT long lroundl(long double);
DLLEXPORT long double modfl(long double, long double *); /* fundamentally !__pure2 */
DLLEXPORT long double nanl(const char *) __pure2;
DLLEXPORT long double nearbyintl(long double);
DLLEXPORT long double nextafterl(long double, long double);
DLLEXPORT double nexttoward(double, long double);
DLLEXPORT float nexttowardf(float, long double);
DLLEXPORT long double nexttowardl(long double, long double);
DLLEXPORT long double powl(long double, long double);
DLLEXPORT long double remainderl(long double, long double);
DLLEXPORT long double remquol(long double, long double, int *);
DLLEXPORT long double rintl(long double);
DLLEXPORT long double roundl(long double);
DLLEXPORT long double scalblnl(long double, long);
DLLEXPORT long double scalbnl(long double, int);
DLLEXPORT long double sinhl(long double);
DLLEXPORT long double sinl(long double);
DLLEXPORT long double sqrtl(long double);
DLLEXPORT long double tanhl(long double);
DLLEXPORT long double tanl(long double);
DLLEXPORT long double tgammal(long double);
DLLEXPORT long double truncl(long double);
#endif /* __ISO_C_VISIBLE >= 1999 */
/* Reentrant version of lgammal. */
#if __BSD_VISIBLE
long double lgammal_r(long double, int *);
DLLEXPORT long double lgammal_r(long double, int *);
/*
* Single sine/cosine function.
*/
void sincosl(long double, long double *, long double *);
DLLEXPORT void sincosl(long double, long double *, long double *);
#endif /* __BSD_VISIBLE */
#if defined(__cplusplus)

View File

@ -47,7 +47,7 @@ C9 = 0.4110317413744594971475941557607804508039e-18,
C10 = -0.8896592467191938803288521958313920156409e-21,
C11 = 0.1601061435794535138244346256065192782581e-23;
DLLEXPORT long double
long double
__kernel_cosl(long double x, long double y)
{
long double hz,z,r,w;

View File

@ -45,7 +45,7 @@ S10 = 0.19572940011906109418080609928334380560135358385256e-19,
S11 = -0.38680813379701966970673724299207480965452616911420e-22,
S12 = 0.64038150078671872796678569586315881020659912139412e-25;
DLLEXPORT long double
long double
__kernel_sinl(long double x, long double y, int iy)
{
long double z,r,v;

View File

@ -62,7 +62,7 @@ T53 = 0.0000000015468200913196612, /* 0x1a92fc98c29554.0p-82 */
T55 = -0.00000000061311613386849674, /* -0x151106cbc779a9.0p-83 */
T57 = 1.4912469681508012e-10; /* 0x147edbdba6f43a.0p-85 */
DLLEXPORT long double
long double
__kernel_tanl(long double x, long double y, int iy) {
long double z, r, v, w, s;
long double osign;

View File

@ -65,7 +65,7 @@ C5 = 0.0000000020876754400407278, /* 0x11eed8caaeccf1.0p-81 */
C6 = -1.1470297442401303e-11, /* -0x19393412bd1529.0p-89 */
C7 = 4.7383039476436467e-14; /* 0x1aac9d9af5c43e.0p-97 */
DLLEXPORT long double
long double
__kernel_cosl(long double x, long double y)
{
long double hz,z,r,w;

View File

@ -49,7 +49,7 @@ S6 = 1.6059006598854211e-10, /* 0x161242b90243b5.0p-85 */
S7 = -7.6429779983024564e-13, /* -0x1ae42ebd1b2e00.0p-93 */
S8 = 2.6174587166648325e-15; /* 0x179372ea0b3f64.0p-101 */
DLLEXPORT long double
long double
__kernel_sinl(long double x, long double y, int iy)
{
long double z,r,v;

View File

@ -70,7 +70,7 @@ T29 = 0.0000078293456938132840, /* 0x106b59141a6cb3.0p-69 */
T31 = -0.0000032609076735050182, /* -0x1b5abef3ba4b59.0p-71 */
T33 = 0.0000023261313142559411; /* 0x13835436c0c87f.0p-71 */
DLLEXPORT long double
long double
__kernel_tanl(long double x, long double y, int iy) {
long double z, r, v, w, s;
long double osign;

View File

@ -77,7 +77,7 @@ static const double xxx[] = {
#define T xxx
/* INDENT ON */
DLLEXPORT double
double
__kernel_tan(double x, double y, int iy) {
double z, r, v, w, s;
int32_t ix, hx;

View File

@ -355,6 +355,7 @@ long double __kernel_sinl(long double, long double, int);
long double __kernel_cosl(long double, long double);
long double __kernel_tanl(long double, long double, int);
#undef DLLEXPORT
#ifdef _WIN32
# ifdef IMPORT_EXPORTS
# define DLLEXPORT __declspec(dllimport)
@ -365,4 +366,5 @@ long double __kernel_tanl(long double, long double, int);
#define DLLEXPORT __attribute__ ((visibility("default")))
#endif
#endif /* !_MATH_PRIVATE_H_ */