ucx/mempool.c

changeset 335
c1bc13faadaa
parent 314
8722a668fb2a
child 505
481802342fdf
--- 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 <stdlib.h>
 #include <string.h>
 #include <stdio.h>
@@ -34,8 +36,6 @@
 #endif
 #include <inttypes.h>
 
-#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);
 }

mercurial