This commit is contained in:
bing
2026-04-02 23:18:28 +08:00
commit 6198e1b53c
112 changed files with 20893 additions and 0 deletions

29
tools/win32/compat.c Normal file
View File

@@ -0,0 +1,29 @@
// Copyright 2007 - 2021, Alan Antonuk and the rabbitmq-c contributors.
// SPDX-License-Identifier: mit
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "compat.h"
int asprintf(char **strp, const char *fmt, ...) {
va_list ap;
int len;
va_start(ap, fmt);
len = _vscprintf(fmt, ap);
va_end(ap);
*strp = malloc(len + 1);
if (!*strp) {
return -1;
}
va_start(ap, fmt);
_vsnprintf(*strp, len + 1, fmt, ap);
va_end(ap);
(*strp)[len] = 0;
return len;
}