mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Add deprecated C10_UNUSED and C10_NODISCARD macros back (#138398)
For backwards compatibility. Disallow internal use. Pull Request resolved: https://github.com/pytorch/pytorch/pull/138398 Approved by: https://github.com/malfet
This commit is contained in:
parent
d8279ad9d1
commit
b1b7c714ed
|
|
@ -118,6 +118,14 @@
|
|||
#define C10_HAS_CPP_ATTRIBUTE(x) (0)
|
||||
#endif
|
||||
|
||||
#ifndef FBCODE_CAFFE2
|
||||
/// DEPRECATED: Warn if a type or return value is discarded.
|
||||
#define C10_NODISCARD [[nodiscard]]
|
||||
|
||||
/// DEPRECATED: Suppress an unused variable.
|
||||
#define C10_UNUSED [[maybe_unused]]
|
||||
#endif
|
||||
|
||||
#if !defined(__has_attribute)
|
||||
#define __has_attribute(x) 0
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user