diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-09 18:25:10 +0000 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-17 21:17:32 +0000 |
| commit | 22d2062d954dcb88fa3dc65281d3f3d88ae87d68 (patch) | |
| tree | 22852e22d6c571be8ccc1cdaece3d926360fc191 /include/git2/remote.h | |
| parent | 57b753a0dc0db2d89341300470653e8a4d066c0b (diff) | |
| download | libgit2-22d2062d954dcb88fa3dc65281d3f3d88ae87d68.tar.gz | |
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.
Diffstat (limited to 'include/git2/remote.h')
| -rw-r--r-- | include/git2/remote.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h index 3e8292fe4..0b6e92a9e 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -422,7 +422,7 @@ typedef enum git_remote_completion_type { } git_remote_completion_type; /** Push network progress notification function */ -typedef int (*git_push_transfer_progress)( +typedef int GIT_CALLBACK(git_push_transfer_progress)( unsigned int current, unsigned int total, size_t bytes, @@ -457,7 +457,7 @@ typedef struct { * @param len number of elements in `updates` * @param payload Payload provided by the caller */ -typedef int (*git_push_negotiation)(const git_push_update **updates, size_t len, void *payload); +typedef int GIT_CALLBACK(git_push_negotiation)(const git_push_update **updates, size_t len, void *payload); /** * Callback used to inform of the update status from the remote. @@ -471,7 +471,7 @@ typedef int (*git_push_negotiation)(const git_push_update **updates, size_t len, * @param data data provided by the caller * @return 0 on success, otherwise an error */ -typedef int (*git_push_update_reference_cb)(const char *refname, const char *status, void *data); +typedef int GIT_CALLBACK(git_push_update_reference_cb)(const char *refname, const char *status, void *data); /** * The callback settings structure @@ -492,7 +492,7 @@ struct git_remote_callbacks { * Completion is called when different parts of the download * process are done (currently unused). */ - int (*completion)(git_remote_completion_type type, void *data); + int GIT_CALLBACK(completion)(git_remote_completion_type type, void *data); /** * This will be called if the remote host requires @@ -522,7 +522,7 @@ struct git_remote_callbacks { * Each time a reference is updated locally, this function * will be called with information about it. */ - int (*update_tips)(const char *refname, const git_oid *a, const git_oid *b, void *data); + int GIT_CALLBACK(update_tips)(const char *refname, const git_oid *a, const git_oid *b, void *data); /** * Function to call with progress information during pack |
