Commit b00a9e7e authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Remove an MSVC-required macro.

BUG=none

Change-Id: I118976f80f3c605f7b2c5cb05e8b60278fded19d
Reviewed-on: https://chromium-review.googlesource.com/c/1272495Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599047}
parent eb28e7e3
...@@ -72,16 +72,7 @@ ...@@ -72,16 +72,7 @@
// |COMPONENT_MACRO_CONDITIONAL_COMMA_()| above to implement conditional macro // |COMPONENT_MACRO_CONDITIONAL_COMMA_()| above to implement conditional macro
// expansion. // expansion.
#define COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_(...) \ #define COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_(...) \
COMPONENT_MACRO_EXPAND_( \ COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_IMPL_(__VA_ARGS__)
COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_IMPL_(__VA_ARGS__))
#define COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_IMPL_(a, b, c, ...) c #define COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_IMPL_(a, b, c, ...) c
// Helper to work around MSVC quirkiness wherein a macro expansion like |,|
// within a parameter list will be treated as a single macro argument. This is
// needed to ensure that |COMPONENT_MACRO_CONDITIONAL_COMMA_()| above can expand
// to multiple separate positional arguments in the affirmative case, thus
// elliciting the desired conditional behavior with
// |COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_()|.
#define COMPONENT_MACRO_EXPAND_(x) x
#endif // BASE_COMPONENT_EXPORT_H_ #endif // BASE_COMPONENT_EXPORT_H_
...@@ -89,10 +89,6 @@ namespace base { ...@@ -89,10 +89,6 @@ namespace base {
#define CR_DEFINE_STATIC_LOCAL(type, name, arguments) \ #define CR_DEFINE_STATIC_LOCAL(type, name, arguments) \
static type& name = *new type arguments static type& name = *new type arguments
// Workaround for MSVC, which expands __VA_ARGS__ as one macro argument. To
// work around this bug, wrap the entire expression in this macro...
#define CR_EXPAND_ARG(arg) arg
} // base } // base
#endif // BASE_MACROS_H_ #endif // BASE_MACROS_H_
...@@ -77,10 +77,10 @@ ...@@ -77,10 +77,10 @@
// enum to an arithmetic type and adding one. Instead, prefer the two argument // enum to an arithmetic type and adding one. Instead, prefer the two argument
// version of the macro which automatically deduces the boundary from kMaxValue. // version of the macro which automatically deduces the boundary from kMaxValue.
#define UMA_HISTOGRAM_ENUMERATION(name, ...) \ #define UMA_HISTOGRAM_ENUMERATION(name, ...) \
CR_EXPAND_ARG(INTERNAL_UMA_HISTOGRAM_ENUMERATION_GET_MACRO( \ INTERNAL_UMA_HISTOGRAM_ENUMERATION_GET_MACRO( \
__VA_ARGS__, INTERNAL_UMA_HISTOGRAM_ENUMERATION_SPECIFY_BOUNDARY, \ __VA_ARGS__, INTERNAL_UMA_HISTOGRAM_ENUMERATION_SPECIFY_BOUNDARY, \
INTERNAL_UMA_HISTOGRAM_ENUMERATION_DEDUCE_BOUNDARY)( \ INTERNAL_UMA_HISTOGRAM_ENUMERATION_DEDUCE_BOUNDARY) \
name, __VA_ARGS__, base::HistogramBase::kUmaTargetedHistogramFlag)) (name, __VA_ARGS__, base::HistogramBase::kUmaTargetedHistogramFlag)
// As above but "scaled" count to avoid overflows caused by increments of // As above but "scaled" count to avoid overflows caused by increments of
// large amounts. See UMA_HISTOGRAM_SCALED_EXACT_LINEAR for more information. // large amounts. See UMA_HISTOGRAM_SCALED_EXACT_LINEAR for more information.
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
// For usage details, see the equivalents in histogram_macros.h. // For usage details, see the equivalents in histogram_macros.h.
#define LOCAL_HISTOGRAM_ENUMERATION(name, ...) \ #define LOCAL_HISTOGRAM_ENUMERATION(name, ...) \
CR_EXPAND_ARG(INTERNAL_UMA_HISTOGRAM_ENUMERATION_GET_MACRO( \ INTERNAL_UMA_HISTOGRAM_ENUMERATION_GET_MACRO( \
__VA_ARGS__, INTERNAL_UMA_HISTOGRAM_ENUMERATION_SPECIFY_BOUNDARY, \ __VA_ARGS__, INTERNAL_UMA_HISTOGRAM_ENUMERATION_SPECIFY_BOUNDARY, \
INTERNAL_UMA_HISTOGRAM_ENUMERATION_DEDUCE_BOUNDARY)( \ INTERNAL_UMA_HISTOGRAM_ENUMERATION_DEDUCE_BOUNDARY) \
name, __VA_ARGS__, base::HistogramBase::kNoFlags)) (name, __VA_ARGS__, base::HistogramBase::kNoFlags)
#define LOCAL_HISTOGRAM_BOOLEAN(name, sample) \ #define LOCAL_HISTOGRAM_BOOLEAN(name, sample) \
STATIC_HISTOGRAM_POINTER_BLOCK(name, AddBoolean(sample), \ STATIC_HISTOGRAM_POINTER_BLOCK(name, AddBoolean(sample), \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment