1MONGOC_VERSION(3) libmongoc MONGOC_VERSION(3)
2
3
4
5Conditional compilation based on mongoc version
6
8 The following preprocessor macros can be used to perform various checks
9 based on the version of the library you are compiling against. This
10 may be useful if you only want to enable a feature on a certain version
11 of the library.
12
13 #include <mongoc/mongoc.h>
14
15 #define MONGOC_MAJOR_VERSION (x)
16 #define MONGOC_MINOR_VERSION (y)
17 #define MONGOC_MICRO_VERSION (z)
18 #define MONGOC_VERSION_S "x.y.z"
19 #define MONGOC_VERSION_HEX ((1 << 24) | (0 << 16) | (0 << 8) | 0)
20 #define MONGOC_CHECK_VERSION(major, minor, micro)
21
22 Only compile a block on MongoDB C Driver 1.1.0 and newer.
23
24 #if MONGOC_CHECK_VERSION(1, 1, 0)
25 static void
26 do_something (void)
27 {
28 }
29 #endif
30
32 MongoDB, Inc
33
35 2017-present, MongoDB, Inc
36
37
38
39
401.25.1 Nov 08, 2023 MONGOC_VERSION(3)