You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Conflicting typedef of ssize_t on Windows 32 bit when using Boost.Python #204
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!
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.
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!
Activity
try to replace ssize_t occurrences with std::ptrdiff_t (for #204)
try to replace std::ptrdiff_t with auto (for #204)
nlohmann commentedon Feb 10, 2016
Hi @phogy, thanks for reporting the issue! In fact, we did not use
ssize_tat all and I could remove it from the code. It would be great if you could check if the warning disappeared now.phogy commentedon Feb 11, 2016
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!
nlohmann commentedon Feb 11, 2016
Cool!