diff options
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/logger.cpp | 11 | ||||
-rw-r--r-- | core/io/marshalls.cpp | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/core/io/logger.cpp b/core/io/logger.cpp index b94007d316..ad6371f1e1 100644 --- a/core/io/logger.cpp +++ b/core/io/logger.cpp @@ -33,6 +33,17 @@ #include "os/os.h" #include "print_string.h" +// va_copy was defined in the C99, but not in C++ standards before C++11. +// When you compile C++ without --std=c++<XX> option, compilers still define +// va_copy, otherwise you have to use the internal version (__va_copy). +#if !defined(va_copy) +#if defined(__GNUC__) +#define va_copy(d, s) __va_copy(d, s) +#else +#define va_copy(d, s) ((d) = (s)) +#endif +#endif + bool Logger::should_log(bool p_err) { return (!p_err || _print_error_enabled) && (p_err || _print_line_enabled); } diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 0834d6c321..d388a622de 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -1140,8 +1140,9 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo if (buf) { encode_uint32(0, buf); buf += 4; - r_len += 4; } + r_len += 4; + } else { _encode_string(obj->get_class(), buf, r_len); |