ref: 66946a6c3b8410def1efad881bbeadbe8556a277
parent: a28fd682ca68f2267bbc670a0f998259bbd95476
author: Erik de Castro Lopo <erikd@miles>
date: Sun Nov 7 04:01:30 EST 2004
Add OFFSETOF macro.
--- a/src/common.h
+++ b/src/common.h
@@ -33,9 +33,11 @@
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0])))
+#define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0])))
+#define OFFSETOF(type,member) ((int) (&((type*) 0)->member))
#define MAKE_MAGIC(a,b,c,d,e,f) ((a) + ((b) << 4) + ((c) << 8) + ((d) << 12) + ((e) << 16) + ((f) << 20))
+
#include "samplerate.h"