diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-11-01 20:44:12 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-11-01 20:44:12 +0100 |
commit | e5081d6dad3924ac0a816878a6af5266f87bbfb7 (patch) | |
tree | 710797bc5578c1a9f0bc7e0cb5d2a51c526aebfd | |
parent | 7bdb571ec4eea6689fa08f40be8b4c0133504f50 (diff) | |
download | samba-e5081d6dad3924ac0a816878a6af5266f87bbfb7.tar.gz samba-e5081d6dad3924ac0a816878a6af5266f87bbfb7.tar.bz2 samba-e5081d6dad3924ac0a816878a6af5266f87bbfb7.zip |
Move ABS() to libutil.
-rw-r--r-- | lib/util/util.h | 4 | ||||
-rw-r--r-- | source3/include/smb_macros.h | 24 |
2 files changed, 4 insertions, 24 deletions
diff --git a/lib/util/util.h b/lib/util/util.h index 0f09747a3a..ec1cfef110 100644 --- a/lib/util/util.h +++ b/lib/util/util.h @@ -67,6 +67,10 @@ size_t valgrind_strlen(const char *s); #endif #endif +#ifndef ABS +#define ABS(a) ((a)>0?(a):(-(a))) +#endif + #include "../lib/util/memory.h" /** diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 668dc186d3..b8e087362a 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -34,19 +34,6 @@ #define IS_DOS_SYSTEM(test_mode) (((test_mode) & aSYSTEM) != 0) #define IS_DOS_HIDDEN(test_mode) (((test_mode) & aHIDDEN) != 0) -#ifndef SAFE_FREE /* Oh no this is also defined in tdb.h */ - -/** - * Free memory if the pointer and zero the pointer. - * - * @note You are explicitly allowed to pass NULL pointers -- they will - * always be ignored. - **/ -#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) -#endif - - - #define SMB_WARN(condition, message) \ ((condition) ? (void)0 : \ DEBUG(0, ("WARNING: %s: %s\n", #condition, message))) @@ -105,17 +92,6 @@ #define VALID_STAT_OF_DIR(st) (VALID_STAT(st) && S_ISDIR((st).st_mode)) #define SET_STAT_INVALID(st) ((st).st_nlink = 0) -#ifndef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) -#endif -#ifndef MAX -#define MAX(a,b) ((a)>(b)?(a):(b)) -#endif - -#ifndef ABS -#define ABS(a) ((a)>0?(a):(-(a))) -#endif - /* Macros to get at offsets within smb_lkrng and smb_unlkrng structures. We cannot define these as actual structures due to possible differences in structure packing |