aboutsummaryrefslogtreecommitdiff
path: root/subversion/include/private/svn_string_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/include/private/svn_string_private.h')
-rw-r--r--subversion/include/private/svn_string_private.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/subversion/include/private/svn_string_private.h b/subversion/include/private/svn_string_private.h
index 2f162733db81..25e42049db7b 100644
--- a/subversion/include/private/svn_string_private.h
+++ b/subversion/include/private/svn_string_private.h
@@ -131,6 +131,14 @@ svn_membuf__nzero(svn_membuf_t *membuf, apr_size_t size);
svn_string_t *
svn_stringbuf__morph_into_string(svn_stringbuf_t *strbuf);
+/** Utility macro to define static svn_string_t objects. @a value must
+ * be a static string; the "" in the macro declaration tries to ensure this.
+ *
+ * Usage:
+ * static const svn_string_t my_string = SVN__STATIC_STRING("my text");
+ */
+#define SVN__STATIC_STRING(value) { value "", sizeof(value "") - 1 }
+
/** Like strtoul but with a fixed base of 10 and without overflow checks.
* This allows the compiler to generate massively faster (4x on 64bit LINUX)
* code. Overflow checks may be added on the caller side where you might