ICU-9368 Fix some build issues in ICU4C 4.4 code base
X-SVN-Rev: 31912
diff --git a/source/common/ucol_swp.cpp b/source/common/ucol_swp.cpp
index ede8dd6..82dce18 100644
--- a/source/common/ucol_swp.cpp
+++ b/source/common/ucol_swp.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2003-2010, International Business Machines
+* Copyright (C) 2003-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -108,7 +108,7 @@
const void *inData, int32_t length) {
const uint8_t *inBytes;
const UCATableHeader *inHeader;
- UCATableHeader header={ 0 };
+ UCATableHeader header;
if(ds==NULL || inData==NULL || length<-1) {
return FALSE;
@@ -123,6 +123,7 @@
* sizeof(UCATableHeader)==42*4 in ICU 2.8
* check the length against the header size before reading the size field
*/
+ uprv_memset(&header, 0, sizeof(header));
if(length<0) {
header.size=udata_readInt32(ds, inHeader->size);
} else if((length<(42*4) || length<(header.size=udata_readInt32(ds, inHeader->size)))) {
@@ -155,7 +156,7 @@
const UCATableHeader *inHeader;
UCATableHeader *outHeader;
- UCATableHeader header={ 0 };
+ UCATableHeader header;
uint32_t count;
@@ -180,6 +181,7 @@
* sizeof(UCATableHeader)==42*4 in ICU 2.8
* check the length against the header size before reading the size field
*/
+ uprv_memset(&header, 0, sizeof(header));
if(length<0) {
header.size=udata_readInt32(ds, inHeader->size);
} else if((length<(42*4) || length<(header.size=udata_readInt32(ds, inHeader->size)))) {
@@ -363,7 +365,7 @@
const InverseUCATableHeader *inHeader;
InverseUCATableHeader *outHeader;
- InverseUCATableHeader header={ 0 };
+ InverseUCATableHeader header={ 0,0,0,0,0,{0,0,0,0},{0,0,0,0,0,0,0,0} };
/* udata_swapDataHeader checks the arguments */
headerSize=udata_swapDataHeader(ds, inData, length, outData, pErrorCode);
diff --git a/source/common/unicode/stringpiece.h b/source/common/unicode/stringpiece.h
index 79d5a05..010b1a1 100644
--- a/source/common/unicode/stringpiece.h
+++ b/source/common/unicode/stringpiece.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2010, International Business Machines
+// Copyright (C) 2010-2012, International Business Machines
// Corporation and others. All Rights Reserved.
//
// Copyright 2001 and onwards Google Inc.
@@ -71,7 +71,7 @@
* Constructs from a std::string.
* @stable ICU 4.2
*/
- StringPiece(const U_STD_NSQ string& str)
+ StringPiece(const std::string& str)
: ptr_(str.data()), length_(static_cast<int32_t>(str.size())) { }
#endif
/**
diff --git a/source/config/mh-aix-gcc b/source/config/mh-aix-gcc
index 40564ab..2ad81d0 100644
--- a/source/config/mh-aix-gcc
+++ b/source/config/mh-aix-gcc
@@ -1,5 +1,5 @@
## -*-makefile-*-
-## Copyright (c) 2003-2009 IBM, Ken Foskey, and others. All rights reserved.
+## Copyright (c) 2003-2012 IBM, Ken Foskey, and others. All rights reserved.
##
## Aix-specific setup (for gcc)
##
@@ -53,7 +53,7 @@
SHARED_OBJECT_NO_VERSION = $(basename $(SO_TARGET)).$(SOBJ)
# The following is for Makefile.inc's use.
-ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
+#ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
# this one is for icudefs.mk's use
ifeq ($(ENABLE_SHARED),YES)
diff --git a/source/config/mh-aix-va b/source/config/mh-aix-va
index 976649c..7d757b1 100644
--- a/source/config/mh-aix-va
+++ b/source/config/mh-aix-va
@@ -1,6 +1,6 @@
## -*-makefile-*-
## Aix-specific setup (for Visual Age 5+)
-## Copyright (c) 1999-2009, International Business Machines Corporation and
+## Copyright (c) 1999-2012, International Business Machines Corporation and
## others. All Rights Reserved.
## Commands to generate dependency files
@@ -62,7 +62,7 @@
LDLIBRARYPATH_ENVVAR = LIBPATH
# The following is for Makefile.inc's use.
-ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
+#ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
# this one is for icudefs.mk's use
ifeq ($(ENABLE_SHARED),YES)
diff --git a/source/config/mh-hpux-gcc b/source/config/mh-hpux-gcc
index 72967f1..d4897fc 100644
--- a/source/config/mh-hpux-gcc
+++ b/source/config/mh-hpux-gcc
@@ -1,6 +1,6 @@
## -*-makefile-*-
## HPUX/gcc specific setup
-## Copyright (c) 1999-2009, International Business Machines Corporation and
+## Copyright (c) 1999-2012, International Business Machines Corporation and
## others. All Rights Reserved.
## Commands to generate dependency files
@@ -16,6 +16,8 @@
## directory, at least.
LD_DEFAULTPATH= -Wl,+b,.:'$$'ORIGIN/
+GENCCODE_ASSEMBLY=-a gcc
+
# Get some handy functions defined properly
DEFS += -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L
diff --git a/source/config/pkgdataMakefile.in b/source/config/pkgdataMakefile.in
index bb97a10..5bac830 100644
--- a/source/config/pkgdataMakefile.in
+++ b/source/config/pkgdataMakefile.in
@@ -1,5 +1,5 @@
## pkgdataMakefile.in for ICU data
-## Copyright (c) 2008, International Business Machines Corporation and
+## Copyright (c) 2008-2012, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
@@ -20,7 +20,7 @@
@echo SO=$(SO) >> $(OUTPUTFILE)
@echo SOBJ=$(SOBJ) >> $(OUTPUTFILE)
@echo A=$(A) >> $(OUTPUTFILE)
- @echo LIBPREFIX=$(LIBPREFIX) >> $(OUTPUTFILE)
+ @echo LIBPREFIX=$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED) >> $(OUTPUTFILE)
@echo LIB_EXT_ORDER=$(FINAL_SO_TARGET) >> $(OUTPUTFILE)
@echo COMPILE="$(COMPILE.c)" >> $(OUTPUTFILE)
@echo LIBFLAGS="-I$(prefix)/include $(SHAREDLIBCPPFLAGS) $(SHAREDLIBCFLAGS)" >> $(OUTPUTFILE)
diff --git a/source/data/pkgdataMakefile.in b/source/data/pkgdataMakefile.in
index 5caec66..b736529 100644
--- a/source/data/pkgdataMakefile.in
+++ b/source/data/pkgdataMakefile.in
@@ -1,5 +1,5 @@
## pkgdataMakefile.in for ICU data
-## Copyright (c) 2008-2009, International Business Machines Corporation and
+## Copyright (c) 2008-2012, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
@@ -20,7 +20,7 @@
@echo SO=$(SO) >> $(OUTPUTFILE)
@echo SOBJ=$(SOBJ) >> $(OUTPUTFILE)
@echo A=$(A) >> $(OUTPUTFILE)
- @echo LIBPREFIX=$(LIBPREFIX) >> $(OUTPUTFILE)
+ @echo LIBPREFIX=$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED) >> $(OUTPUTFILE)
@echo LIB_EXT_ORDER=$(FINAL_SO_TARGET) >> $(OUTPUTFILE)
@echo COMPILE="$(COMPILE.c)" >> $(OUTPUTFILE)
@echo LIBFLAGS="-I$(top_srcdir)/common -I$(top_builddir)/common $(SHAREDLIBCPPFLAGS) $(SHAREDLIBCFLAGS)" >> $(OUTPUTFILE)
diff --git a/source/extra/uconv/Makefile.in b/source/extra/uconv/Makefile.in
index 1ad1e31..ddc40ef 100644
--- a/source/extra/uconv/Makefile.in
+++ b/source/extra/uconv/Makefile.in
@@ -1,6 +1,6 @@
## ******************************************************************************
## *
-## * Copyright (C) 1999-2009, International Business Machines
+## * Copyright (C) 1999-2012, International Business Machines
## * Corporation and others. All Rights Reserved.
## *
## *******************************************************************************
@@ -57,7 +57,7 @@
## Static mode
ifeq ($(UCONVMSG_MODE),static)
DEFS += -DUCONVMSG_LINK=$(MSGNAME)
-UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(MSGNAME).$(A)
+UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED)$(MSGNAME).$(A)
LIBS += $(UCONVMSG_LIB)
PKGMODE=static
INSTALLTO=$(libdir)
diff --git a/source/extra/uconv/pkgdataMakefile.in b/source/extra/uconv/pkgdataMakefile.in
index 61a3bcd..0ae0c56 100644
--- a/source/extra/uconv/pkgdataMakefile.in
+++ b/source/extra/uconv/pkgdataMakefile.in
@@ -1,5 +1,5 @@
## pkgdataMakefile.in for ICU data
-## Copyright (c) 2008-2009, International Business Machines Corporation and
+## Copyright (c) 2008-2012, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
@@ -21,7 +21,7 @@
@echo SO=$(SO) >> $(OUTPUTFILE)
@echo SOBJ=$(SOBJ) >> $(OUTPUTFILE)
@echo A=$(A) >> $(OUTPUTFILE)
- @echo LIBPREFIX=$(LIBPREFIX) >> $(OUTPUTFILE)
+ @echo LIBPREFIX=$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED) >> $(OUTPUTFILE)
@echo LIB_EXT_ORDER=$(FINAL_SO_TARGET) >> $(OUTPUTFILE)
@echo COMPILE="$(COMPILE.c)" >> $(OUTPUTFILE)
@echo LIBFLAGS="-I$(top_srcdir)/common -I$(top_builddir)/common $(SHAREDLIBCPPFLAGS) $(SHAREDLIBCFLAGS)" >> $(OUTPUTFILE)
diff --git a/source/test/testdata/pkgdataMakefile.in b/source/test/testdata/pkgdataMakefile.in
index 61a3bcd..0ae0c56 100644
--- a/source/test/testdata/pkgdataMakefile.in
+++ b/source/test/testdata/pkgdataMakefile.in
@@ -1,5 +1,5 @@
## pkgdataMakefile.in for ICU data
-## Copyright (c) 2008-2009, International Business Machines Corporation and
+## Copyright (c) 2008-2012, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
@@ -21,7 +21,7 @@
@echo SO=$(SO) >> $(OUTPUTFILE)
@echo SOBJ=$(SOBJ) >> $(OUTPUTFILE)
@echo A=$(A) >> $(OUTPUTFILE)
- @echo LIBPREFIX=$(LIBPREFIX) >> $(OUTPUTFILE)
+ @echo LIBPREFIX=$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED) >> $(OUTPUTFILE)
@echo LIB_EXT_ORDER=$(FINAL_SO_TARGET) >> $(OUTPUTFILE)
@echo COMPILE="$(COMPILE.c)" >> $(OUTPUTFILE)
@echo LIBFLAGS="-I$(top_srcdir)/common -I$(top_builddir)/common $(SHAREDLIBCPPFLAGS) $(SHAREDLIBCFLAGS)" >> $(OUTPUTFILE)
diff --git a/source/tools/gennorm2/gennorm2.cpp b/source/tools/gennorm2/gennorm2.cpp
index 5e717f3..390bb09 100644
--- a/source/tools/gennorm2/gennorm2.cpp
+++ b/source/tools/gennorm2/gennorm2.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2009-2010, International Business Machines
+* Copyright (C) 2009-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -150,7 +150,7 @@
}
// prepare the filename beginning with the source dir
- U_STD_NSQ string filename(options[SOURCEDIR].value);
+ std::string filename(options[SOURCEDIR].value);
int32_t pathLength=filename.length();
if( pathLength>0 &&
filename[pathLength-1]!=U_FILE_SEP_CHAR &&
diff --git a/source/tools/gennorm2/n2builder.cpp b/source/tools/gennorm2/n2builder.cpp
index daf9e1c..9a20fd4 100644
--- a/source/tools/gennorm2/n2builder.cpp
+++ b/source/tools/gennorm2/n2builder.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2009-2010, International Business Machines
+* Copyright (C) 2009-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -115,7 +115,7 @@
int32_t mappingPhase;
MappingType mappingType;
- U_STD_NSQ vector<CompositionPair> *compositions;
+ std::vector<CompositionPair> *compositions;
uint8_t cc;
UBool combinesBack;
UBool hasNoCompBoundaryAfter;
@@ -342,13 +342,13 @@
// Insert (trail, composite) pair into compositions list for the lead character.
CompositionPair pair(trail, start);
Norm *leadNorm=createNorm(lead);
- U_STD_NSQ vector<CompositionPair> *compositions=leadNorm->compositions;
+ std::vector<CompositionPair> *compositions=leadNorm->compositions;
if(compositions==NULL) {
- compositions=leadNorm->compositions=new U_STD_NSQ vector<CompositionPair>;
+ compositions=leadNorm->compositions=new std::vector<CompositionPair>;
compositions->push_back(pair);
} else {
// Insertion sort, and check for duplicate trail characters.
- U_STD_NSQ vector<CompositionPair>::iterator it;
+ std::vector<CompositionPair>::iterator it;
for(it=compositions->begin(); it!=compositions->end(); ++it) {
if(trail==it->trail) {
fprintf(stderr,
@@ -368,9 +368,9 @@
UBool Normalizer2DataBuilder::combinesWithCCBetween(const Norm &norm,
uint8_t lowCC, uint8_t highCC) const {
- const U_STD_NSQ vector<CompositionPair> *compositions=norm.compositions;
+ const std::vector<CompositionPair> *compositions=norm.compositions;
if(compositions!=NULL && (highCC-lowCC)>=2) {
- U_STD_NSQ vector<CompositionPair>::const_iterator it;
+ std::vector<CompositionPair>::const_iterator it;
for(it=compositions->begin(); it!=compositions->end(); ++it) {
uint8_t trailCC=getCC(it->trail);
if(lowCC<trailCC && trailCC<highCC) {
@@ -382,9 +382,9 @@
}
UChar32 Normalizer2DataBuilder::combine(const Norm &norm, UChar32 trail) const {
- const U_STD_NSQ vector<CompositionPair> *compositions=norm.compositions;
+ const std::vector<CompositionPair> *compositions=norm.compositions;
if(compositions!=NULL) {
- U_STD_NSQ vector<CompositionPair>::const_iterator it;
+ std::vector<CompositionPair>::const_iterator it;
for(it=compositions->begin(); it!=compositions->end(); ++it) {
if(trail==it->trail) {
return it->composite;