Skip to content

Commit c4e5eb7

Browse files
committed
CDRIVER-1957 fix test-libmongoc build in MinGW-W64
1 parent 59ae56a commit c4e5eb7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/json-test.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,10 @@ install_json_test_suite (TestSuite *suite,
704704

705705
for (i = 0; i < num_tests; i++) {
706706
test = get_bson_from_json_file (test_paths[i]);
707-
skip_json = strstr (test_paths[i], "/json") + strlen ("/json");
707+
skip_json = COALESCE (strstr (test_paths[i], "/json"),
708+
strstr (test_paths[i], "\\json"));
708709
assert (skip_json);
710+
skip_json += strlen ("/json");
709711
ext = strstr (skip_json, ".json");
710712
assert (ext);
711713
ext[0] = '\0';

tests/test-conveniences.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ void
2828
bson_iter_bson (const bson_iter_t *iter, bson_t *bson);
2929

3030

31-
#ifdef _MSC_VER
31+
#ifndef PATH_MAX
3232
#define PATH_MAX 1024
33+
#endif
34+
35+
#ifdef _WIN32
3336
#define realpath(path, expanded) \
3437
GetFullPathName (path, PATH_MAX, expanded, NULL)
3538
#endif

0 commit comments

Comments
 (0)