aboutsummaryrefslogtreecommitdiffstats
path: root/common/t-support.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-02-26 15:18:45 +0000
committerWerner Koch <[email protected]>2014-02-26 15:18:45 +0000
commitc72762f9acf3eef5c466ba76e895d7654df12ff7 (patch)
treebcb93136c589e406f69ae0d219402c5300d05654 /common/t-support.h
parentcommon: New function get_membuf_shrink. (diff)
downloadgnupg-c72762f9acf3eef5c466ba76e895d7654df12ff7.tar.gz
gnupg-c72762f9acf3eef5c466ba76e895d7654df12ff7.zip
common: New function map_static_macro_string.
* common/mapstrings.c: New. * common/t-mapstrings.c: New. * common/t-support.h (DIM, DIMof): Define if not defined. * common/Makefile.am: Add new files.
Diffstat (limited to '')
-rw-r--r--common/t-support.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/t-support.h b/common/t-support.h
index 8316909b5..0dfcc7a40 100644
--- a/common/t-support.h
+++ b/common/t-support.h
@@ -44,6 +44,11 @@
# 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);