Skip to content

Commit 6ca221a

Browse files
authored
Merge pull request #2483 from hzeller/feature-20251221-simpler-ifdef
Simplify `#if defined(foo)` to `#ifdef`
2 parents 67f7038 + 3a19eb0 commit 6ca221a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

verible/common/util/init-command-line.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ std::vector<std::string_view> InitCommandLine(
104104

105105
// Print stacktrace on issue, but not if --config=asan
106106
// which comes with its own stacktrace handling.
107-
#if !defined(__SANITIZE_ADDRESS__)
107+
#ifndef __SANITIZE_ADDRESS__
108108
absl::FailureSignalHandlerOptions options;
109109
absl::InstallFailureSignalHandler(options);
110110
#endif

verible/verilog/analysis/lint-rule-registry_test.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ TEST(LintRuleRegistryTest, CreateTreeLintRuleInvalid) {
102102
TEST(LintRuleRegistryTest, CreateTreeLintRuleValid) {
103103
auto any_rule = CreateSyntaxTreeLintRule("test-rule-1");
104104
EXPECT_NE(any_rule, nullptr);
105-
#if defined(__GXX_RTTI)
105+
#ifdef __GXX_RTTI
106106
auto rule_1 = dynamic_cast<TreeRule1 *>(any_rule.get());
107107
EXPECT_NE(rule_1, nullptr);
108108
#endif
@@ -155,7 +155,7 @@ TEST(LintRuleRegistryTest, CreateTokenLintRuleInvalid) {
155155
TEST(LintRuleRegistryTest, CreateTokenLintRuleValid) {
156156
auto any_rule = CreateTokenStreamLintRule("token-rule-1");
157157
EXPECT_NE(any_rule, nullptr);
158-
#if defined(__GXX_RTTI)
158+
#ifdef __GXX_RTTI
159159
auto rule_1 = dynamic_cast<TokenRule1 *>(any_rule.get());
160160
EXPECT_NE(rule_1, nullptr);
161161
#endif
@@ -204,7 +204,7 @@ TEST(LintRuleRegistryTest, CreateLineLintRuleInvalid) {
204204
TEST(LintRuleRegistryTest, CreateLineLintRuleValid) {
205205
auto any_rule = CreateLineLintRule("line-rule-1");
206206
EXPECT_NE(any_rule, nullptr);
207-
#if defined(__GXX_RTTI)
207+
#ifdef __GXX_RTTI
208208
auto rule_1 = dynamic_cast<LineRule1 *>(any_rule.get());
209209
EXPECT_NE(rule_1, nullptr);
210210
#endif
@@ -253,7 +253,7 @@ TEST(LintRuleRegistryTest, CreateTextLintRuleInvalid) {
253253
TEST(LintRuleRegistryTest, CreateTextLintRuleValid) {
254254
auto any_rule = CreateTextStructureLintRule("text-rule-1");
255255
EXPECT_NE(any_rule, nullptr);
256-
#if defined(__GXX_RTTI)
256+
#ifdef __GXX_RTTI
257257
auto rule_1 = dynamic_cast<TextRule1 *>(any_rule.get());
258258
EXPECT_NE(rule_1, nullptr);
259259
#endif

0 commit comments

Comments
 (0)