Index: source/common/cmemory.h |
diff --git a/source/common/cmemory.h b/source/common/cmemory.h |
index f5c063b2ec79ea3c22d0a3719b04e5801f355524..ed29b63e8f9f736aa278760809fed571e51dd4e7 100644 |
--- a/source/common/cmemory.h |
+++ b/source/common/cmemory.h |
@@ -1,7 +1,7 @@ |
/* |
****************************************************************************** |
* |
-* Copyright (C) 1997-2012, International Business Machines |
+* Copyright (C) 1997-2014, International Business Machines |
* Corporation and others. All Rights Reserved. |
* |
****************************************************************************** |
@@ -59,6 +59,14 @@ U_CAPI void uprv_checkValidMemory(const void *p, size_t n); |
#endif /* U_DEBUG */ |
+/** |
+ * \def UPRV_LENGTHOF |
+ * Convenience macro to determine the length of a fixed array at compile-time. |
+ * @param array A fixed length array |
+ * @return The length of the array, in elements |
+ * @internal |
+ */ |
+#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) |
#define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size) |
#define uprv_memcmp(buffer1, buffer2, size) U_STANDARD_CPP_NAMESPACE memcmp(buffer1, buffer2,size) |