• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef TINYALSA_ATTRIBUTES_H
2 #define TINYALSA_ATTRIBUTES_H
3 
4 /** @defgroup libtinyalsa-attributes
5  * @brief GCC attributes to issue diagnostics
6  * when the library is being used incorrectly.
7  * */
8 
9 // FIXME: Disable the deprecated attribute in Android temporarily. pcm_read/write are marked as
10 //   deprecated functions in the latest tinyalsa in GitHub. However, there are lots of libraries in
11 //   Android using these functions and building with -Werror flags. Besides build breakage, the
12 //   behavior and interface of the successors, pcm_readi/writei, are also changed. Once all have
13 //   been cleaned up, we will enable this again.
14 #if defined(__GNUC__) && !defined(ANDROID)
15 
16 /** Issues a warning when a function is being
17  * used that is now deprecated.
18  * @ingroup libtinyalsa-attributes
19  * */
20 #define TINYALSA_DEPRECATED __attribute__((deprecated))
21 
22 /** Issues a warning when a return code of
23  * a function is not checked.
24  * @ingroup libtinyalsa-attributes
25  * */
26 #define TINYALSA_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
27 
28 #else /* __GNUC__ && !ANDROID */
29 
30 /** This is just a placeholder for compilers
31  * that aren't GCC or Clang.
32  * @ingroup libtinyalsa-attributes
33  * */
34 #define TINYALSA_DEPRECATED
35 
36 /** This is just a placeholder for compilers
37  * that aren't GCC or Clang.
38  * @ingroup libtinyalsa-attributes
39  * */
40 #define TINYALSA_WARN_UNUSED_RESULT
41 
42 #endif /* __GNUC__ && !ANDROID */
43 
44 #endif /* TINYALSA_ATTRIBUTES_H */
45