diff -r 5f80c5d0e87f -r c1bc13faadaa ucx/mempool.c --- a/ucx/mempool.c Sat Oct 28 15:25:17 2017 +0200 +++ b/ucx/mempool.c Sat Oct 28 16:50:03 2017 +0200 @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 2016 Olaf Wintermann. All rights reserved. + * Copyright 2017 Mike Becker, Olaf Wintermann All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -26,6 +26,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "ucx/mempool.h" + #include #include #include @@ -34,8 +36,6 @@ #endif #include -#include "mempool.h" - /** Capsule for destructible memory chunks. */ typedef struct { /** The destructor for the memory chunk. */ @@ -56,7 +56,10 @@ void *ptr; } ucx_regdestr; -UCX_EXTERN void ucx_mempool_shared_destr(void* ptr) { +#ifdef __cplusplus +extern "C" +#endif +void ucx_mempool_shared_destr(void* ptr) { ucx_regdestr *rd = (ucx_regdestr*)ptr; rd->destructor(rd->ptr); }