-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Factor out common macros in single file
- Loading branch information
Showing
6 changed files
with
28 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef TORCHVISION_MACROS_H | ||
#define TORCHVISION_MACROS_H | ||
|
||
#ifdef _WIN32 | ||
#if defined(torchvision_EXPORTS) | ||
#define VISION_API __declspec(dllexport) | ||
#else | ||
#define VISION_API __declspec(dllimport) | ||
#endif | ||
#else | ||
#define VISION_API | ||
#endif | ||
|
||
#if (defined __cpp_inline_variables) || __cplusplus >= 201703L | ||
#define VISION_INLINE_VARIABLE inline | ||
#else | ||
#ifdef _MSC_VER | ||
#define VISION_INLINE_VARIABLE __declspec(selectany) | ||
#else | ||
#define VISION_INLINE_VARIABLE __attribute__((weak)) | ||
#endif | ||
#endif | ||
|
||
#endif // TORCHVISION_MACROS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters