Skip to content

JSON_INTEGER_IS_LONG_LONG is part of API but it differs between cmake & autotools (2.14) #696

@ChenQi1989

Description

@ChenQi1989

I'm working on Yocto project and it's easy for Yocto to switch build system for jansson. The version I use is 2.14.
Then I found that JSON_INTEGER_IS_LONG_LONG differs across different build systems (cmake v.s. autotools).

I can see that there are codes related to this, e.g.,
#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */ #if JSON_INTEGER_IS_LONG_LONG #ifdef _WIN32 #define JSON_INTEGER_FORMAT "I64d" #else #define JSON_INTEGER_FORMAT "lld" #endif typedef long long json_int_t; #else #define JSON_INTEGER_FORMAT "ld" typedef long json_int_t; #endif /* JSON_INTEGER_IS_LONG_LONG */ #endif

But this macro is part of API. We can see this from the doc/apiref.rst.

So if this macro is part of API, then IMHO it should not differ merely because the build system changes.

There's a commit in master branch, 8b975ab (Use dtoa for double to string conversion), that adds JSON_INTEGER_IS_LONG_LONG for cmake. So after this commit, this macro start to become consistent across different build systems.

I have three questions (sorry if that's too many):

  1. What's the maintenance attitude towards JSON_INTEGER_IS_LONG_LONG macro? Should it remains as part of API and keeps consistent across different build systems?
  2. With 8b975ab, should we remove the above JASSON_USING_CMAKE code block?
  3. There's 2.13 branch, but there's no 2.14 branch. Should we create 2.14 branch and extract part of 8b975ab (the JSON_INTEGER_IS_LONG_LONG part) and put it in the 2.14 branch?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions