paullouisageneau / libjuice

JUICE is a UDP Interactive Connectivity Establishment library
Mozilla Public License 2.0
432 stars 82 forks source link

Use SENETUNREACH to fix some windows builds #225

Closed Faless closed 1 year ago

Faless commented 1 year ago

In src/socket.h SENETUNREACH is already defined as WSAENETUNREACH on Windows and ENETUNREACH on Linux.

While I'm unable to reproduce the build error locally (likely due to different mingw versions), I'm seeing github actions failing for the Godot WebRTC plugin here.

/home/runner/work/webrtc-native/webrtc-native/thirdparty/libdatachannel/deps/libjuice/src/agent.c:1601:14: error: 'ENETUNREACH' undeclared (first use in this function); did you mean 'SENETUNREACH'?
 1601 |   if (ret == ENETUNREACH)
      |              ^~~~~~~~~~~
      |              SENETUNREACH

Looking at src/socket.h I can see that it was properly set up to handle the different WSA/Posix socket cases correctly already:

https://github.com/paullouisageneau/libjuice/blob/a1f4037aec9353ac3928ce4dcda1229b68db64b2/src/socket.h#L59

and

https://github.com/paullouisageneau/libjuice/blob/a1f4037aec9353ac3928ce4dcda1229b68db64b2/src/socket.h#L108

paullouisageneau commented 1 year ago

Released as v1.3.3