mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[caffe2] Avoid attempt to use undefined preprocessor directive
Summary: This is somewhat more verbose, but it's more correct and addresses this warning on Visual Studio 2017: ``` xplat\caffe2\caffe2\core\common.h(76): warning C4067: unexpected tokens following preprocessor directive - expected a newline ``` Test Plan: Built locally with fix Reviewed By: simpkins Differential Revision: D28868632 fbshipit-source-id: f6a583e8275162adedb2a4bc5ed0f64847020871
This commit is contained in:
parent
1d9c1cc00a
commit
1dcc034fba
|
|
@ -73,9 +73,12 @@ using std::vector;
|
|||
#define NOMINMAX
|
||||
#endif
|
||||
|
||||
#if defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard)
|
||||
#if defined(__has_cpp_attribute)
|
||||
#if __has_cpp_attribute(nodiscard)
|
||||
#define CAFFE2_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(CAFFE2_NODISCARD)
|
||||
#define CAFFE2_NODISCARD
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user