mtheall / ftpd

FTP Server for 3DS/Switch
GNU General Public License v3.0
1.37k stars 132 forks source link

fix build with latest libnx #177

Closed justinkb closed 4 months ago

electrus89 commented 4 months ago

I can confirm when making the same change with my copy of the repo that it compiles. It appears that libnx has removed the bsdsockets_version field, so setting that field causes an compile-time failure.

eku commented 4 months ago

How do you define which version of linbx is used for compilation? The change breaks the build with an older version. The code should be able to do both.

justinkb commented 4 months ago

@eku I'm pretty sure it's just assumed in the switch homebrew scene that you will use the latest available libnx from devkitpro, and if not, you're on your own. I don't see any defines in the libnx includes that would allow a C preprocessor to determine the libnx version easily. I may be wrong though

electrus89 commented 4 months ago

It appears the structure affected changed with an October commit to libnx. libnx started autodetecting the bsdsockets version with this commit, which breaks the code at issue here.

I agree with the conclusion @justinkb came to being unable to use the preprocessor directives (specifically, no defines). There are five pages of results, but none of them refer to a preprocessor directive referring to the library version.

mtheall commented 4 months ago

This is fixed in the cmake branch which will eventually be merged