From 384673ceb7a8160e6ef836eda0382de60b781b5c Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 21 Jan 2015 15:56:14 -0500 Subject: [PATCH] Fix tool build on Windows. C++ doesn't allow implicit void* casts. Change-Id: I50a2ab3fce6a38470b4e8216bd461ba2cd2c2215 Reviewed-on: https://boringssl-review.googlesource.com/2971 Reviewed-by: Adam Langley --- tool/speed.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tool/speed.cc b/tool/speed.cc index 6bc74bef..cfffcb05 100644 --- a/tool/speed.cc +++ b/tool/speed.cc @@ -170,7 +170,13 @@ struct free_functor { }; #if defined(OPENSSL_WINDOWS) -#define AllocAligned malloc +uint8_t *AllocAligned(size_t size) { + void *ptr = malloc(size); + if (ptr == NULL) { + abort(); + } + return static_cast(ptr); +} #else uint8_t *AllocAligned(size_t size) { void *ptr;