[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Confused aboth math.in.h
From: |
Gisle Vanem |
Subject: |
Confused aboth math.in.h |
Date: |
Sat, 22 Nov 2014 20:53:44 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:33.0) Gecko/20100101 Firefox/33.0 SeaMonkey/2.30 |
I'm trying to understand the logic behind the generation
of some statements in math.h (from math.in.h). The MSVC
compiler has cosf() defined as a macro in it's <math.h>:
#define cosf(x) ((float)cos((double)(x)))
(for x86,C). Then how is Gnulib supposed to replace that?
Since no matter what's put in Gnulib's "math.h", the
preprocessed output of cosf.c contains this rubbish:
extern int gl_signbitl (long double arg);
float
((float)cos((double)(float x))) << MSVC's macro for cosf()
{
return (float) cos ((double) x);
}
Isn't there supposed to be an "#undef cosf" in "math.h"
in this case? All I see is:
# if address@hidden@ << line 448
# undef cosf
I assume if some vendor have 'cosf' it should be undefined
before Gnulib is trying to override or replace it. Not vice
versa. So shouldn't this be:
# if @HAVE_COSF@ || @REPLACE_COSF@
# undef cosf
Also, in test-cosf.c, the
SIGNATURE_CHECK (cosf, float, (float));
doesn't compile/link as it is here now (this macro cannot
contain another macro). Or maybe test-cosf.c isn't supposed
to be compiled for MSVC?
Please help me resolve my confusion.
Same for coshf(), cosl() etc. AFAICS.
--
--gv
- Confused aboth math.in.h,
Gisle Vanem <=