Skip to content

Conflicting typedef of ssize_t on Windows 32 bit when using Boost.Python #204

Closed

Description

@phogy

I'm currently evaluating your JSON library for use in a project that also uses Boost.Python to expose an API to the app as a Python class. I'm compiling with Python 2.7.11 and Boost.Python in turn includes its pyconfig.h, which typedefs ssize_t as an int.
I'm not entirely sure whether Python or your hpp is correct here but your inclusion of basetsd.h and consequtive using definition of ssize_t to its SSIZE_T, attempts to redefine it as a long. This is during Windows 32 bit compilation on Visual Studio 2015.

json\src\json.hpp(53): error C2371: 'ssize_t': redefinition; different basic types

Thanks in advance for any help or comments about this!

Activity

  1. added this to the Release 2.0.0 milestone on Feb 10, 2016
  2. self-assigned this
    on Feb 10, 2016
  3. nlohmann commented on Feb 10, 2016

    @nlohmann
    Owner

    Hi @phogy, thanks for reporting the issue! In fact, we did not use ssize_t at all and I could remove it from the code. It would be great if you could check if the warning disappeared now.

  4. phogy commented on Feb 11, 2016

    @phogy
    Author

    Thanks for your swift action on this! Impressive.
    I recompiled for Win 32-bit without any problems now. Still one wonders why pyconfig.h sets it to int...
    Thanks again!

  5. nlohmann commented on Feb 11, 2016

    @nlohmann
    Owner

    Cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions