+#if PSI_THREADED_PARSER
+static void psi_smart_str_printf(smart_str *ss, const char *fmt, ...)
+{
+ va_list argv;
+ char *buf;
+ int len;
+
+ va_start(argv, fmt);
+ len = vasprintf(&buf, fmt, argv);
+ va_end(argv);
+
+ if (len != -1) {
+ smart_str_appendl_ex(ss, buf, len, 1);
+ free(buf);
+ }
+}
+#else
+# define psi_smart_str_printf smart_str_append_printf
+#endif
+