]> git.tdb.fi Git - gldbg.git/blobdiff - source/strformat.cpp
Remove dependencies to MSP libraries to make compiling on embedded platforms easier
[gldbg.git] / source / strformat.cpp
diff --git a/source/strformat.cpp b/source/strformat.cpp
new file mode 100644 (file)
index 0000000..188b121
--- /dev/null
@@ -0,0 +1,22 @@
+/* $Id$
+
+This file is part of gldbg
+Copyright © 2011  Mikko Rasa, Mikkosoft Productions
+Distributed under the GPL
+*/
+
+#include <stdio.h>
+#include <stdarg.h>
+#include "strformat.h"
+
+using namespace std;
+
+string strformat(const char *fmt, ...)
+{
+       va_list args;
+       va_start(args, fmt);
+       char buf[2048];
+       vsnprintf(buf, sizeof(buf), fmt, args);
+       va_end(args);
+       return buf;
+}