int BIO_sock_error(int sock)
{
int j,i;
- int size;
+ union { size_t s; int i; } size;
#if defined(OPENSSL_SYS_BEOS_R5)
return 0;
#endif
-
- size=sizeof(int);
+
+ /* heuristic way to adapt for platforms that expect 64-bit optlen */
+ size.s=0, size.i=sizeof(j);
/* Note: under Windows the third parameter is of type (char *)
* whereas under other systems it is (void *) if you don't have
* a cast it will choke the compiler: if you do have a cast then