Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2006:
[Freeciv-Dev] (PR#15126) patch: fc_free macro
Home

[Freeciv-Dev] (PR#15126) patch: fc_free macro

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#15126) patch: fc_free macro
From: "Christian Prochaska" <cp.ml.freeciv.dev@xxxxxxxxxxxxxx>
Date: Mon, 9 Jan 2006 21:19:37 -0800
Reply-to: bugs@xxxxxxxxxxx

<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 <=