Skip to content

Commit

Permalink
[#81] Fix socket_macros header for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Jan 14, 2024
1 parent 92f4fed commit 8dc38e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion iceoryx2-pal/posix/src/c/socket_macros.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

#ifdef _WIN64
#include <MSWSock.h>
// clang-format off
// the include order is important, since some headers are defining macros that
// are used in the next header
#include <WinSock2.h>
#include <Windows.h>
#include <MSWSock.h>
#include <io.h>
// clang-format on
#else
#include <sys/select.h>
#include <sys/socket.h>
Expand Down
12 changes: 6 additions & 6 deletions iceoryx2-pal/posix/src/windows/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,17 @@ impl Struct for sched_param {}
#[derive(Clone, Copy)]
#[repr(C)]
pub struct sigaction_t {
pub sa_handler: sighandler_t,
pub sa_mask: sigset_t,
pub sa_flags: int,
pub iox2_sa_handler: sighandler_t,
pub iox2_sa_mask: sigset_t,
pub iox2_sa_flags: int,
}

impl Struct for sigaction_t {
fn new() -> Self {
Self {
sa_handler: 0,
sa_mask: sigset_t::new(),
sa_flags: 0,
iox2_sa_handler: 0,
iox2_sa_mask: sigset_t::new(),
iox2_sa_flags: 0,
}
}
}
Expand Down

0 comments on commit 8dc38e8

Please sign in to comment.