agent: Cleanups to prepare implementation of Ed25519.
[gnupg.git] / common / t-support.h
index 8316909..0dfcc7a 100644 (file)
 # define getenv(a)  (NULL)
 #endif
 
+#ifndef DIM
+# define DIM(v)                     (sizeof(v)/sizeof((v)[0]))
+# define DIMof(type,member)   DIM(((type *)0)->member)
+#endif
+
 
 /* Replacement prototypes. */
 void *gcry_xmalloc (size_t n);