Skip to content

Commit e4e9382

Browse files
ddorwinCQ Bot
authored andcommitted
[versioning][bazel] Add comment about raw use of __Fuchsia_API_level__
Make it clear that this part of the example is not something that readers should follow. Bug: 42084512 Change-Id: Ic2fc0c0a32d4d42556d8191064528840e5fe3059 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1054582 Commit-Queue: David Dorwin <ddorwin@google.com> Reviewed-by: David Turner <digit@google.com>
1 parent 3ff01fb commit e4e9382

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

build/bazel/examples/hello_cpp/hello_world.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include <iostream>
66

7+
// In real code, use the macros in <zircon/availability.h> for such checks.
8+
// This is an exceptional case where a check for equality is needed.
79
#if __Fuchsia_API_level__ == 17
810
#include "lib/hello_printer_17.h"
911
#endif

build/bazel/examples/hello_cpp/lib/hello_printer_17.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#ifndef BUILD_BAZEL_EXAMPLES_HELLO_CPP_LIB_HELLO_PRINTER_17_H_
66
#define BUILD_BAZEL_EXAMPLES_HELLO_CPP_LIB_HELLO_PRINTER_17_H_
77

8+
// In real code, use the macros in <zircon/availability.h> for such checks.
9+
// This is an exceptional case where a check for equality is needed.
810
#if __Fuchsia_API_level__ == 17
911

1012
namespace hello_printer_17 {
@@ -19,6 +21,6 @@ class HelloPrinter {
1921

2022
} // namespace hello_printer_17
2123

22-
#endif // __Fuchsia_API_level__
24+
#endif // __Fuchsia_API_level__ == 17
2325

2426
#endif // BUILD_BAZEL_EXAMPLES_HELLO_CPP_LIB_HELLO_PRINTER_17_H_

0 commit comments

Comments
 (0)