X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Finclude%2Fdemangle.h;fp=src%2Fceph%2Fsrc%2Finclude%2Fdemangle.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=9e46d952f058dee5350b6ba952ae06f630ed99a1;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/include/demangle.h b/src/ceph/src/include/demangle.h deleted file mode 100644 index 9e46d95..0000000 --- a/src/ceph/src/include/demangle.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * Ceph - scalable distributed file system - * - * Copyright (C) 2016 Allen Samuels - * - * This is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software - * Foundation. See file COPYING. - * - */ - -#ifndef CEPH_INCLUDE_DEMANGLE -#define CEPH_INCLUDE_DEMANGLE - -//// Stole this code from http://stackoverflow.com/questions/281818/unmangling-the-result-of-stdtype-infoname -#ifdef __GNUG__ -#include -#include -#include - -static std::string ceph_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 res { - abi::__cxa_demangle(name, NULL, NULL, &status), - std::free - }; - - return (status == 0) ? res.get() : name ; -} - -#else - -// does nothing if not g++ -static std::string demangle(const char* name) -{ - return name; -} - -#endif - - -#endif