summaryrefslogtreecommitdiff
path: root/gc_cpp.cc
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-04-17 23:53:44 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-04-17 23:53:44 +0300
commit8fe38c6fbd7725fa4c3d4e8132d440251e73e807 (patch)
treea1c8aaed560b0d7bdaafc4a8b296af7fe749b20e /gc_cpp.cc
parentd70772a42debc40d4c13fd735913ee6ae322aa9b (diff)
downloadbdwgc-8fe38c6fbd7725fa4c3d4e8132d440251e73e807.tar.gz
Fix 'size_t not found in namespace std' dmc error in gc_allocator.h
(fix of commit 08eb0da6f) * gc_cpp.cc (operator new, operator delete): Use GC_SIZE_T instead of std::size_t. * include/gc/gc_allocator.h (GC_ALCTR_PTRDIFF_T, GC_ALCTR_SIZE_T): Define macro (and undefine it at the end of file). * include/gc/gc_allocator.h (GC_selective_alloc, gc_allocator.size_type, gc_allocator.max_size, gc_allocator_ignore_off_page.size_type, gc_allocator_ignore_off_page.max_size, traceable_allocator.size_type, traceable_allocator.max_size): Use GC_ALCTR_SIZE_T instead of std::size_t. * include/gc/gc_allocator.h (gc_allocator.difference_type, gc_allocator_ignore_off_page.difference_type, traceable_allocator.difference_type): Use GC_ALCTR_PTRDIFF_T instead of std::ptrdiff_t. * include/gc/gc_cpp.h [GC_INCLUDE_NEW] (GC_PTRDIFF_T, GC_SIZE_T): Do not use std:: prefix unless __cplusplus>=201103L.
Diffstat (limited to 'gc_cpp.cc')
-rw-r--r--gc_cpp.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/gc_cpp.cc b/gc_cpp.cc
index 0600625a..82d93c51 100644
--- a/gc_cpp.cc
+++ b/gc_cpp.cc
@@ -56,7 +56,7 @@ built-in "new" and "delete".
# define GC_DECL_NEW_THROW throw(std::bad_alloc)
# endif // GC_NEW_DELETE_NEED_THROW
- void* operator new(std::size_t size) GC_DECL_NEW_THROW {
+ void* operator new(GC_SIZE_T size) GC_DECL_NEW_THROW {
void* obj = GC_MALLOC_UNCOLLECTABLE(size);
if (0 == obj)
GC_ALLOCATOR_THROW_OR_ABORT();
@@ -65,7 +65,7 @@ built-in "new" and "delete".
# ifdef _MSC_VER
// This new operator is used by VC++ in case of Debug builds.
- void* operator new(std::size_t size, int /* nBlockUse */,
+ void* operator new(GC_SIZE_T size, int /* nBlockUse */,
const char* szFileName, int nLine)
{
# ifdef GC_DEBUG
@@ -85,7 +85,7 @@ built-in "new" and "delete".
}
# if defined(GC_OPERATOR_NEW_ARRAY) && !defined(CPPCHECK)
- void* operator new[](std::size_t size) GC_DECL_NEW_THROW {
+ void* operator new[](GC_SIZE_T size) GC_DECL_NEW_THROW {
void* obj = GC_MALLOC_UNCOLLECTABLE(size);
if (0 == obj)
GC_ALLOCATOR_THROW_OR_ABORT();
@@ -94,7 +94,7 @@ built-in "new" and "delete".
# ifdef _MSC_VER
// This new operator is used by VC++ 7+ in Debug builds.
- void* operator new[](std::size_t size, int nBlockUse,
+ void* operator new[](GC_SIZE_T size, int nBlockUse,
const char* szFileName, int nLine)
{
return operator new(size, nBlockUse, szFileName, nLine);
@@ -107,12 +107,12 @@ built-in "new" and "delete".
# endif // GC_OPERATOR_NEW_ARRAY
# if __cplusplus >= 201402L || _MSVC_LANG >= 201402L // C++14
- void operator delete(void* obj, std::size_t) GC_NOEXCEPT {
+ void operator delete(void* obj, GC_SIZE_T) GC_NOEXCEPT {
GC_FREE(obj);
}
# if defined(GC_OPERATOR_NEW_ARRAY) && !defined(CPPCHECK)
- void operator delete[](void* obj, std::size_t) GC_NOEXCEPT {
+ void operator delete[](void* obj, GC_SIZE_T) GC_NOEXCEPT {
GC_FREE(obj);
}
# endif