mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2024-12-28 04:23:36 +01:00
defs: use C++ min/max when compiling in C++ mode
This commit is contained in:
parent
1272a6a71a
commit
d3b29c50e6
1 changed files with 6 additions and 0 deletions
|
@ -14,6 +14,11 @@
|
|||
#define GAUTOTYPE __auto_type
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <algorithm>
|
||||
using std::min;
|
||||
using std::max;
|
||||
#else
|
||||
/* min(), max() (without double evaluation) */
|
||||
#define min(a, b) ({ \
|
||||
GAUTOTYPE _a = (a); \
|
||||
|
@ -25,6 +30,7 @@
|
|||
GAUTOTYPE _b = (b); \
|
||||
_a > _b ? _a : _b; \
|
||||
})
|
||||
#endif
|
||||
|
||||
/* sgn() (without double evaluation) */
|
||||
#define sgn(s) ({ \
|
||||
|
|
Loading…
Reference in a new issue