Fix build after 7d3da7e968 (#54)

This commit is contained in:
Lucas Alber 2023-04-24 16:04:59 +02:00 committed by GitHub
parent 7d3da7e968
commit f9f08c802e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -613,32 +613,6 @@ static void wlr_init_xdg_outputs(struct xdpw_screencast_context *ctx) {
}
}
// stolen from LLVM cuz it wouldnt include lol
static inline int vasprintf(char **strp, const char *fmt, va_list ap) {
const size_t buff_size = 256;
if ((*strp = (char *)malloc(buff_size)) == NULL) {
return -1;
}
va_list ap_copy;
// va_copy may not be provided by the C library in C++ 03 mode.
#if defined(_LIBCPP_CXX03_LANG) && __has_builtin(__builtin_va_copy)
__builtin_va_copy(ap_copy, ap);
#else
va_copy(ap_copy, ap);
#endif
int str_size = vsnprintf(*strp, buff_size, fmt, ap_copy);
va_end(ap_copy);
if ((size_t)str_size >= buff_size) {
if ((*strp = (char *)realloc(*strp, str_size + 1)) == NULL) {
return -1;
}
str_size = vsnprintf(*strp, str_size + 1, fmt, ap);
}
return str_size;
}
char *buildWindowList(struct xdpw_screencast_context *ctx) {
char *rolling = calloc(1, 1);