summaryrefslogtreecommitdiff
path: root/src/win32
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2020-12-08 14:33:31 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2020-12-08 14:50:06 +0000
commit42d5f11084c67f8c96693bd42b424b0262be3f84 (patch)
tree32639e60775fa582e74e317a132638d1b3a516c3 /src/win32
parent971b7187faa1260aab75c531d9c78b29cdba6cc4 (diff)
downloadlibgit2-42d5f11084c67f8c96693bd42b424b0262be3f84.tar.gz
win32: provide macros for calling conventions
Provide more clarity for Win32 calling conventions - now that we always compile to __cdecl on Win32, we'll define that as the the libgit2 calling convention. Also offer NTAPI (__stdcall) calling conventions for things that need callbacks from NTAPI code (eg fiber-local storage).
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/msvc-compat.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/win32/msvc-compat.h b/src/win32/msvc-compat.h
index 4cf471f1d..03f9f36dc 100644
--- a/src/win32/msvc-compat.h
+++ b/src/win32/msvc-compat.h
@@ -23,6 +23,14 @@ typedef SSIZE_T ssize_t;
#endif
-#define GIT_STDLIB_CALL __cdecl
+/*
+ * Offer GIT_LIBGIT2_CALL for our calling conventions (__cdecl, always).
+ * This is useful for providing callbacks to userspace code.
+ *
+ * Offer GIT_SYSTEM_CALL for the system calling conventions (__stdcall on
+ * Win32). Useful for providing callbacks to system libraries.
+ */
+#define GIT_LIBGIT2_CALL __cdecl
+#define GIT_SYSTEM_CALL NTAPI
#endif