Add compilation test script

This commit is contained in:
Vinnie Falco
2013-09-27 17:13:36 -07:00
parent cc05ce19f9
commit 0b7574ba00
34 changed files with 343 additions and 241 deletions

View File

@@ -24,8 +24,11 @@
#ifndef BEAST_STRINGS_CHARACTERFUNCTIONS_H_INCLUDED
#define BEAST_STRINGS_CHARACTERFUNCTIONS_H_INCLUDED
#include <limits>
#include "../Config.h"
#include "../CStdInt.h"
#include "../Memory.h"
namespace beast {
@@ -329,8 +332,11 @@ public:
static size_t copyWithDestByteLimit (DestCharPointerType& dest, SrcCharPointerType src, size_t maxBytesToWrite) noexcept
{
typename DestCharPointerType::CharType const* const startAddress = dest.getAddress();
ssize_t maxBytes = (ssize_t) maxBytesToWrite;
maxBytes -= sizeof (typename DestCharPointerType::CharType); // (allow for a terminating null)
size_t maxBytes = maxBytesToWrite;
if (maxBytes >= sizeof (typename DestCharPointerType::CharType))
maxBytes -= sizeof (typename DestCharPointerType::CharType); // (allow for a terminating null)
else
maxBytes = 0;
for (;;)
{