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 !@HAVE_COSF@ << 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