Explicitly cast INVALID_SOCKET to (int) to address warnings on Windows.
[openssl.git] / e_os.h
diff --git a/e_os.h b/e_os.h
index 8c4223bc532425127628bcc5f9203775a16c17e8..6aa0f73ed068f5b08b3f23c597cfed0b1327124a 100644 (file)
--- a/e_os.h
+++ b/e_os.h
@@ -477,7 +477,9 @@ struct servent *PASCAL getservbyname(const char *, const char *);
 /*
  * Even though sizeof(SOCKET) is 8, it's safe to cast it to int, because
  * the value constitutes an index in per-process table of limited size
- * and not a real pointer.
+ * and not a real pointer. And we also depend on fact that all processors
+ * Windows run on happen to be two's-complement, which allows to
+ * interchange INVALID_SOCKET and -1.
  */
 #     define socket(d,t,p)   ((int)socket(d,t,p))
 #     define accept(s,f,l)   ((int)accept(s,f,l))