Guest User

Untitled

a guest
Feb 16th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. diff -Naur ocaml-3.12.1.orig/otherlibs/win32unix/socket.c ocaml-3.12.1/otherlibs/win32unix/socket.c
  2. --- ocaml-3.12.1.orig/otherlibs/win32unix/socket.c 2010-01-22 12:48:24.000000000 +0000
  3. +++ ocaml-3.12.1/otherlibs/win32unix/socket.c 2011-11-14 12:49:18.000000000 +0000
  4. @@ -17,7 +17,7 @@
  5. #include "unixsupport.h"
  6.  
  7. int socket_domain_table[] = {
  8. - PF_UNIX, PF_INET
  9. + PF_UNIX, PF_INET /*, PF_INET6 */
  10. };
  11.  
  12. int socket_type_table[] = {
  13. @@ -30,6 +30,12 @@
  14. SOCKET s;
  15. int oldvalue, oldvaluelen, newvalue, retcode;
  16.  
  17. + /* IPv6 requires WinSock2, we must raise an error on PF_INET6 */
  18. + if (Int_val(domain) >= sizeof(socket_domain_table)/sizeof(int)) {
  19. + win32_maperr(WSAEPFNOSUPPORT);
  20. + uerror("socket", Nothing);
  21. + }
  22. +
  23. oldvaluelen = sizeof(oldvalue);
  24. retcode = getsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
  25. (char *) &oldvalue, &oldvaluelen);
Add Comment
Please, Sign In to add comment