SDCardUtil: Namespace SDCardUtil

Brings yet another header in the common library under the Common
namespace.
This commit is contained in:
Lioncash 2018-05-11 09:16:30 -04:00
parent 4e1547b3b2
commit 3b0139b258
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
3 changed files with 7 additions and 1 deletions

View File

@ -56,6 +56,8 @@
#pragma warning(disable : 4310) #pragma warning(disable : 4310)
#endif #endif
namespace Common
{
/* Believe me, you *don't* want to change these constants !! */ /* Believe me, you *don't* want to change these constants !! */
#define BYTES_PER_SECTOR 512 #define BYTES_PER_SECTOR 512
#define RESERVED_SECTORS 32 #define RESERVED_SECTORS 32
@ -286,6 +288,7 @@ FailWrite:
ERROR_LOG(COMMON, "unlink(%s) failed: %s", filename.c_str(), LastStrerrorString().c_str()); ERROR_LOG(COMMON, "unlink(%s) failed: %s", filename.c_str(), LastStrerrorString().c_str());
return false; return false;
} }
} // namespace Common
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)

View File

@ -7,4 +7,7 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
namespace Common
{
bool SDCardCreate(u64 disk_size /*in MB*/, const std::string& filename); bool SDCardCreate(u64 disk_size /*in MB*/, const std::string& filename);
} // namespace Common

View File

@ -67,7 +67,7 @@ void SDIOSlot0::OpenInternal()
if (!m_card) if (!m_card)
{ {
WARN_LOG(IOS_SD, "Failed to open SD Card image, trying to create a new 128MB image..."); WARN_LOG(IOS_SD, "Failed to open SD Card image, trying to create a new 128MB image...");
if (SDCardCreate(128, filename)) if (Common::SDCardCreate(128, filename))
{ {
INFO_LOG(IOS_SD, "Successfully created %s", filename.c_str()); INFO_LOG(IOS_SD, "Successfully created %s", filename.c_str());
m_card.Open(filename, "r+b"); m_card.Open(filename, "r+b");