[PATCH] D108592: [clang][Fuchsia] Support __attribute__((availability)) on Fuchsia

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 9 10:59:55 PDT 2021


phosek added inline comments.


================
Comment at: clang/include/clang/Basic/LangOptions.def:431
 
+VALUE_LANGOPT(FuchsiaVersion, 32, 0, "Fuchsia Version")
+
----------------
This is more consistent with other options.


================
Comment at: clang/lib/Basic/Targets/OSTargets.h:888
       Builder.defineMacro("_GNU_SOURCE");
+
+    this->PlatformName = "fuchsia";
----------------
We also want to define a `__FUCHSIA_VERSION__` so the version can be read at compile time.


================
Comment at: clang/test/Frontend/attr-availability-fuchsia.c:4
+//
+// It should also be exposed to non-fuchsia platforms. This is desireable when
+// using common Fuchsia headers for building host libraries that also depend on
----------------
Would this also set the availability attribute? Can we test it? If not then this isn't particularly useful.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108592/new/

https://reviews.llvm.org/D108592



More information about the cfe-commits mailing list