/*
*******************************************************************************
*
-* Copyright (C) 2003-2007, International Business Machines
+* © 2016 and later: Unicode, Inc. and others.
+* License & terms of use: http://www.unicode.org/copyright.html#License
+*
+*******************************************************************************
+*******************************************************************************
+*
+* Copyright (C) 2003-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
* file name: uciter8.c
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
#include "unicode/uiter.h"
#include "uit_len8.h"
-#define LENGTHOF(array) (sizeof(array)/sizeof((array)[0]))
+#ifndef UPRV_LENGTHOF
+#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
+#endif
#define log_err printf
compareIterators(&iter1, "UTF16Iterator", &iter2, "Lenient8Iterator_1");
/* test get/set state */
- length=LENGTHOF(text)-1;
+ length=UPRV_LENGTHOF(text)-1;
uiter_setLenient8(&iter1, (const char*)bytes, -1);
testIteratorState(&iter1, &iter2, "Lenient8IteratorState", length/2);
testIteratorState(&iter1, &iter2, "Lenient8IteratorStatePlus1", length/2+1);