[SERVER-289] don't pollute global namespaces ( WAS: Mongo #assert squashes other asserts) Created: 10/Sep/09 Updated: 12/Jul/16 Resolved: 23/Apr/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client |
| Affects Version/s: | None |
| Fix Version/s: | 1.5.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jack Saalweachter | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
When you try to assert something in a file which includes dbclient.h, the mongo assert replaces other asserts which may have been declared. EXAMPLE: foo.cc: int main() { YIELDS: > g++ foo.cc -o foo |
| Comments |
| Comment by Mathias Stearn [ 23/Apr/10 ] |
|
fixed with http://github.com/mongodb/mongo/commit/60002a474169de84eac6bce20836ee553abf731c If you include mongo/client/cleanup.h it will remove our global macros. |
| Comment by Eliot Horowitz (Inactive) [ 17/Oct/09 ] |
|
merged that patch |
| Comment by metagoto [ 17/Oct/09 ] |
|
I did a quick fix: moving 'using namespace' directives inside the mongo ns declaration in stdafx.h. The client part is 'fixed': i can build my project which depends on libmongoclient without names conflicts (even with -std=c++0x) My commit is My master branch is up to date at that time. mongo server, tools, shell and lib compile with both sm and v8 on osx |
| Comment by Eliot Horowitz (Inactive) [ 08/Oct/09 ] |
|
made it compile at least - still squases, just uses mongo::asserted |