From: GetAway Date: Fri, 13 Jan 2017 19:34:03 +0000 (+0100) Subject: change 'max' macro to be GNU C++ compatible X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=ac2fd2e7e585569c1238a23c96011793ed15cb94;p=msgbox.git change 'max' macro to be GNU C++ compatible --- diff --git a/msgbox.c b/msgbox.c index acd1773..5dbaab9 100644 --- a/msgbox.c +++ b/msgbox.c @@ -12,9 +12,10 @@ #include "pngw.h" -#define max(a,b) ( \ - { __auto_type __a = (a); __auto_type __b = (b); \ - __a > __b ? __a : __b; }) +#define max(a,b) ({ \ + typeof (a) __a = (a); \ + typeof (b) __b = (b); \ + __a > __b ? __a : __b; }) #define M_VERSION 2.0