Skip to content

Commit cf6483f

Browse files
committed
Merge pull request #45 from fotonauts/expose-MONGOC_DEFAULT_PORT
it is nicer to expose MONGOC_DEFAULT_PORT constant
2 parents f5667c4 + 4d2731f commit cf6483f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/mongoc/mongoc-uri.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@
2626
#include "mongoc-uri.h"
2727

2828

29-
#ifndef MONGOC_DEFAULT_PORT
30-
# define MONGOC_DEFAULT_PORT 27017
31-
#endif
32-
33-
3429
#if defined(_WIN32) && !defined(strcasecmp)
3530
# define strcasecmp _stricmp
3631
#endif
@@ -167,7 +162,7 @@ static bool
167162
mongoc_uri_parse_host6 (mongoc_uri_t *uri,
168163
const char *str)
169164
{
170-
uint16_t port = 27017;
165+
uint16_t port = MONGOC_DEFAULT_PORT;
171166
const char *portstr;
172167
const char *end_host;
173168
char *hostname;

src/mongoc/mongoc-uri.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
#include "mongoc-write-concern.h"
3131

3232

33+
#ifndef MONGOC_DEFAULT_PORT
34+
# define MONGOC_DEFAULT_PORT 27017
35+
#endif
36+
37+
3338
BSON_BEGIN_DECLS
3439

3540

0 commit comments

Comments
 (0)