Skip to content

Commit e77d0b1

Browse files
committed
CXX-11 windows wants optval for setsockopt to be char*
1 parent 3f4fd32 commit e77d0b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mongo/client/scoped_db_conn_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ namespace mongo {
100100
}
101101

102102
void set_opt(int optname, int optval=true) {
103-
int optset = ::setsockopt(_fd, SOL_SOCKET, optname, &optval, sizeof(optval));
103+
char * p_opt = reinterpret_cast<char*>(&optval);
104+
int optset = ::setsockopt(_fd, SOL_SOCKET, optname, p_opt, sizeof(optval));
104105
if (optset < 0) {
105106
perror("Failed to set socket opts");
106107
close();

0 commit comments

Comments
 (0)