]> www.ginac.de Git - cln.git/blobdiff - src/base/string/cl_spushstring_append.cc
Fix compilation error on MSVC.
[cln.git] / src / base / string / cl_spushstring_append.cc
index 245d7a2b9036e7962549a5d2c8fd27980b0099ff..3dd54a82bf81af3c5c589a14327b1d0f3fce6817 100644 (file)
@@ -1,24 +1,26 @@
 // class cl_spushstring.
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
-#include "cl_spushstring.h"
+#include "base/string/cl_spushstring.h"
 
 
 // Implementation.
 
-#include <string.h> // declares memcpy()
+#include <cstring> // declares memcpy()
+
+namespace cln {
 
 void cl_spushstring::append (const char * ptr, uintL len)
 {
        if (index + len > alloc) {
                var uintL newalloc = index+2*len;
                if (newalloc < 2*alloc) { newalloc = 2*alloc; }
-               var char* newbuffer = (char *) cl_malloc_hook(newalloc);
+               var char* newbuffer = (char *) malloc_hook(newalloc);
                memcpy(newbuffer,buffer,alloc);
-               cl_free_hook(buffer);
+               free_hook(buffer);
                buffer = newbuffer;
                alloc = newalloc;
        }
@@ -26,3 +28,5 @@ void cl_spushstring::append (const char * ptr, uintL len)
        for (uintL count = len; count > 0; count--)
                buffer[index++] = *ptr++;
 }
+
+}  // namespace cln