aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexlib/StringCopy.h
diff options
context:
space:
mode:
Diffstat (limited to 'lexlib/StringCopy.h')
-rw-r--r--lexlib/StringCopy.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lexlib/StringCopy.h b/lexlib/StringCopy.h
index caca49911..1812b4e35 100644
--- a/lexlib/StringCopy.h
+++ b/lexlib/StringCopy.h
@@ -1,6 +1,7 @@
// Scintilla source code edit control
/** @file StringCopy.h
** Safe string copy function which always NUL terminates.
+ ** ELEMENTS macro for determining array sizes.
**/
// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
@@ -26,6 +27,8 @@ void StringCopy(T (&dest)[count], const T* source) {
dest[count-1] = 0;
}
+#define ELEMENTS(a) (sizeof(a) / sizeof(a[0]))
+
#ifdef SCI_NAMESPACE
}
#endif