luasocket icon indicating copy to clipboard operation
luasocket copied to clipboard

Remove obsolete typedef from compatibility file

Open DarkWiiPlayer opened this issue 4 years ago • 5 comments

MinGWs ws2tcpip.h already defines socklen_t, making this redundant. What's more, in a recent version of MinGW this has changed to unsigned int, breaking compatibility. See issue #302

I tried looking through the git log to see if there was a reason for this being there, but all I could find was in f3305405 it was added without a comment, under the commit message

Compiles and runs on linux and windows, using DLLs!

That was in 2003 using who knows which version of MinGW 😖

Thus, I assume it is OK to just remove this typedef altogether, but it'd be nice if someone could actually confirm this (Ideally, clarify why this was added in the first place)

DarkWiiPlayer avatar Mar 30 '20 09:03 DarkWiiPlayer

Is there a macro we can test, for use in an #ifdef, in order to continue supporting older environments that might still require this typedef?

ewestbrook avatar Mar 30 '20 18:03 ewestbrook

I actually have no idea. I went through the code and didn't find anything and I grepped for version, 53, 5.3 and a few other combinations to see if there was some convenient typedef somewhere in the codebase but didn't find anything.

But again, I don't know if it's even necessary for the typedef to be there in the first place.

DarkWiiPlayer avatar Mar 30 '20 18:03 DarkWiiPlayer

Why have we never heard of this problem when compiling under Windows? Is this a mingw problem?

diegonehab avatar Apr 01 '20 00:04 diegonehab

Well, for one because the MinGW version that changed it was released in the beginning of this month (Version 5.3, iirc). Other than that, no idea. if by "compiling under windows" you mean microsofts compiler, I have never used that, so I couldn't tell you either.

DarkWiiPlayer avatar Apr 01 '20 05:04 DarkWiiPlayer

How to resolve this issue?

limjiregister avatar Jun 01 '20 11:06 limjiregister