Skip to content

Commit

Permalink
iox-#2209 Fix include and change ssize_t to iox_ssize_t
Browse files Browse the repository at this point in the history
iox-#2209 Fix include and change ssize_t to iox_ssize_t
  • Loading branch information
khromenokroman committed Aug 30, 2024
1 parent 1549c96 commit 14d6e9b
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 21 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ jobs:
needs: pre-flight-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Unix (FreeBSD) test
id: Test
uses: vmactions/freebsd-vm@v1
with:
release: "14.0"
copyback: false
prepare: pkg install -y cmake git ncurses bash wget bison
run: |
git config --global --add safe.directory /home/runner/work/iceoryx/iceoryx
./tools/ci/build-test-freebsd.sh
- uses: actions/checkout@v4
- name: Unix (FreeBSD) test
id: Test
uses: vmactions/freebsd-vm@v1
with:
release: "14.0"
copyback: false
prepare: pkg install -y cmake git ncurses bash wget bison
run: |
git config --global --add safe.directory /home/runner/work/iceoryx/iceoryx
./tools/ci/build-test-freebsd.sh
run-integration-test:
# prevent stuck jobs consuming runners for 6 hours
Expand Down
2 changes: 1 addition & 1 deletion doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
- 'iox::string' tests can exceed the translation unit compilation timeout [#2278](https://github.com/eclipse-iceoryx/iceoryx/issues/2278)
- Building iceoryx with bazel on Windows is broken [#2320](https://github.com/eclipse-iceoryx/iceoryx/issues/2320)
- Fix wrong memory orders in SpscSoFi [#2177](https://github.com/eclipse-iceoryx/iceoryx/issues/2177)
-
- ssize_t: redefinition; different basic types [#2209](https://github.com/eclipse-iceoryx/iceoryx/issues/2209)

**Refactoring:**

Expand Down
2 changes: 1 addition & 1 deletion iceoryx_platform/win/include/iceoryx_platform/acl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ inline int acl_add_perm(acl_permset_t permset_d, acl_perm_t perm)
return 0;
}

inline char* acl_to_text(acl_t acl, ssize_t* len_p)
inline char* acl_to_text(acl_t acl, iox_ssize_t* len_p)
{
return nullptr;
}
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_platform/win/include/iceoryx_platform/mqueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ inline int mq_close(mqd_t mqdes)
//{
//}

inline ssize_t mq_receive(mqd_t mqdes, char* msg_ptr, size_t msg_len, unsigned int* msg_prio)
inline iox_ssize_t mq_receive(mqd_t mqdes, char* msg_ptr, size_t msg_len, unsigned int* msg_prio)
{
return 0;
}

inline ssize_t
inline iox_ssize_t
mq_timedreceive(mqd_t mqdes, char* msg_ptr, size_t msg_len, unsigned int* msg_prio, const struct timespec* abs_timeout)
{
return 0;
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_platform/win/include/iceoryx_platform/socket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ using sa_family_t = int;
int iox_bind(int sockfd, const struct sockaddr* addr, socklen_t addrlen);
int iox_socket(int domain, int type, int protocol);
int iox_setsockopt(int sockfd, int level, int optname, const void* optval, socklen_t optlen);
ssize_t
iox_ssize_t
iox_sendto(int sockfd, const void* buf, size_t len, int flags, const struct sockaddr* dest_addr, socklen_t addrlen);
ssize_t iox_recvfrom(int sockfd, void* buf, size_t len, int flags, struct sockaddr* src_addr, socklen_t* addrlen);
iox_ssize_t iox_recvfrom(int sockfd, void* buf, size_t len, int flags, struct sockaddr* src_addr, socklen_t* addrlen);
int iox_connect(int sockfd, const struct sockaddr* addr, socklen_t addrlen);
int iox_closesocket(int sockfd);

Expand Down
4 changes: 3 additions & 1 deletion iceoryx_platform/win/include/iceoryx_platform/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ using iox_gid_t = int;
using iox_uid_t = int;
#if defined(_MSC_VER)
using mode_t = int;
using ssize_t = size_t;
using iox_ssize_t = int;
using pid_t = int;
#elif defined(__MINGW32__) || defined(__MINGW64__)
using iox_ssize_t = ssize_t;
#endif
using nlink_t = int;
using blksize_t = int;
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_platform/win/include/iceoryx_platform/unistd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#endif

using iox_off_t = long;
using iox_ssize_t = int;

#define IOX_F_OK 0
#define IOX_X_OK 1
Expand All @@ -55,4 +54,5 @@ iox_ssize_t iox_write(int fd, const void* buf, size_t count);
iox_gid_t iox_getgid(void);
iox_uid_t iox_geteuid(void);


#endif // IOX_HOOFS_WIN_PLATFORM_UNISTD_HPP
5 changes: 3 additions & 2 deletions iceoryx_platform/win/source/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "iceoryx_platform/socket.hpp"
#include "iceoryx_platform/logging.hpp"
#include "iceoryx_platform/types.hpp"
#include <cstdio>

int iox_bind(int sockfd, const struct sockaddr* addr, socklen_t addrlen)
Expand All @@ -36,14 +37,14 @@ int iox_setsockopt(int sockfd, int level, int optname, const void* optval, sockl
return 0;
}

ssize_t
iox_ssize_t
iox_sendto(int sockfd, const void* buf, size_t len, int flags, const struct sockaddr* dest_addr, socklen_t addrlen)
{
IOX_PLATFORM_LOG(IOX_PLATFORM_LOG_LEVEL_ERROR, "'iox_sendto' is not implemented in windows!");
return 0;
}

ssize_t iox_recvfrom(int sockfd, void* buf, size_t len, int flags, struct sockaddr* src_addr, socklen_t* addrlen)
iox_ssize_t iox_recvfrom(int sockfd, void* buf, size_t len, int flags, struct sockaddr* src_addr, socklen_t* addrlen)
{
IOX_PLATFORM_LOG(IOX_PLATFORM_LOG_LEVEL_ERROR, "'iox_recvfrom' is not implemented in windows!");
return 0;
Expand Down
1 change: 1 addition & 0 deletions iceoryx_platform/win/source/unistd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "iceoryx_platform/mman.hpp"
#include "iceoryx_platform/win32_errorHandling.hpp"


int iox_ftruncate(int fildes, off_t length)
{
internal_iox_shm_set_size(fildes, length);
Expand Down

0 comments on commit 14d6e9b

Please sign in to comment.