]> www.git.momoyon.org Git - commonlib.git/commitdiff
[commonlib.h] Make memory allocation funcs redefinable.
authorahmedsamyh <ahmedsamyh10@gmail.com>
Wed, 26 Feb 2025 18:01:28 +0000 (23:01 +0500)
committerahmedsamyh <ahmedsamyh10@gmail.com>
Wed, 26 Feb 2025 18:01:28 +0000 (23:01 +0500)
commonlib.h

index 460fe4bd084d6ed0c21ead5a2c52901e56ce88a1..1604c4f646a8eafb992cf37683a1c73eebcc5aee 100644 (file)
@@ -9,12 +9,6 @@
 #include <ctype.h>\r
 #include <assert.h>\r
 \r
-// Memory allocation\r
-#define C_MALLOC malloc\r
-#define C_FREE free\r
-#define C_REALLOC realloc\r
-#define C_MEMCPY memcpy\r
-\r
 // Remove Prefix\r
 #ifdef COMMONLIB_REMOVE_PREFIX\r
 #define ASSERT c_ASSERT\r
 \r
 #endif // COMMONLIB_REMOVE_PREFIX\r
 \r
+// Memory allocation\r
+#ifndef C_MALLOC\r
+#define C_MALLOC malloc\r
+#endif\r
+#ifndef C_FREE\r
+#define C_FREE free\r
+#endif\r
+#ifndef C_REALLOC\r
+#define C_REALLOC realloc\r
+#endif\r
+#ifndef C_MEMCPY\r
+#define C_MEMCPY memcpy\r
+#endif\r
+\r
+\r
 // typedefs\r
 typedef unsigned int uint;\r
 typedef uint8_t      uint8;\r