Delete stringize macros.

Only a single use, which looks like a leftover from a time with more
macro usage.

Bug: webrtc:6424
Change-Id: Ie4e9234ee9a8aba10537ab32daf8cab830460b4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186047
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32254}
This commit is contained in:
Niels Möller 2020-09-30 13:48:20 +02:00 committed by Commit Bot
parent 309a6afd61
commit 80869c2202
5 changed files with 12 additions and 83 deletions

View File

@ -23,7 +23,6 @@
#include <tuple>
#include "common_audio/resampler/sinusoidal_linear_chirp_source.h"
#include "rtc_base/stringize_macros.h"
#include "rtc_base/system/arch.h"
#include "rtc_base/time_utils.h"
#include "system_wrappers/include/cpu_features_wrapper.h"
@ -196,9 +195,11 @@ TEST(SincResamplerTest, ConvolveBenchmark) {
}
double total_time_optimized_unaligned_us =
(rtc::TimeNanos() - start) / rtc::kNumNanosecsPerMicrosec;
printf(STRINGIZE(convolve_proc_) "(unaligned) took %.2fms; which is %.2fx "
"faster than Convolve_C.\n", total_time_optimized_unaligned_us / 1000,
total_time_c_us / total_time_optimized_unaligned_us);
printf(
"convolve_proc_(unaligned) took %.2fms; which is %.2fx "
"faster than Convolve_C.\n",
total_time_optimized_unaligned_us / 1000,
total_time_c_us / total_time_optimized_unaligned_us);
// Benchmark with aligned input pointer.
start = rtc::TimeNanos();
@ -209,12 +210,13 @@ TEST(SincResamplerTest, ConvolveBenchmark) {
}
double total_time_optimized_aligned_us =
(rtc::TimeNanos() - start) / rtc::kNumNanosecsPerMicrosec;
printf(STRINGIZE(convolve_proc_) " (aligned) took %.2fms; which is %.2fx "
"faster than Convolve_C and %.2fx faster than "
STRINGIZE(convolve_proc_) " (unaligned).\n",
total_time_optimized_aligned_us / 1000,
total_time_c_us / total_time_optimized_aligned_us,
total_time_optimized_unaligned_us / total_time_optimized_aligned_us);
printf(
"convolve_proc_ (aligned) took %.2fms; which is %.2fx "
"faster than Convolve_C and %.2fx faster than "
"convolve_proc_ (unaligned).\n",
total_time_optimized_aligned_us / 1000,
total_time_c_us / total_time_optimized_aligned_us,
total_time_optimized_unaligned_us / total_time_optimized_aligned_us);
}
typedef std::tuple<int, int, double, double> SincResamplerTestData;

View File

@ -164,7 +164,6 @@ rtc_source_set("macromagic") {
"arraysize.h",
"constructor_magic.h",
"format_macros.h",
"stringize_macros.h",
"thread_annotations.h",
]
deps = [ "system:arch" ]
@ -1254,7 +1253,6 @@ if (rtc_include_tests) {
"string_encode_unittest.cc",
"string_to_number_unittest.cc",
"string_utils_unittest.cc",
"stringize_macros_unittest.cc",
"strings/string_builder_unittest.cc",
"strings/string_format_unittest.cc",
"swap_queue_unittest.cc",

View File

@ -13,7 +13,6 @@
#include <string>
#include "rtc_base/stringize_macros.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc {

View File

@ -1,38 +0,0 @@
/*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// Modified from the Chromium original:
// src/base/strings/stringize_macros.h
// This file defines preprocessor macros for stringizing preprocessor
// symbols (or their output) and manipulating preprocessor symbols
// that define strings.
#ifndef RTC_BASE_STRINGIZE_MACROS_H_
#define RTC_BASE_STRINGIZE_MACROS_H_
// This is not very useful as it does not expand defined symbols if
// called directly. Use its counterpart without the _NO_EXPANSION
// suffix, below.
#define STRINGIZE_NO_EXPANSION(x) #x
// Use this to quote the provided parameter, first expanding it if it
// is a preprocessor symbol.
//
// For example, if:
// #define A FOO
// #define B(x) myobj->FunctionCall(x)
//
// Then:
// STRINGIZE(A) produces "FOO"
// STRINGIZE(B(y)) produces "myobj->FunctionCall(y)"
#define STRINGIZE(x) STRINGIZE_NO_EXPANSION(x)
#endif // RTC_BASE_STRINGIZE_MACROS_H_

View File

@ -1,32 +0,0 @@
/*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "rtc_base/stringize_macros.h"
#include "test/gtest.h"
// Macros as per documentation in header file.
#define PREPROCESSOR_UTIL_UNITTEST_A FOO
#define PREPROCESSOR_UTIL_UNITTEST_B(x) myobj->FunctionCall(x)
#define PREPROCESSOR_UTIL_UNITTEST_C "foo"
TEST(StringizeTest, Ansi) {
EXPECT_STREQ("PREPROCESSOR_UTIL_UNITTEST_A",
STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_A));
EXPECT_STREQ("PREPROCESSOR_UTIL_UNITTEST_B(y)",
STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_B(y)));
EXPECT_STREQ("PREPROCESSOR_UTIL_UNITTEST_C",
STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_C));
EXPECT_STREQ("FOO", STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_A));
EXPECT_STREQ("myobj->FunctionCall(y)",
STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_B(y)));
EXPECT_STREQ("\"foo\"", STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_C));
}