diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2000-09-26 04:58:35 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2000-09-26 04:58:35 +0000 |
commit | a2c3e5ecc9d0ade4fbff56e22fa87d6050601475 (patch) | |
tree | e04f36f7d333c0bbd3fb5745f8485fd5b667070a | |
parent | fd61e791b5c199efe843ad7e913718643042a219 (diff) | |
download | tinyproxy-a2c3e5ecc9d0ade4fbff56e22fa87d6050601475.tar.gz tinyproxy-a2c3e5ecc9d0ade4fbff56e22fa87d6050601475.zip |
Moved the safefree() macro to the tinyproxy.h header.
-rw-r--r-- | src/tinyproxy.h | 8 | ||||
-rw-r--r-- | src/utils.h | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/tinyproxy.h b/src/tinyproxy.h index 5ca4f18..28a1ff0 100644 --- a/src/tinyproxy.h +++ b/src/tinyproxy.h @@ -1,4 +1,4 @@ -/* $Id: tinyproxy.h,v 1.5 2000-09-14 16:41:20 rjkaes Exp $ +/* $Id: tinyproxy.h,v 1.6 2000-09-26 04:58:35 rjkaes Exp $ * * See 'tinyproxy.c' for a detailed description. * @@ -69,6 +69,12 @@ #define min(a,b) ((a) < (b) ? (a) : (b)) #define max(a,b) ((a) > (b) ? (a) : (b)) +#ifndef NDEBUG +# define safefree(x) do { free(x); x = NULL; } while (0) +#else +# define safefree(x) free(x) +#endif + /* Make a new type: bool_t */ typedef enum { FALSE = 0, diff --git a/src/utils.h b/src/utils.h index 25c983c..2e80567 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,4 +1,4 @@ -/* $Id: utils.h,v 1.2 2000-09-12 00:01:29 rjkaes Exp $ +/* $Id: utils.h,v 1.3 2000-09-26 04:58:35 rjkaes Exp $ * * See 'utils.h' for a detailed description. * @@ -21,8 +21,6 @@ #include "tinyproxy.h" -#define safefree(x) free(x); x = NULL - extern char *xstrstr(char *haystack, char *needle, size_t length, bool_t case_sensitive); |