Update docs. Redo MIN,MAX macros

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2982 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 1998-09-18 13:51:00 +00:00
parent 20e45475c4
commit 30dc8b0b15
3 changed files with 7 additions and 43 deletions

View file

@ -52,34 +52,9 @@
[a release]; \
a = b;
#ifdef MIN
# undef MIN
#endif
#define MIN(a, b) \
({typedef _ta = (a), _tb = (b); \
_ta _a = (a); _tb _b = (b); \
_a < _b ? _a : _b; })
#ifdef MAX
# undef MAX
#endif
#define MAX(a, b) \
({typedef _ta = (a), _tb = (b); \
_ta _a = (a); _tb _b = (b); \
_a > _b ? _a : _b; })
#ifdef ABS
# undef ABS
#endif
#define ABS(x) \
({typedef _tx = (x); \
_tx _x = (x); \
_x >= 0 ? _x : -_x; })
#define SIGN(x) \
({typedef _tx = (x); \
_tx _x = (x); \
_x > 0 ? 1 : (_x == 0 ? 0 : -1); })
({typeof(x) _SIGN_x = (x); \
_SIGN_x > 0 ? 1 : (_SIGN_x == 0 ? 0 : -1); })
#define FREE(p) do { if (p) free (p); } while (0)