summaryrefslogtreecommitdiff
path: root/include/git2/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2/common.h')
-rw-r--r--include/git2/common.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/git2/common.h b/include/git2/common.h
index 0e9379804..a16cf43d5 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -32,7 +32,11 @@
__attribute__((visibility("default"))) \
type
#elif defined(_MSC_VER)
-# define GIT_EXTERN(type) __declspec(dllexport) type
+# ifdef git2_EXPORTS /* defined by cmake */
+# define GIT_EXTERN(type) __declspec(dllexport) type
+# else
+# define GIT_EXTERN(type) __declspec(dllimport) type
+# endif
#else
# define GIT_EXTERN(type) extern type
#endif