]> granicus.if.org Git - icu/commitdiff
ICU-12793 Fixes in sample code.
authorYoshito Umaoka <y.umaoka@gmail.com>
Tue, 14 Mar 2017 21:37:41 +0000 (21:37 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Tue, 14 Mar 2017 21:37:41 +0000 (21:37 +0000)
X-SVN-Rev: 39803

icu4c/source/samples/numfmt/util.h
icu4c/source/samples/uciter8/uciter8.c
icu4c/source/samples/ucnv/convsamp.cpp
icu4c/source/samples/uresb/Makefile
icu4c/source/samples/ustring/ustring.cpp

index 415a246ae82beb8d1b72eacc427704d14123f4c9..b1c2679a00d8a11bd1e10b990423208d7198fab2 100644 (file)
 #include "unicode/unistr.h"
 #include "unicode/fmtable.h"
 
+#ifndef UPRV_LENGTHOF 
+#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) 
+#endif 
+
 // Verify that a UErrorCode is successful; exit(1) if not
 void check(UErrorCode& status, const char* msg);
 
index bb7ab7395dbe5a019b8304844d977d94ee42169b..dcd9aa0bb21fd0919159e1603cae6f08bdb5aa05 100644 (file)
 #include "unicode/uiter.h"
 #include "uit_len8.h"
 
+#ifndef UPRV_LENGTHOF
+#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
+#endif
+
 #define log_err printf
 
 /* UCharIterator test ------------------------------------------------------- */
index 418068c556aa3fced74de2f712b75ce4adfd7ad5..7194e6d4e7f90675bd5db983864f1d48fb6993ea 100644 (file)
@@ -39,7 +39,6 @@
 #include <string.h>
 #include <stdlib.h>  /* malloc */
 
-#include "cmemory.h"
 #include "unicode/utypes.h"   /* Basic ICU data types */
 #include "unicode/ucnv.h"     /* C   Converter API    */
 #include "unicode/ustring.h"  /* some more string fcns*/
@@ -50,6 +49,9 @@
 #include "flagcb.h"
 
 /* Some utility functions */
+#ifndef UPRV_LENGTHOF
+#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
+#endif
 
 static const UChar kNone[] = { 0x0000 };
 
index e9ad2997e36ae780e471f318fc4674b83a2c2d98..c05110b0a82c4a1c6bf628090c6a16e356b7f2bc 100644 (file)
@@ -64,7 +64,7 @@ sr.res : sr.txt
 # Can change this to LINK.c if it is a C only program
 # Can add more libraries here. 
 $(TARGET): $(OBJECTS)
-       $(CC) -o $@ $^ $(LDFLAGS)
+       $(CC) -o $(TARGET) $(LDFLAGS)
 
 # Make check: simply runs the sample, logged to a file
 check: $(TARGET) $(RESOURCES)
index 2fa59efb178d02540d8003c07b88b4aac020c297..af25e2090d25bc6121f321fa7a70af6df1040af2 100644 (file)
 #include "unicode/ucnv.h"
 #include "unicode/unistr.h"
 
+#ifndef UPRV_LENGTHOF
+#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
+#endif
+
 // helper functions -------------------------------------------------------- ***
 
 // default converter for the platform encoding