File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,28 +154,30 @@ auto get_type_name_impl(const char *ptr, std::index_sequence<Ns...>) {
154154 return str;
155155}
156156
157+
158+ #if defined(__clang__)
157159constexpr bool const_strncmp (const char * a, const char *b, uint8_t n)
158160{
159- bool retval = 1 ;
160-
161+ bool retval = false ;
161162 for (uint8_t i = 0 ; i<n; i++)
162163 {
163164 if (a[i] != b[i])
164165 {
165- retval = 0 ;
166+ retval = true ;
166167 break ;
167168 }
168169 }
169170 return retval;
170171}
172+ #endif
171173
172174template <class T >
173175const char *get_type_name () {
174176
175177#if defined(__clang__)
176178 constexpr char opt1[] = " const char *testing::v1::detail::get_type_name() [T = " ;
177179 constexpr char opt2[] = " const char *testing::detail::get_type_name() [T = " ;
178- constexpr uint16_t offset = const_strncmp (__PRETTY_FUNCTION__, opt1, sizeof (opt1)-1 )? sizeof (opt1 )-1 : sizeof (opt2 )-1 ;
180+ constexpr uint16_t offset = const_strncmp (__PRETTY_FUNCTION__, opt1, sizeof (opt1)-1 )? sizeof (opt2 )-1 : sizeof (opt1 )-1 ;
179181#elif defined(__GNUC__)
180182 constexpr uint16_t offset = sizeof (" const char* testing::v1::detail::get_type_name() [with T = " ) - 1 ;
181183#endif
You can’t perform that action at this time.
0 commit comments