[Freeciv-Dev] (PR#15126) patch: fc_free macro
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=15126 >
This patch adds a macro "fc_free" to utility/mem.h:
#define fc_free(ptr) { free(ptr); ptr = NULL; }
It's meant to replace the "FREE" macro in gui-sdl/gui_mem.h (PR#3372),
but might be useful at other places, too.
Index: utility/mem.h
===================================================================
--- utility/mem.h (Revision 11431)
+++ utility/mem.h (Arbeitskopie)
@@ -29,6 +29,8 @@
__LINE__, __FILE__)
#define fc_calloc(n,esz) fc_real_calloc((n), (esz), "calloc", \
__LINE__, __FILE__)
+
+#define fc_free(ptr) { free(ptr); ptr = NULL; }
#define mystrdup(str) real_mystrdup((str), "strdup", \
__LINE__, __FILE__)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#15126) patch: fc_free macro,
Christian Prochaska <=
|
|