summaryrefslogtreecommitdiff
path: root/include/git2/config.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-01-09 18:25:10 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2019-01-17 21:17:32 +0000
commit22d2062d954dcb88fa3dc65281d3f3d88ae87d68 (patch)
tree22852e22d6c571be8ccc1cdaece3d926360fc191 /include/git2/config.h
parent57b753a0dc0db2d89341300470653e8a4d066c0b (diff)
downloadlibgit2-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/config.h')
-rw-r--r--include/git2/config.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/git2/config.h b/include/git2/config.h
index f32f7af7f..0bea323b2 100644
--- a/include/git2/config.h
+++ b/include/git2/config.h
@@ -66,7 +66,7 @@ typedef struct git_config_entry {
const char *value; /**< String value of the entry */
unsigned int include_depth; /**< Depth of includes where this variable was found */
git_config_level_t level; /**< Which config file this was found in */
- void (*free)(struct git_config_entry *entry); /**< Free function for this entry */
+ void GIT_CALLBACK(free)(struct git_config_entry *entry); /**< Free function for this entry */
void *payload; /**< Opaque value for the free function. Do not read or write */
} git_config_entry;
@@ -81,7 +81,7 @@ GIT_EXTERN(void) git_config_entry_free(git_config_entry *);
* @param entry the entry currently being enumerated
* @param payload a user-specified pointer
*/
-typedef int (*git_config_foreach_cb)(const git_config_entry *entry, void *payload);
+typedef int GIT_CALLBACK(git_config_foreach_cb)(const git_config_entry *entry, void *payload);
/**
* An opaque structure for a configuration iterator