The driver defines "TRACE", without prefixing it with a library specific prefix. This causes issues with HHVM (at least, 3.13.1), as it does the same.
I am now getting the following compile errors:
derick@whisky:~/dev/php/derickr-mongo-hhvm-driver $ make [ 0%] Building CXX object CMakeFiles/mongodb.dir/mongodb.cpp.o In file included from /home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/Driver/../../../libmongoc/src/mongoc/mongoc.h:54:0, from /home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/Driver/BulkWrite.h:21, from /home/derick/dev/php/derickr-mongo-hhvm-driver/mongodb.cpp:21: /home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/Driver/../../../libmongoc/src/mongoc/mongoc-trace.h:42:0: warning: "TRACE" redefined #define TRACE(msg,...) ^ In file included from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/memory-manager.h:31:0, from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/array-data.h:25, from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/type-array.h:20, from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/exceptions.h:28, from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/string-data.h:30, from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/type-string.h:22, from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/debuggable.h:19, from /usr/local/hhvm/3.13.1/include/hphp/runtime/ext/extension.h:21, from /home/derick/dev/php/derickr-mongo-hhvm-driver/mongodb.cpp:17: /usr/local/hhvm/3.13.1/include/hphp/util/trace.h:386:0: note: this is the location of the previous definition #define TRACE(...) do { } while (0) ^ In file included from /home/derick/dev/php/derickr-mongo-hhvm-driver/mongodb.cpp:34:0: /home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/BSON/Decimal128.h:34:3: error: ‘bson_decimal128_t’ does not name a type bson_decimal128_t m_decimal; ^ CMakeFiles/mongodb.dir/build.make:62: recipe for target 'CMakeFiles/mongodb.dir/mongodb.cpp.o' failed make[2]: *** [CMakeFiles/mongodb.dir/mongodb.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mongodb.dir/all' failed make[1]: *** [CMakeFiles/mongodb.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2
The driver should prefix this with something, as to prevent symbol clashes.
I also filed an issue for HHVM: https://github.com/facebook/hhvm/issues/7288
- is depended on by
-
PHPC-773 Update MONGOC_TRACE to MONGOC_ENABLE_TRACE
- Closed
- is related to
-
CDRIVER-1408 Include mongoc-trace.h from mongoc.h so other drivers don't need to include it separately
- Closed