Skip to content

Commit 5917787

Browse files
committed
Avoid nested macros when reporting runtime version in debug mode
This appeared to work in GCC but caused compilation errors on Windows. Related to: 2f750b0
1 parent 832a556 commit 5917787

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

php_phongo.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ mongoc_client_t *php_phongo_make_mongo_client(const mongoc_uri_t *uri, zval *dri
18611861
{
18621862
zval **tmp;
18631863
php_stream_context *ctx;
1864-
const char *mech;
1864+
const char *mech, *mongoc_version, *bson_version;
18651865
mongoc_client_t *client;
18661866

18671867
ENTRY;
@@ -1883,21 +1883,25 @@ mongoc_client_t *php_phongo_make_mongo_client(const mongoc_uri_t *uri, zval *dri
18831883
php_phongo_populate_default_ssl_ctx(ctx, driverOptions);
18841884
}
18851885

1886-
MONGOC_DEBUG("Creating Manager, phongo-%s[%s] - mongoc-%s(%s), libbson-%s(%s), php-%s",
1887-
MONGODB_VERSION_S,
1888-
MONGODB_STABILITY_S,
1889-
MONGOC_VERSION_S,
18901886
#ifdef HAVE_SYSTEM_LIBMONGOC
1891-
mongoc_get_version(),
1887+
mongoc_version = mongoc_get_version();
18921888
#else
1893-
"bundled",
1889+
mongoc_version = "bundled";
18941890
#endif
1895-
BSON_VERSION_S,
1891+
18961892
#ifdef HAVE_SYSTEM_LIBBSON
1897-
bson_get_version(),
1893+
bson_version = bson_get_version();
18981894
#else
1899-
"bundled",
1895+
bson_version = "bundled";
19001896
#endif
1897+
1898+
MONGOC_DEBUG("Creating Manager, phongo-%s[%s] - mongoc-%s(%s), libbson-%s(%s), php-%s",
1899+
MONGODB_VERSION_S,
1900+
MONGODB_STABILITY_S,
1901+
MONGOC_VERSION_S,
1902+
mongoc_version,
1903+
BSON_VERSION_S,
1904+
bson_version,
19011905
PHP_VERSION
19021906
);
19031907
client = mongoc_client_new_from_uri(uri);

0 commit comments

Comments
 (0)