Skip to content

Commit

Permalink
strings/char_traits.h: use HAS_FEATURE instead of __has_feature
Browse files Browse the repository at this point in the history
This is for cl.exe build.

Change-Id: Icce6bbb29225d2f77d4b1105778aa26d9416c5e4
Reviewed-on: https://chromium-review.googlesource.com/1046425
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556429}
  • Loading branch information
Takuto Ikuta authored and Commit Bot committed May 7, 2018
1 parent 978e750 commit 1a10942
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base/strings/char_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <stddef.h>

#include "base/compiler_specific.h"

namespace base {

// constexpr version of http://en.cppreference.com/w/cpp/string/char_traits.
Expand Down Expand Up @@ -61,7 +63,7 @@ struct CharTraits<char> {
constexpr int CharTraits<char>::compare(const char* s1,
const char* s2,
size_t n) noexcept {
#if __has_feature(cxx_constexpr_string_builtins)
#if HAS_FEATURE(cxx_constexpr_string_builtins)
return __builtin_memcmp(s1, s2, n);
#else
for (; n; --n, ++s1, ++s2) {
Expand Down

0 comments on commit 1a10942

Please sign in to comment.