Skip to content

Commit

Permalink
Fix type error (libslirp 32-bit)
Browse files Browse the repository at this point in the history
  • Loading branch information
maron2000 committed Jun 10, 2024
1 parent b33321f commit 647e6a9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mingw32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
msystem: MINGW32
update: true
install: git make base-devel mingw-w64-i686-toolchain mingw-w64-i686-libtool mingw-w64-i686-nasm autoconf automake mingw-w64-i686-ncurses mingw-w64-i686-binutils
install: git make base-devel mingw-w64-i686-toolchain mingw-w64-i686-libtool mingw-w64-i686-nasm autoconf automake mingw-w64-i686-ncurses mingw-w64-i686-binutils mingw-w64-i686-libslirp
- name: Install libslirp
if: false
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
with:
msystem: MINGW32
update: true
install: git mingw-w64-i686-toolchain mingw-w64-i686-libtool mingw-w64-i686-nasm autoconf automake
install: git mingw-w64-i686-toolchain mingw-w64-i686-libtool mingw-w64-i686-nasm autoconf automake mingw-w64-i686-libslirp
- name: Update build info
shell: bash
run: |
Expand Down
8 changes: 7 additions & 1 deletion src/misc/ethernet_slirp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ int inet_pton_win(int af, const char* src, void* dst)
* object. This is done by passing our SlirpEthernetConnection as user data.
*/

ssize_t slirp_receive_packet(const void* buf, size_t len, void* opaque)
// libslirp >= 4.8.0 defines slirp_ssize_t but will break compatibility with older versions
#ifdef _WIN32
SSIZE_T
#else
ssize_t
#endif
slirp_receive_packet(const void* buf, size_t len, void* opaque)
{
SlirpEthernetConnection* conn = (SlirpEthernetConnection*)opaque;
conn->ReceivePacket((const uint8_t*)buf, len);
Expand Down

0 comments on commit 647e6a9

Please sign in to comment.