+#if HAVE_VSNPRINTF
+ vsnprintf (errStr, sizeof(errStr), msg, arg);
+#elif HAVE_VSPRINTF
+ vsprintf (errStr, msg, arg);
+#else
+ strncpy (errStr, sizeof(errStr), "Error message not available on this platform.");
+#endif
+
+ os << errStr << "\n";
+ strOutput = os.str();
+
+ if (severity == ERR_FATAL) {
+ std::cerr << strOutput;
+ throw std::runtime_error (strOutput);
+ }