1 // Copyright 2018 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #pragma once
6 
7 #include <zircon/compiler.h>
8 
9 // Much filesystem code is built both for Fuchsia and for Linux or OS
10 // X hosts. This includes code instrumented with Clang's locking
11 // static analysis. The Linux and OS X host mutexes are not
12 // necessarily annotated properly for this static analysis. As such,
13 // fs provides a macro that wraps the locking annotations, or noops
14 // when they are not present. This wrapping is exposed in the public
15 // fs interface as the locking requirements are part of public
16 // interfaces.
17 
18 #ifdef __Fuchsia__
19 
20 #define FS_TA_EXCLUDES(...) __TA_EXCLUDES(__VA_ARGS__)
21 #define FS_TA_GUARDED(...) __TA_GUARDED(__VA_ARGS__)
22 #define FS_TA_REQUIRES(...) __TA_REQUIRES(__VA_ARGS__)
23 
24 #else
25 
26 #define FS_TA_EXCLUDES(...)
27 #define FS_TA_GUARDED(...)
28 #define FS_TA_REQUIRES(...)
29 
30 #endif
31