From 2b67924a0b5f50175da418408dcb8768c2bd3646 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Wed, 13 Nov 2019 20:12:36 +0100 Subject: Mono/C#: Initial exporter support for AOT compilation --- modules/mono/utils/string_utils.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'modules/mono/utils/string_utils.cpp') diff --git a/modules/mono/utils/string_utils.cpp b/modules/mono/utils/string_utils.cpp index e9efc7626d..88366a6a03 100644 --- a/modules/mono/utils/string_utils.cpp +++ b/modules/mono/utils/string_utils.cpp @@ -216,6 +216,25 @@ String str_format(const char *p_format, ...) { #endif String str_format(const char *p_format, va_list p_list) { + char *buffer = str_format_new(p_format, p_list); + + String res(buffer); + memdelete_arr(buffer); + + return res; +} + +char *str_format_new(const char *p_format, ...) { + va_list list; + + va_start(list, p_format); + char *res = str_format_new(p_format, list); + va_end(list); + + return res; +} + +char *str_format_new(const char *p_format, va_list p_list) { va_list list; va_copy(list, p_list); @@ -230,8 +249,5 @@ String str_format(const char *p_format, va_list p_list) { gd_vsnprintf(buffer, len, p_format, list); va_end(list); - String res(buffer); - memdelete_arr(buffer); - - return res; + return buffer; } -- cgit v1.2.3