Added common folder, with a new string helper file.

This commit is contained in:
archshift 2014-12-10 22:16:52 -08:00
parent d68e67e7d7
commit 75575b4a41
5 changed files with 36 additions and 2 deletions

View File

@ -19,7 +19,7 @@ include $(DEVKITARM)/3ds_rules
#---------------------------------------------------------------------------------
export TARGET := $(shell basename $(CURDIR))
BUILD := build
SOURCES := source source/tests source/tests/fs source/tests/cpu
SOURCES := source source/common source/tests source/tests/fs source/tests/cpu
DATA := data
INCLUDES := source #include

View File

@ -0,0 +1,25 @@
#include "string_funcs.h"
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
namespace Common {
std::string FormatString(const char* format, ...)
{
va_list arguments;
char *va_str;
va_start(arguments, format);
vasprintf(&va_str, format, arguments);
va_end(arguments);
std::string out_str(va_str);
free(va_str);
return out_str;
}
}

View File

@ -0,0 +1,9 @@
#pragma once
#include <string>
namespace Common {
std::string FormatString(const char* format, ...);
}

View File

@ -2,7 +2,7 @@
#include <cstring>
#include <3ds.h>
#include "scope_exit.h"
#include "common/scope_exit.h"
#include "tests/test.h"
#include "tests/fs/fs_sdmc.h"