diff options
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/includes.h | 3 | ||||
-rw-r--r-- | source3/include/smb_macros.h | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index 982eee1886..20f5304591 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1372,4 +1372,7 @@ LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to); #undef HAVE_MMAP #endif +#define CONST_DISCARD(type, ptr) ((type) ((void *) (ptr))) +#define CONST_ADD(type, ptr) ((type) ((const void *) (ptr))) + #endif /* _INCLUDES_H */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 9a78718605..2b3140783b 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -43,7 +43,7 @@ * @note You are explicitly allowed to pass NULL pointers -- they will * always be ignored. **/ -#define SAFE_FREE(x) do { if ((x) != NULL) {free((void *) (x)); x=NULL;} } while(0) +#define SAFE_FREE(x) do { if ((x) != NULL) {free(CONST_DISCARD(void *, (x))); x=NULL;} } while(0) #endif /* zero a structure */ |