1
0
Fork 0

Define a max macro (within a header) in utils.

This commit is contained in:
wael 2022-03-05 17:07:41 +02:00
parent cd6121019b
commit 023b14e194
No known key found for this signature in database
GPG Key ID: C0A5FBF4558963D4
1 changed files with 8 additions and 0 deletions

8
utils/max_macro.h Normal file
View File

@ -0,0 +1,8 @@
/* Include gaurd. */
#ifndef MAX_MACRO_H
#define MAX_MACRO_H
#define max(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
#endif /* MAX_MACRO_H. */