On 17.07.2015 18:29, Bruno Jesus wrote:
Try to apply Matteo's idea to not redefine the struct when port.h was already included. I can't test in mingw myself unfortunately.
I don't think this will work properly. The Linux pollfd struct contains "fd" with type "int", but on Windows its defined as "SOCKET" (which has size of a pointer). My personal preference would be to just leave out the "struct pollfd" definition here, and only declare WSAPOLLFD. Basically:
+typedef struct +{ + SOCKET fd; + SHORT events; + SHORT revents; +} WSAPOLLFD;
Not sure if this would be an acceptable solution for the other devs though.
On Monday, July 20, 2015, Sebastian Lackner sebastian@fds-team.de wrote:
On 17.07.2015 18:29, Bruno Jesus wrote:
Try to apply Matteo's idea to not redefine the struct when port.h was already included. I can't test in mingw myself unfortunately.
I don't think this will work properly. The Linux pollfd struct contains "fd" with type "int", but on Windows its defined as "SOCKET" (which has size of a pointer). My personal preference would be to just leave out the "struct pollfd" definition here, and only declare WSAPOLLFD. Basically:
+typedef struct +{
- SOCKET fd;
- SHORT events;
- SHORT revents;
+} WSAPOLLFD;
Not sure if this would be an acceptable solution for the other devs though.
Sounds perfect to me, thanks. Will resend soon.