summaryrefslogtreecommitdiff
path: root/src/shared/macro.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/macro.h')
-rw-r--r--src/shared/macro.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/macro.h b/src/shared/macro.h
index 179b24c983..43fa3e556f 100644
--- a/src/shared/macro.h
+++ b/src/shared/macro.h
@@ -149,6 +149,9 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
((_A) > (_B)) ? (_A) : (_B), \
(void)0))
+/* takes two types and returns the size of the larger one */
+#define MAXSIZE(A, B) (sizeof(union _packed_ { typeof(A) a; typeof(B) b; }))
+
#define MAX3(x,y,z) \
__extension__ ({ \
const typeof(x) _c = MAX(x,y); \