Hygenic and shadow-safe MIN.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define MIN_PASTE(A,B) A##B | |
#define MIN_IMPL(A,B,L) ({ __typeof__(A) MIN_PASTE(__a,L) = (A); __typeof__(B) MIN_PASTE(__b,L) = (B); MIN_PASTE(__a,L) < MIN_PASTE(__b,L) ? MIN_PASTE(__a,L) : MIN_PASTE(__b,L); }) | |
#define MIN(A,B) MIN_IMPL(A,B,__COUNTER__) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment