+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
-* Copyright (C) 1998-2012, International Business Machines Corporation
+* Copyright (C) 1998-2016, International Business Machines Corporation
* and others. All Rights Reserved.
**********************************************************************
*
#include "unicode/uwmsg.h"
#include "unicode/ures.h"
#include "unicode/putil.h"
+#include "cmemory.h"
#include "cstring.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#define LENGTHOF(array) (sizeof(array)/sizeof((array)[0]))
-
#define BUF_SIZE 128
/* Print a ustring to the specified FILE* in the default codepage */
va_list ap;
#endif
UChar result[4096];
- int32_t resultLength = LENGTHOF(result);
+ int32_t resultLength = UPRV_LENGTHOF(result);
if(gBundle == NULL)
{
}
#if UCONFIG_NO_FORMATTING
- resultLength = sizeof(gNoFormatting) / U_SIZEOF_UCHAR;
- if((msgLen + resultLength) <= LENGTHOF(result)) {
+ resultLength = UPRV_LENGTHOF(gNoFormatting);
+ if((msgLen + resultLength) <= UPRV_LENGTHOF(result)) {
memcpy(result, msg, msgLen * U_SIZEOF_UCHAR);
memcpy(result + msgLen, gNoFormatting, resultLength);
resultLength += msgLen;
uprint(msg,msgLen, fp, &err);
}
#else
+ (void)gNoFormatting; // suppress -Wunused-variable
va_start(ap, tag);
resultLength = u_vformatMessage(uloc_getDefault(), msg, msgLen, result, resultLength, ap, &err);