From fb8a1186f6f9aa811dddcdbfd06ea6447d3275cf Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 2 Dec 2018 23:48:19 +0100 Subject: [PATCH] Use decltype(sizeof(void*)) as a facsimile for std::size_t. Clang demands that the size argument to the various operator new()'s to be exactly whatever it thinks std::size_t is. Since we can't include STL headers, this little trick will do. --- AK/Types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/Types.h b/AK/Types.h index ba1f1778c4..2854fabaa3 100644 --- a/AK/Types.h +++ b/AK/Types.h @@ -11,7 +11,7 @@ typedef signed short signed_word; typedef signed int signed_dword; typedef signed long long int signed_qword; -typedef unsigned long size_t; +typedef decltype(sizeof(void*)) size_t; typedef long ssize_t; static_assert(sizeof(size_t) == sizeof(dword));