diff options
-rw-r--r-- | core/CMakeLists.txt | 1 | ||||
-rw-r--r-- | core/ServiceManager/Debug/Lifecycle.h | 1 | ||||
-rw-r--r-- | core/ServiceManager/Debug/Type.cpp | 74 | ||||
-rw-r--r-- | core/ServiceManager/Debug/Type.h | 37 |
4 files changed, 0 insertions, 113 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 943b6128..0c95664d 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -24,7 +24,6 @@ set(browserCore_SRCS Logger/TextLogger.cpp Logger/Useloggers.cpp ServiceManager/Debug/BrowserAssert.cpp - ServiceManager/Debug/Type.cpp ServiceManager/ServiceFactory.cpp ServiceManager/ServiceLib.cpp ServiceManager/ServiceLoader.cpp diff --git a/core/ServiceManager/Debug/Lifecycle.h b/core/ServiceManager/Debug/Lifecycle.h index cab478e3..34041fc7 100644 --- a/core/ServiceManager/Debug/Lifecycle.h +++ b/core/ServiceManager/Debug/Lifecycle.h @@ -21,7 +21,6 @@ #include <typeinfo> #include "BrowserLogger.h" -#include "Type.h" #ifndef NDEBUG diff --git a/core/ServiceManager/Debug/Type.cpp b/core/ServiceManager/Debug/Type.cpp deleted file mode 100644 index 1066e118..00000000 --- a/core/ServiceManager/Debug/Type.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "browser_config.h" -#include "Type.h" -#ifdef __GNUG__ // check if compiler is GCC - -#include <memory> - -#include <cstdlib> - -#include <cxxabi.h> - -#if __cplusplus < 201103L // check for c++11 features -//for c++03 - -struct handle { - char * p; - handle(char * ptr) : p(ptr) { } - ~handle() { - std::free(p); - } -}; - -std::string demangle(const char * name) -{ - - int status = -4; // some arbitrary value to eliminate the compiler warning - - handle result(abi::__cxa_demangle(name, NULL, NULL, &status)); - - return (status == 0) ? result.p : name ; -} - -#else // __cplusplus | compiler supporting c++11 -//for c++11 - -std::string demangle(const char * name) -{ - int status = -4; // some arbitrary value to eliminate the compiler warning - - // enable c++11 by passing the flag -std=c++11 to g++ - std::unique_ptr<char, void( *)(void *)> res { - abi::__cxa_demangle(name, NULL, NULL, &status), - std::free - }; - - return (status == 0) ? res.get() : name ; -} - -#endif // __cplusplus - -#else // __GNUG__ - -// does nothing if not g++ -std::string demangle(const char * name) -{ - return name; -} - -#endif // __GUNG__ diff --git a/core/ServiceManager/Debug/Type.h b/core/ServiceManager/Debug/Type.h deleted file mode 100644 index ea72822d..00000000 --- a/core/ServiceManager/Debug/Type.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TYPE_HPP__ -#define __TYPE_HPP__ - -#include <string> -#include <typeinfo> - -std::string demangle(const char * name); - -template <typename T> -std::string type(T const & t) -{ - return demangle(typeid(t).name()); -} - -template <typename T> -std::string type(void) -{ - return demangle(typeid(T).name()); -} - -#endif // __TYPE_HPP__ |