From aa0f307e06e5aae3b12f9f15b350dc81b30d61de Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Tue, 28 Jun 2011 02:06:23 +0300 Subject: ALL: Require DECLARE_SINGLETON to be used in the Common namepsace Silences the clang warning: static data member specialization of '_singleton' must originally be declared in namespace 'Common'; accepted as a C++0x extension [-Wc++0x-extensions] Wrapping "namespace Common {}" around the macro assignment causes clang to complain about a spurious semicolon, and removing the semicolon at the end of the macro causes some editors to misbehave. Changing the requirement of using the macro in one namespace (the global) to another (Common) seems a small price to pay to silence a warning. --- backends/plugins/elf/memory-manager.cpp | 2 ++ backends/plugins/elf/shorts-segment-manager.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'backends/plugins') diff --git a/backends/plugins/elf/memory-manager.cpp b/backends/plugins/elf/memory-manager.cpp index 02669b3647..058d818dc4 100644 --- a/backends/plugins/elf/memory-manager.cpp +++ b/backends/plugins/elf/memory-manager.cpp @@ -29,7 +29,9 @@ #include "common/util.h" #include +namespace Common { DECLARE_SINGLETON(ELFMemoryManager); +} ELFMemoryManager::ELFMemoryManager() : _heap(0), _heapSize(0), _heapAlign(0), diff --git a/backends/plugins/elf/shorts-segment-manager.cpp b/backends/plugins/elf/shorts-segment-manager.cpp index b3a9531c2d..caa328a4f2 100644 --- a/backends/plugins/elf/shorts-segment-manager.cpp +++ b/backends/plugins/elf/shorts-segment-manager.cpp @@ -33,7 +33,9 @@ extern char __plugin_hole_start; // Indicates start of hole in program file for extern char __plugin_hole_end; // Indicates end of hole in program file extern char _gp[]; // Value of gp register +namespace Common { DECLARE_SINGLETON(ShortSegmentManager); // For singleton +} ShortSegmentManager::ShortSegmentManager() { _shortsStart = &__plugin_hole_start ; //shorts segment begins at the plugin hole we made when linking -- cgit v1.2.3