aboutsummaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-01-12 15:11:41 -0800
committerJunio C Hamano <gitster@pobox.com>2022-01-12 15:11:41 -0800
commita4510f8106a65f42d4ecbe9b826f16e4ff9df6db (patch)
tree2c46633005363bc26b15aefd8648d052a2c97478 /compat/mingw.c
parentcde28af37b19e07139ebb6a355d742e763b7a235 (diff)
parent4a9b204920152c668228a9d43a63be39b0c32f45 (diff)
downloadgit-a4510f8106a65f42d4ecbe9b826f16e4ff9df6db.tar.xz
Merge branch 'ma/windows-dynload-fix'
Fix calling dynamically loaded functions on Windows. * ma/windows-dynload-fix: lazyload: use correct calling conventions
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index e14f2d5f77..640dcb11de 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -8,6 +8,8 @@
#include "win32/lazyload.h"
#include "../config.h"
#include "dir.h"
+#define SECURITY_WIN32
+#include <sspi.h>
#define HCAST(type, handle) ((type)(intptr_t)handle)
@@ -1008,7 +1010,7 @@ size_t mingw_strftime(char *s, size_t max,
/* a pointer to the original strftime in case we can't find the UCRT version */
static size_t (*fallback)(char *, size_t, const char *, const struct tm *) = strftime;
size_t ret;
- DECLARE_PROC_ADDR(ucrtbase.dll, size_t, strftime, char *, size_t,
+ DECLARE_PROC_ADDR(ucrtbase.dll, size_t, __cdecl, strftime, char *, size_t,
const char *, const struct tm *);
if (INIT_PROC_ADDR(strftime))
@@ -2185,7 +2187,7 @@ enum EXTENDED_NAME_FORMAT {
static char *get_extended_user_info(enum EXTENDED_NAME_FORMAT type)
{
- DECLARE_PROC_ADDR(secur32.dll, BOOL, GetUserNameExW,
+ DECLARE_PROC_ADDR(secur32.dll, BOOL, SEC_ENTRY, GetUserNameExW,
enum EXTENDED_NAME_FORMAT, LPCWSTR, PULONG);
static wchar_t wbuffer[1024];
DWORD len;