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

feat(winapi): add winsock2 #680

Closed

Conversation

ReenigneArcher
Copy link
Contributor

@ReenigneArcher ReenigneArcher commented Oct 19, 2024

This PR aims to add winsock2 from the winapi, which is a requirement for using enet. (#453)

This is basically from JayFoxRox#84, but I had to adjust the flags in the Makefile in order to find #include <pktdrv.h> in winsock.c. I've added Jay as a co-author so they get the proper credit.

Note: I was not 100% successful in building enet using this yet. I am facing the following error.

-- Configuring done (0.7s)
-- Generating done (0.1s)
-- Build files have been written to: /c/Users/ReenigneArcher/Documents/GitHub/LizardByte/mnxb/build
[  2%] Building C object third-party/moonlight-common-c/enet/CMakeFiles/enet.dir/callbacks.c.obj
In file included from C:/Users/ReenigneArcher/Documents/GitHub/LizardByte/mnxb/third-party/moonlight-common-c/enet/callbacks.c:6:
In file included from C:/Users/ReenigneArcher/Documents/GitHub/LizardByte/mnxb/third-party/moonlight-common-c/enet/include/enet/enet.h:16:
In file included from C:/Users/ReenigneArcher/Documents/GitHub/LizardByte/mnxb/third-party/moonlight-common-c/enet/include/enet/win32.h:20:
In file included from C:/Users/ReenigneArcher/Documents/GitHub/LizardByte/mnxb/third-party/nxdk/lib/winapi/ws2_32/winsock2.h:12:
In file included from C:/Users/ReenigneArcher/Documents/GitHub/LizardByte/mnxb/third-party/nxdk/lib/net/lwip/src/include/lwip/sockets.h:42:
C:/Users/ReenigneArcher/Documents/GitHub/LizardByte/mnxb/third-party/nxdk/lib/net/lwip/src/include/lwip/opt.h:51:10: fatal error:
      'lwipopts.h' file not found
   51 | #include "lwipopts.h"
      |          ^~~~~~~~~~~~
1 error generated.
make[2]: *** [third-party/moonlight-common-c/enet/CMakeFiles/enet.dir/build.make:75: third-party/moonlight-common-c/enet/CMakeFiles/enet.dir/callbacks.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:225: third-party/moonlight-common-c/enet/CMakeFiles/enet.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I am no expert on lwip, actually never even heard of it, but I guess it's looking for an options file as a header. I guess it would be good to include a default lwipopts.h file as I expect many others would have no clue what it is either. Open to suggestions on that, and could use some guidance on getting this PR ready to merge.

Co-Authored-By: Jannik Vogel <[email protected]>
@thrimbor
Copy link
Member

As jfr himself said in JayFoxRox#84, this code is not in an upstreamable state. The winsock code specifically includes fixme's, is incomplete, based on the deprecated NIC driver and hasn't been kept up to date with changes in nxdk for years (ftr the same applies to https://github.com/thrimbor/nxdk/tree/winsock)

@ReenigneArcher ReenigneArcher marked this pull request as draft October 19, 2024 16:36
@ReenigneArcher
Copy link
Contributor Author

I was not aware of your winsock branch. Seems much closer to being complete, so I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants