Skip to content

Commit 04e043e

Browse files
committed
CXX-277 Error out on windows if the winsock headers are not already included
1 parent 338b7fb commit 04e043e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/mongo/bson/bson.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
#pragma warning(disable:4275)
5656
#endif
5757

58+
#if defined(_WIN32) && !defined(_WINSOCK2API_)
59+
#error "You must include the windows and windows sockets headers before bson.h"
60+
#endif
61+
5862
#include "mongo/config.h"
5963

6064
#include "mongo/client/redef_macros.h"

src/mongo/client/dbclient.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
#pragma warning(disable:4275)
4343
#endif
4444

45+
#if defined(_WIN32) && !defined(_WINSOCK2API_)
46+
#error "You must include the windows and windows sockets headers before dbclient.h"
47+
#endif
48+
4549
#include "mongo/config.h"
4650

4751
#include "mongo/client/redef_macros.h"

0 commit comments

Comments
 (0)