mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 22:23:24 +00:00
Use __typeof__ instead of typeof in the header
This allows us to compile Subsurface with strict C or C++ mode. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
818bd9903a
commit
2fcf8411af
1 changed files with 4 additions and 4 deletions
8
dive.h
8
dive.h
|
@ -11,14 +11,14 @@
|
|||
|
||||
/* Windows has no MIN/MAX macros - so let's just roll our own */
|
||||
#define MIN(x, y) ({ \
|
||||
typeof(x) _min1 = (x); \
|
||||
typeof(y) _min2 = (y); \
|
||||
__typeof__(x) _min1 = (x); \
|
||||
__typeof__(y) _min2 = (y); \
|
||||
(void) (&_min1 == &_min2); \
|
||||
_min1 < _min2 ? _min1 : _min2; })
|
||||
|
||||
#define MAX(x, y) ({ \
|
||||
typeof(x) _max1 = (x); \
|
||||
typeof(y) _max2 = (y); \
|
||||
__typeof__(x) _max1 = (x); \
|
||||
__typeof__(y) _max2 = (y); \
|
||||
(void) (&_max1 == &_max2); \
|
||||
_max1 > _max2 ? _max1 : _max2; })
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue