1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-17 14:27:11 +02:00

Initial revision of the buffer implementation.

This commit is contained in:
Sandu Liviu Catalin
2016-07-08 00:56:54 +03:00
parent e5f9fffd8e
commit 4e93e58397
13 changed files with 1001 additions and 1201 deletions

View File

@ -1,5 +1,6 @@
// ------------------------------------------------------------------------------------------------
#include "Base/Buffer.hpp"
#include "sqrat/sqratUtil.h"
// ------------------------------------------------------------------------------------------------
#include <cstdlib>
@ -30,7 +31,7 @@ inline unsigned int NextPow2(unsigned int num)
void ThrowMemExcept(const char * msg, ...)
{
// Exception messages should be concise
char buffer[128];
char buffer[256];
// Variable arguments structure
va_list args;
// Get the specified arguments
@ -40,10 +41,10 @@ void ThrowMemExcept(const char * msg, ...)
// Check for formatting errors
if (ret < 0)
{
throw std::runtime_error("Unknown memory error");
throw Sqrat::Exception("Unknown memory error");
}
// Throw the actual exception
throw std::runtime_error(buffer);
throw Sqrat::Exception(buffer);
}
/* ------------------------------------------------------------------------------------------------