On 2014-05-21, 7:40 AM, Nicolas Silva wrote:
Sorry, my example was not clear enough. The issue with using namespace +
unifoed builds is that the using namespace declaration applies to all
(or most) of the headers included in the unified translation unit. So
using namespace mozilla at the top of each .cpp is harmless until we
include third party libraries, which we do.

This build failure is a conflict between our gfx:: classes and some
defined by 3rd party libraries we use on Mac.

This is really not a style problem. It breaks builds.

Yes, I understand this problem. It's basically why our style guide says "using namespace ...; is only allowed in .cpp files after all #includes.", it tries to protect you from this problem. The only thing that changes in the context of unified builds, is that adding a using namespace statement after the #includes in one .cpp file may be putting it before the #includes in the next file.

For the concrete case at hand, I think the simplest fix is to put the code inside those .cpp files in the mozilla::gfx namespace if they belong there, and avoid |using namespace mozilla::gfx;| elsewhere.

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to