Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssize_t: redefinition; different basic types #2209

Open
afpgit opened this issue Feb 29, 2024 · 3 comments
Open

ssize_t: redefinition; different basic types #2209

afpgit opened this issue Feb 29, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@afpgit
Copy link

afpgit commented Feb 29, 2024

Required information

Operating system:
Windows 11

Compiler version:
Visual Studio 2022 Community

Eclipse iceoryx version:
v2.0.3

Observed result or behaviour:
Error C2371: ssize_t: redefinition; different basic types

C:\Dev\vcpkg\installed\x64-windows\include\iceoryx\v2.0.3\iceoryx_hoofs/platform/types.hpp(25): error C2371: 'ssize_t': redefinition; different basic types 
C:\Dev\vcpkg\installed\x64-windows\include\httplib.h(137): note: see declaration of 'ssize_t'

The iceoryx definition using ssize_t = size_t; versus that of cpp-httplib:

#if defined(_MSC_VER)
#if _MSC_VER < 1900
#error Sorry, Visual Studio versions prior to 2015 are not supported
#endif

#pragma comment(lib, "ws2_32.lib")

#ifdef _WIN64
using ssize_t = __int64;
#else
using ssize_t = long;
#endif
#endif // _MSC_VER

Expected result or behaviour:
Is there anyway around this redefinition of ssize_t along with this header-only library: cpp-httplib?

@elBoberido
Copy link
Member

There is a iox_ssize_t defined in unistd.hpp.

I think we can move that definition to types.hpp and use everywhere on the Windows platform iox_ssize_t.

Might also be a good idea to use __int64 on 64 bit.

Do you want to create a PR?

@afpgit
Copy link
Author

afpgit commented Feb 29, 2024

Yes, I will create a PR.

Which branch should the PR be based on? Originally, I used vcpkg that installs iceoryx version v2.0.3.

@elBoberido
Copy link
Member

Can you target the master branch?

Not sure we will do another 2.0.x release since the 3.0.0 release is not far away.

@elBoberido elBoberido added the bug Something isn't working label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants