aboutsummaryrefslogtreecommitdiffstats
path: root/brillo/type_name_undecorate.h
Commit message (Collapse)AuthorAgeFilesLines
* libbrillo: Remove RTTI from the libraryAlex Vakulenko2016-01-041-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main reason why we needed run-time type information is so that we can get a type name string for a particular type T. This string was used in type comparisons in brillo::Any as the only reliable way of determining if two Any instances have values of the same type. For this typeid(T).name() was used which requires RTTI to be enabled. However using RTTI causes issues when linking to libraries with RTTI disabled. To resolve this issue, stop relying on RTTI in libbrillo and throughout the rest of Brillo code. A special work-around was implemented to obtain a type name for a given type, which relies on the fact that __PRETTY_FUNCTION__ macro on GCC/clang includes the full signature of a method, including any template parameters. For example, brillo::GetTypeTag<double>() would return const char *brillo::GetTypeTag() [T = double] and extracting the type name ("double") is just a matter of simple string manipulations. To speed up the code at run-time, we don't really need to extract the type name from this function name when comparing two types, but rather compare the two function names directly. This function name with embedded type is called "type tag" in the code. Unfortunately GCC and CLANG handle __PRETTY_FUNCTION__ differently for certain template types, so added #error statement to force compiling using clang only (since this is the compiler used most often for Brillo targets). BUG: 26292405 Change-Id: Ie70012b62f66911ee7787e5cf7eeab88359bd959
* Rename "libchromeos" into "libbrillo"Alex Vakulenko2015-10-271-3/+3
| | | | | | | Renamed libchromeos[-.*] libraries into libbrillo-... BUG: 24872993 Change-Id: Ibab1623b6a08a55cae3662e941d0d6644ff14df4
* Move chromeos symbols into brillo namespaceAlex Vakulenko2015-10-131-0/+27
And move the include files into "brillo" directory instead of "chromeos" BUG: 24872993 TEST=built aosp and brillo and unit tests pass on dragonoboard Change-Id: Ieb979d1ebd3152921d36cd15acbd6247f02aae69