mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 09:49:14 +00:00
Bug 1324093 - Part 3.5: Add MOZ_MAYBE_UNUSED to mfbt/Attributes.h. r=froydnj
MozReview-Commit-ID: Ef1nkRipaDg --HG-- extra : rebase_source : ea298dc948a027e5a686c2f022cce5d8cb170f27
This commit is contained in:
parent
2166409a1d
commit
0cf4adb5f3
@ -274,6 +274,27 @@
|
||||
# define MOZ_MUST_USE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MOZ_MAYBE_UNUSED suppresses compiler warnings about functions that are
|
||||
* never called (in this build configuration, at least).
|
||||
*
|
||||
* Place this attribute at the very beginning of a function declaration. For
|
||||
* example, write
|
||||
*
|
||||
* MOZ_MAYBE_UNUSED int foo();
|
||||
*
|
||||
* or
|
||||
*
|
||||
* MOZ_MAYBE_UNUSED int foo() { return 42; }
|
||||
*/
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# define MOZ_MAYBE_UNUSED __attribute__ ((__unused__))
|
||||
#elif defined(_MSC_VER)
|
||||
# define MOZ_MAYBE_UNUSED __pragma(warning(suppress:4505))
|
||||
#else
|
||||
# define MOZ_MAYBE_UNUSED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MOZ_FALLTHROUGH is an annotation to suppress compiler warnings about switch
|
||||
* cases that fall through without a break or return statement. MOZ_FALLTHROUGH
|
||||
|
Loading…
x
Reference in New Issue
Block a user