Hi Paolo. I'm trying to use your poll replacement. I have rewritten gnutls-cli to use poll, and it works fine under debian. However, building under mingw32 fails. With your original patch I get compile errors.
What do you think about writing a gnulib self-test that tests whether poll works correctly? It would help to test the replacement function on various platforms quicker, and also helps catch regression. I suspect writing a self test may be somewhat complicated though, you'll need to setup at least two sockets, poll them, and read/write from/to them a couple of times. Alas, I have little time to develop this right now, but can test things if you work on it. Initial patch: ../../../src/gnutls-2.5.4/gl/poll.c: In function 'win32_compute_revents': ../../../src/gnutls-2.5.4/gl/poll.c:78: error: 'bRet' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c:78: error: (Each undeclared identifier is reported only once ../../../src/gnutls-2.5.4/gl/poll.c:78: error: for each function it appears in.) ../../../src/gnutls-2.5.4/gl/poll.c:82: warning: implicit declaration of function 'alloca' ../../../src/gnutls-2.5.4/gl/poll.c:82: warning: incompatible implicit declaration of built-in function 'alloca' ../../../src/gnutls-2.5.4/gl/poll.c: In function 'win32_compute_revents_socket': ../../../src/gnutls-2.5.4/gl/poll.c:117: error: 'ENOTCONN' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c: In function 'rpl_poll': ../../../src/gnutls-2.5.4/gl/poll.c:322: error: 'FD_SET_SIZE' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c:352: error: 'h' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c:353: warning: implicit declaration of function 'assert' ../../../src/gnutls-2.5.4/gl/poll.c:354: error: 'optlen' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c:415: error: incompatible type for argument 2 of 'select' ../../../src/gnutls-2.5.4/gl/poll.c:415: error: incompatible type for argument 3 of 'select' ../../../src/gnutls-2.5.4/gl/poll.c:415: error: incompatible type for argument 4 of 'select' And with your latest patch I get this error: ../../../src/gnutls-2.5.4/gl/poll.c:79: error: expected specifier-qualifier-list before 'NTSTATUS' ../../../src/gnutls-2.5.4/gl/poll.c:81: warning: declaration does not declare anything ../../../src/gnutls-2.5.4/gl/poll.c:87: error: expected declaration specifiers or '...' before '*' token ../../../src/gnutls-2.5.4/gl/poll.c:88: error: expected declaration specifiers or '...' before 'FILE_INFORMATION_CLASS' ../../../src/gnutls-2.5.4/gl/poll.c:88: warning: type defaults to 'int' in declaration of 'NTSTATUS' ../../../src/gnutls-2.5.4/gl/poll.c:88: error: 'NTSTATUS' declared as function returning a function ../../../src/gnutls-2.5.4/gl/poll.c: In function 'win32_compute_revents': ../../../src/gnutls-2.5.4/gl/poll.c:104: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'NtQueryInformationFile' ../../../src/gnutls-2.5.4/gl/poll.c:104: error: 'NtQueryInformationFile' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c:104: error: (Each undeclared identifier is reported only once ../../../src/gnutls-2.5.4/gl/poll.c:104: error: for each function it appears in.) ../../../src/gnutls-2.5.4/gl/poll.c:114: error: 'PNtQueryInformationFile' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c:115: error: expected ';' before 'GetProcAddress' ../../../src/gnutls-2.5.4/gl/poll.c:134: warning: implicit declaration of function 'NtQueryInformationFile' ../../../src/gnutls-2.5.4/gl/poll.c:145: error: 'bRet' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c:149: warning: implicit declaration of function 'alloca' ../../../src/gnutls-2.5.4/gl/poll.c:149: warning: incompatible implicit declaration of built-in function 'alloca' ../../../src/gnutls-2.5.4/gl/poll.c: In function 'win32_compute_revents_socket': ../../../src/gnutls-2.5.4/gl/poll.c:188: error: 'ENOTCONN' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c: In function 'rpl_poll': ../../../src/gnutls-2.5.4/gl/poll.c:393: error: 'FD_SET_SIZE' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c:424: error: 'h' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c:425: warning: implicit declaration of function 'assert' ../../../src/gnutls-2.5.4/gl/poll.c:426: error: 'optlen' undeclared (first use in this function) ../../../src/gnutls-2.5.4/gl/poll.c:487: error: incompatible type for argument 2 of 'select' ../../../src/gnutls-2.5.4/gl/poll.c:487: error: incompatible type for argument 3 of 'select' ../../../src/gnutls-2.5.4/gl/poll.c:487: error: incompatible type for argument 4 of 'select' Thanks, Simon
