From 22d2062d954dcb88fa3dc65281d3f3d88ae87d68 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Wed, 9 Jan 2019 18:25:10 +0000 Subject: Introduce GIT_CALLBACK macro to enforce cdecl Since we now always build the library with cdecl calling conventions, our callbacks should be decorated as such so that users will not be able to provide callbacks defined with other calling conventions. The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as appropriate. --- include/git2/pack.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/git2/pack.h') diff --git a/include/git2/pack.h b/include/git2/pack.h index 2dfd825e9..beb9f4b9e 100644 --- a/include/git2/pack.h +++ b/include/git2/pack.h @@ -178,7 +178,7 @@ GIT_EXTERN(int) git_packbuilder_write( */ GIT_EXTERN(const git_oid *) git_packbuilder_hash(git_packbuilder *pb); -typedef int (*git_packbuilder_foreach_cb)(void *buf, size_t size, void *payload); +typedef int GIT_CALLBACK(git_packbuilder_foreach_cb)(void *buf, size_t size, void *payload); /** * Create the new pack and pass each object to the callback @@ -207,7 +207,7 @@ GIT_EXTERN(size_t) git_packbuilder_object_count(git_packbuilder *pb); GIT_EXTERN(size_t) git_packbuilder_written(git_packbuilder *pb); /** Packbuilder progress notification function */ -typedef int (*git_packbuilder_progress)( +typedef int GIT_CALLBACK(git_packbuilder_progress)( int stage, uint32_t current, uint32_t total, -- cgit v1.2.1