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

Closed
afpgit opened this issue Feb 29, 2024 · 3 comments · Fixed by #2342
Closed

ssize_t: redefinition; different basic types #2209

afpgit opened this issue Feb 29, 2024 · 3 comments · Fixed by #2342
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
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 29, 2024
…compatibility

This change updates the ssize_t type to iox_ssize_t in Windows-specific files to resolve a compatibility issue. It ensures consistent type usage and includes the necessary headers for type definitions.
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
Reported problem with ssize_t redefinition causing different basic types
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
Updated ssize_t to iox_ssize_t in socket.hpp
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
Change the type definition of mqd_t from int to iox_ssize_t
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
…ceive

The return type has been modified from ssize_t to mqd_t
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
Replaced standard ssize_t with iox_ssize_t
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
The unused types.hpp header has been removed from unistd.hpp
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
khromenokroman added a commit to khromenokroman/iceoryx that referenced this issue Aug 30, 2024
elBoberido added a commit that referenced this issue Aug 31, 2024
iox-#2209 Refactor ssize_t to iox_ssize_t for Windows compatibility
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

Successfully merging a pull request may close this issue.

2 participants