bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inttypes and MSVC


From: Bruno Haible
Subject: Re: inttypes and MSVC
Date: Mon, 18 Sep 2017 22:03:17 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-93-generic; KDE/5.18.0; x86_64; ; )

Hi Gisle,

> I'm wondering about stuff like this; in inttypes.h.in (line 1093):
> 
>    _GL_CXXALIAS_RPL (strtoimax, intmax_t, (const char *, char **, int));
>    # else
>    #  if address@hidden@
>    #   undef strtoimax
>    _GL_FUNCDECL_SYS (strtoimax, intmax_t,
>                      (const char *, char **, int) _GL_ARG_NONNULL ((1)));
>    #  endif
> 
> Why is there a '#undef strtoimax' if there is *NO* declaration for
> 'strtoimax()'? Isn't 'HAVE_DECL_STRTOIMAX' supposed to be TRUE is so?
> 
> If it was vice-versa:
>    #  if @HAVE_DECL_STRTOIMAX@
>    #   undef strtoimax
>    _GL_FUNCDECL_SYS (strtoimax, intmax_t,
>                      (const char *, char **, int) _GL_ARG_NONNULL ((1)));
>    #  endif
> 
> I'd understand it better. Ditto for 'strtoumax()'.

The idioms that we use for function declarations in the *.in.h files are
designed to work
  - regardless whether the system headers declare the function or not,
    define the function as an inline function or not, or declare the symbol
    as a macro or not,
  - both in  C and C++.

The situations where HAVE_DECL_XXX are set to 1 are described in [1].

If some header file does, say,
  #define strtoimax(p,e,b) (long long) strtoll ((p),(char**)(e),(b))
then HAVE_DECL_STRTOIMAX will definitely be 0.

Instead of you wondering about these issues on your own, it is probably
better if you show
  - the error that you observe,
  - the relevant snippet from the gnulib-generated substitute .h file,
  - the relevant definitions from config.status, config.h, in combination
    with the config.log and the 'configure' output.
We can then analyze it together.

In a testdir from July 2017, with MSVC 14, I have these settings in
config.status:
S["REPLACE_STRTOIMAX"]="0"
S["HAVE_DECL_STRTOIMAX"]="1"
S["GNULIB_STRTOIMAX"]="1"
D["HAVE_STRTOIMAX"]=" 1"
D["HAVE_RAW_DECL_STRTOIMAX"]=" 1"
D["HAVE_DECL_STRTOIMAX"]=" 1"

Is it different for you?

Bruno

[1] 
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Generic-Declarations.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]