summaryrefslogtreecommitdiff
path: root/libs/ode-0.16.1/libccd/src/alloc.c
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-10-01 20:59:36 -0500
committersanine <sanine.not@pm.me>2022-10-01 20:59:36 -0500
commitc5fc66ee58f2c60f2d226868bb1cf5b91badaf53 (patch)
tree277dd280daf10bf77013236b8edfa5f88708c7e0 /libs/ode-0.16.1/libccd/src/alloc.c
parent1cf9cc3408af7008451f9133fb95af66a9697d15 (diff)
add ode
Diffstat (limited to 'libs/ode-0.16.1/libccd/src/alloc.c')
-rw-r--r--libs/ode-0.16.1/libccd/src/alloc.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/libs/ode-0.16.1/libccd/src/alloc.c b/libs/ode-0.16.1/libccd/src/alloc.c
new file mode 100644
index 0000000..d3fb213
--- /dev/null
+++ b/libs/ode-0.16.1/libccd/src/alloc.c
@@ -0,0 +1,38 @@
+/***
+ * libccd
+ * ---------------------------------
+ * Copyright (c)2010 Daniel Fiser <danfis@danfis.cz>
+ *
+ *
+ * This file is part of libccd.
+ *
+ * Distributed under the OSI-approved BSD License (the "License");
+ * see accompanying file BDS-LICENSE for details or see
+ * <http://www.opensource.org/licenses/bsd-license.php>.
+ *
+ * This software is distributed WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the License for more information.
+ */
+
+#include <stdio.h>
+#include <ccd/alloc.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
+void *ccdRealloc(void *ptr, size_t size)
+{
+ void *ret = realloc(ptr, size);
+ if (ret == NULL && size != 0){
+ fprintf(stderr, "Fatal error: Allocation of memory failed!\n");
+ fflush(stderr);
+ exit(-1);
+ }
+
+ return ret;
+}
+
+