pytorch/torch/csrc/WindowsTorchApiMacro.h
peter 24314e9ceb Enable torch static build on Windows
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/15769

Reviewed By: yf225, pjh5

Differential Revision: D13597845

Pulled By: orionr

fbshipit-source-id: 99640e22974990ae570a4795ce07274c4447cb01
2019-01-08 13:19:57 -08:00

22 lines
391 B
C

#pragma once
#ifdef _WIN32
#if !defined(TORCH_BUILD_STATIC_LIBS)
#if defined(torch_EXPORTS)
#define TORCH_API __declspec(dllexport)
#else
#define TORCH_API __declspec(dllimport)
#endif
#else
#define TORCH_API
#endif
#elif defined(__GNUC__)
#if defined(torch_EXPORTS)
#define TORCH_API __attribute__((__visibility__("default")))
#else
#define TORCH_API
#endif
#else
#define TORCH_API
#endif