diff options
author | cathook <cat.hook31894@gmail.com> | 2013-11-26 14:32:01 +0800 |
---|---|---|
committer | cathook <cat.hook31894@gmail.com> | 2013-11-26 14:32:01 +0800 |
commit | 5cb2c7120019e90d66efa903e0a14b4ffdd0791a (patch) | |
tree | 8ac55c67f0305e1dd3be3df3b5d34a82e0f1be98 | |
parent | c021f2340849cbd27bd6c9638848fa71529f90c4 (diff) | |
parent | de1d5e2e0935df9b9458222ffdbc1d257ffc5c24 (diff) | |
download | ctl-5cb2c7120019e90d66efa903e0a14b4ffdd0791a.tar.gz ctl-5cb2c7120019e90d66efa903e0a14b4ffdd0791a.tar.zst ctl-5cb2c7120019e90d66efa903e0a14b4ffdd0791a.zip |
Merge branch 'feature-utility' into develop
-rw-r--r-- | include/utility.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/utility.h b/include/utility.h index f51a646..2e2de7e 100644 --- a/include/utility.h +++ b/include/utility.h @@ -36,6 +36,8 @@ /* ctl_free like free(), but will return NULL */ /* ctl_die print some message and exit() */ /* ctl_swap swap two elements with given type */ +/* ctl_max return the max of the two arguments */ +/* ctl_min return the min of the two arguments */ /* */ /**********************************************************/ @@ -104,5 +106,7 @@ pvoid ctl_free (pvoid ptr); void ctl_die (ErrorType e); #define ctl_swap(X,Y,Z) do{X zzzztmp=(Y);(Y)=(Z);(Z)=zzzztmp;}while(0) +#define ctl_max(X,Y) ((X) > (Y) ? (X) : (Y)) +#define ctl_min(X,Y) ((X) < (Y) ? (X) : (Y)) #endif /* __utility_h__ */ |