Skip to content

Instantly share code, notes, and snippets.

@benstiglitz
Created August 11, 2011 15:37

Revisions

  1. benstiglitz created this gist Aug 11, 2011.
    3 changes: 3 additions & 0 deletions sys_param-better.h
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #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__)