Commit 42d5f110 by Edward Thomson Committed by Edward Thomson

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).
parent 971b7187
...@@ -63,7 +63,9 @@ ...@@ -63,7 +63,9 @@
# include <pthread.h> # include <pthread.h>
# include <sched.h> # include <sched.h>
# endif # endif
#define GIT_STDLIB_CALL
#define GIT_LIBGIT2_CALL
#define GIT_SYSTEM_CALL
#ifdef GIT_USE_STAT_ATIMESPEC #ifdef GIT_USE_STAT_ATIMESPEC
# define st_atim st_atimespec # define st_atim st_atimespec
......
...@@ -687,7 +687,7 @@ typedef struct { ...@@ -687,7 +687,7 @@ typedef struct {
void *payload; void *payload;
} git__qsort_r_glue; } git__qsort_r_glue;
static int GIT_STDLIB_CALL git__qsort_r_glue_cmp( static int GIT_LIBGIT2_CALL git__qsort_r_glue_cmp(
void *payload, const void *a, const void *b) void *payload, const void *a, const void *b)
{ {
git__qsort_r_glue *glue = payload; git__qsort_r_glue *glue = payload;
......
...@@ -23,6 +23,14 @@ typedef SSIZE_T ssize_t; ...@@ -23,6 +23,14 @@ typedef SSIZE_T ssize_t;
#endif #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 #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment