Skip to content

Commit

Permalink
Handle already defined MAX and MIN macros
Browse files Browse the repository at this point in the history
  • Loading branch information
rootmos committed Jun 15, 2021
1 parent 26f3cde commit 6a61fd0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/r/util.h
Expand Up @@ -2,8 +2,14 @@

#define LENGTH(xs) (sizeof(xs)/sizeof((xs)[0]))
#define LIT(x) x,sizeof(x)

#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif

#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif

const char* getenv_mandatory(const char* const env);

Expand Down

0 comments on commit 6a61fd0

Please sign in to comment.