ICU-12141 make each internal header file compile by itself; add includes where necessary; add simple test script

X-SVN-Rev: 38341
This commit is contained in:
Markus Scherer 2016-02-24 00:49:51 +00:00
parent 7f4b8d106b
commit f2186b6d33
29 changed files with 113 additions and 49 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 1999-2015, International Business Machines
* Copyright (C) 1999-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
* file name: norm2_nfc_data.h
@ -7,6 +7,8 @@
* machine-generated by: icu/source/tools/gennorm2/n2builder.cpp
*/
#ifdef INCLUDED_FROM_NORMALIZER2_CPP
static const UVersionInfo norm2_nfc_data_formatVersion={2,0,0,0};
static const UVersionInfo norm2_nfc_data_dataVersion={8,0,0,0};
@ -1124,3 +1126,5 @@ static const UTrie2 norm2_nfc_data_trie={
0x24b4,
NULL, 0, FALSE, FALSE, 0, NULL
};
#endif // INCLUDED_FROM_NORMALIZER2_CPP

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2009-2014, International Business Machines
* Copyright (C) 2009-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -31,6 +31,7 @@
using icu::Normalizer2Impl;
// NFC/NFD data machine-generated by gennorm2 --csource
#define INCLUDED_FROM_NORMALIZER2_CPP
#include "norm2_nfc_data.h"
U_NAMESPACE_BEGIN

View File

@ -7,9 +7,7 @@
* machine-generated by: icu/tools/unicode/c/genprops/pnamesbuilder.cpp
*/
#ifndef INCLUDED_FROM_PROPNAME_CPP
# error This file must be #included from propname.cpp only.
#endif
#ifdef INCLUDED_FROM_PROPNAME_CPP
U_NAMESPACE_BEGIN
@ -1607,3 +1605,5 @@ const char PropNameData::nameGroups[17897]={
};
U_NAMESPACE_END
#endif // INCLUDED_FROM_PROPNAME_CPP

View File

@ -1,6 +1,6 @@
#**************************************************************************
# Copyright (C) 2002-2005 International Business Machines Corporation *
# and others. All rights reserved. *
# Copyright (C) 2002-2016 International Business Machines Corporation
# and others. All rights reserved.
#**************************************************************************
#
# rbbicst Compile the RBBI rule paser state table data into initialized C data.
@ -348,6 +348,8 @@ else
print "#ifndef RBBIRPT_H\n";
print "#define RBBIRPT_H\n";
print "\n";
print "#include \"unicode/utypes.h\"\n";
print "\n";
print "U_NAMESPACE_BEGIN\n";
#

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 2001-2006, International Business Machines Corporation and
* Copyright (c) 2001-2016, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -8,6 +8,7 @@
#define RBBINODE_H
#include "unicode/utypes.h"
#include "unicode/unistr.h"
#include "unicode/uobject.h"
//

View File

@ -6,13 +6,15 @@
// It is generated by the Perl script "rbbicst.pl" from
// the rule parser state definitions file "rbbirpt.txt".
//
// Copyright (C) 2002-2005 International Business Machines Corporation
// Copyright (C) 2002-2016 International Business Machines Corporation
// and others. All rights reserved.
//
//---------------------------------------------------------------------------------
#ifndef RBBIRPT_H
#define RBBIRPT_H
#include "unicode/utypes.h"
U_NAMESPACE_BEGIN
//
// Character classes for RBBI rule scanning.

View File

@ -1,7 +1,7 @@
//
// rbbiscan.h
//
// Copyright (C) 2002-2008, International Business Machines Corporation and others.
// Copyright (C) 2002-2016, International Business Machines Corporation and others.
// All Rights Reserved.
//
// This file contains declarations for class RBBIRuleScanner
@ -21,9 +21,7 @@
#include "unicode/symtable.h"// For UnicodeSet parsing, is the interface that
// looks up references to $variables within a set.
#include "rbbinode.h"
//#include "rbbitblb.h"
#include "rbbirpt.h"
U_NAMESPACE_BEGIN

View File

@ -7,9 +7,7 @@
* machine-generated by: icu/tools/unicode/c/genprops/bidipropsbuilder.cpp
*/
#ifndef INCLUDED_FROM_UBIDI_PROPS_C
# error This file must be #included from ubidi_props.c only.
#endif
#ifdef INCLUDED_FROM_UBIDI_PROPS_C
static const UVersionInfo ubidi_props_dataVersion={8,0,0,0};
@ -796,3 +794,5 @@ static const UBiDiProps ubidi_props_singleton={
},
{ 2,2,0,0 }
};
#endif // INCLUDED_FROM_UBIDI_PROPS_C

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1999-2015, International Business Machines
* Copyright (C) 1999-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -18,6 +18,7 @@
#define UBIDIIMP_H
#include "unicode/utypes.h"
#include "unicode/ubidi.h"
#include "unicode/uchar.h"
#include "ubidi_props.h"

View File

@ -7,9 +7,7 @@
* machine-generated by: icu/tools/unicode/c/genprops/casepropsbuilder.cpp
*/
#ifndef INCLUDED_FROM_UCASE_CPP
# error This file must be #included from ucase.cpp only.
#endif
#ifdef INCLUDED_FROM_UCASE_CPP
static const UVersionInfo ucase_props_dataVersion={8,0,0,0};
@ -876,3 +874,5 @@ static const UCaseProps ucase_props_singleton={
},
{ 3,0,0,0 }
};
#endif // INCLUDED_FROM_UCASE_CPP

View File

@ -7,9 +7,7 @@
* machine-generated by: icu/tools/unicode/c/genprops/corepropsbuilder.cpp
*/
#ifndef INCLUDED_FROM_UCHAR_C
# error This file must be #included from uchar.c only.
#endif
#ifdef INCLUDED_FROM_UCHAR_C
static const UVersionInfo dataVersion={8,0,0,0};
@ -3394,3 +3392,4 @@ static const uint16_t scriptExtensions[172]={
static const int32_t indexes[UPROPS_INDEX_COUNT]={0x26ca,0x26ca,0x26ca,0x26ca,0x5c6c,3,0x7397,0x73ed,0x73ed,0x73ed,0xb06a6,0x2774191,0,0,0,0};
#endif // INCLUDED_FROM_UCHAR_C

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2013-2015, International Business Machines
* Copyright (C) 2013-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* collationfastlatinbuilder.h
@ -16,6 +16,7 @@
#if !UCONFIG_NO_COLLATION
#include "unicode/ucol.h"
#include "unicode/unistr.h"
#include "unicode/uobject.h"
#include "collation.h"

View File

@ -1,5 +1,6 @@
// collunsafe.h
// Copyright (C) 2015, International Business Machines Corporation and others. All Rights Reserved.
// Copyright (C) 2015-2016, International Business Machines Corporation and others.
// All Rights Reserved.
// To be included by collationdatareader.cpp, and generated by gencolusb.
// Machine generated, do not edit.
@ -7,6 +8,8 @@
#ifndef COLLUNSAFE_H
#define COLLUNSAFE_H
#include "unicode/utypes.h"
#define COLLUNSAFE_ICU_VERSION "56.0.1"
#define COLLUNSAFE_COLL_VERSION "9.64"
#define COLLUNSAFE_SERIALIZE 1

View File

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (C) 2005-2013, International Business Machines
* Copyright (C) 2005-2016, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*/
@ -12,6 +12,8 @@
#if !UCONFIG_NO_CONVERSION
#include "unicode/uenum.h"
U_NAMESPACE_BEGIN
class InputText;

View File

@ -1,7 +1,7 @@
/* ------------------------------------------------------------------ */
/* decNumber package local type, tuning, and macro definitions */
/* ------------------------------------------------------------------ */
/* Copyright (c) IBM Corporation, 2000-2012. All rights reserved. */
/* Copyright (c) IBM Corporation, 2000-2016. All rights reserved. */
/* */
/* This software is made available under the terms of the */
/* ICU License -- ICU 1.8.1 and later. */
@ -29,6 +29,7 @@
#include <stdlib.h> /* for abs */
#include <string.h> /* for memset, strcpy */
#include "decContext.h"
/* Conditional code flag -- set this to match hardware platform */
#if !defined(DECLITEND)

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
* Copyright (C) 2009-2013, International Business Machines Corporation and *
* others. All Rights Reserved. *
* Copyright (C) 2009-2016, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*
* This file contains declarations for the class DecimalFormatStaticSets
@ -16,7 +16,9 @@
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#if !UCONFIG_NO_FORMATTING
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
* Copyright (C) 2007-2015, International Business Machines Corporation and
* others. All Rights Reserved. *
* Copyright (C) 2007-2016, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*
* File DTPTNGEN.H
@ -9,11 +9,12 @@
*******************************************************************************
*/
#include "uvector.h"
#ifndef __DTPTNGEN_IMPL_H__
#define __DTPTNGEN_IMPL_H__
#include "unicode/udatpg.h"
#include "uvector.h"
// TODO(claireho): Split off Builder class.
// TODO(claireho): If splitting off Builder class: As subclass or independent?

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2007-2015, International Business Machines Corporation and
* Copyright (C) 2007-2016, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*
@ -33,6 +33,7 @@ U_NAMESPACE_BEGIN
class AndConstraint;
class RuleChain;
class DigitInterval;
class PluralRules;
class VisibleDigits;
static const UChar DOT = ((UChar)0x002E);

View File

@ -1,7 +1,7 @@
//
// regexcmp.h
//
// Copyright (C) 2002-2015, International Business Machines Corporation and others.
// Copyright (C) 2002-2016, International Business Machines Corporation and others.
// All Rights Reserved.
//
// This file contains declarations for the class RegexCompile
@ -17,9 +17,10 @@
#include "unicode/utypes.h"
#if !UCONFIG_NO_REGULAR_EXPRESSIONS
#include "unicode/uobject.h"
#include "unicode/uniset.h"
#include "unicode/parseerr.h"
#include "unicode/uniset.h"
#include "unicode/uobject.h"
#include "unicode/utext.h"
#include "uhash.h"
#include "uvector.h"
#include "uvectr32.h"

View File

@ -5,13 +5,15 @@
// It is generated by the Perl script "regexcst.pl" from
// the rule parser state definitions file "regexcst.txt".
//
// Copyright (C) 2002-2015 International Business Machines Corporation
// Copyright (C) 2002-2016 International Business Machines Corporation
// and others. All rights reserved.
//
//---------------------------------------------------------------------------------
#ifndef RBBIRPT_H
#define RBBIRPT_H
#include "unicode/utypes.h"
U_NAMESPACE_BEGIN
//
// Character classes for regex pattern scanning.

View File

@ -1,7 +1,7 @@
#!/usr/bin/perl
# ********************************************************************
# * COPYRIGHT:
# * Copyright (c) 2002-2015, International Business Machines Corporation and
# * Copyright (c) 2002-2016, International Business Machines Corporation and
# * others. All Rights Reserved.
# ********************************************************************
#
@ -206,13 +206,15 @@ print "// This file contains the state table for the ICU Regular Expression P
print "// It is generated by the Perl script \"regexcst.pl\" from\n";
print "// the rule parser state definitions file \"regexcst.txt\".\n";
print "//\n";
print "// Copyright (C) 2002-2015 International Business Machines Corporation \n";
print "// Copyright (C) 2002-2016 International Business Machines Corporation \n";
print "// and others. All rights reserved. \n";
print "//\n";
print "//---------------------------------------------------------------------------------\n";
print "#ifndef RBBIRPT_H\n";
print "#define RBBIRPT_H\n";
print "\n";
print "#include \"unicode/utypes.h\"\n";
print "\n";
print "U_NAMESPACE_BEGIN\n";
#

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2012-2014, International Business Machines
* Copyright (C) 2012-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* uitercollationiterator.h
@ -20,6 +20,7 @@
#include "cmemory.h"
#include "collation.h"
#include "collationdata.h"
#include "collationiterator.h"
#include "normalizer2impl.h"
U_NAMESPACE_BEGIN

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 2008-2011, International Business Machines
* Copyright (C) 2008-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -23,6 +23,8 @@
#if !UCONFIG_NO_REGULAR_EXPRESSIONS
#include "unicode/uregex.h"
#include "uhash.h"
#include "uspoof_impl.h"
U_NAMESPACE_BEGIN

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2012-2014, International Business Machines
* Copyright (C) 2012-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* utf8collationiterator.h
@ -19,6 +19,7 @@
#include "cmemory.h"
#include "collation.h"
#include "collationdata.h"
#include "collationiterator.h"
#include "normalizer2impl.h"
U_NAMESPACE_BEGIN

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2009-2011, International Business Machines Corporation and
* Copyright (C) 2009-2016, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
@ -19,6 +19,7 @@
#if !UCONFIG_NO_FORMATTING
#include "unicode/uobject.h"
#include "ztrans.h"
#ifndef UCNV_H

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
* Copyright (C) 2009-2011, International Business Machines Corporation and *
* others. All Rights Reserved. *
* Copyright (C) 2009-2016, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
#ifndef __ZRULE_H
@ -16,6 +16,8 @@
#if !UCONFIG_NO_FORMATTING
#include "unicode/uobject.h"
#ifndef UCNV_H
/**

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2009-2011, International Business Machines Corporation and
* Copyright (C) 2009-2016, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
@ -16,6 +16,8 @@
#if !UCONFIG_NO_FORMATTING
#include "unicode/uobject.h"
#ifndef UCNV_H
/**

View File

@ -0,0 +1,29 @@
# Copyright (C) 2016 International Business Machines Corporation
# and others. All rights reserved.
#
# Run this script from $ICU_ROOT/src/source/
CXX=clang++
for file in `ls common/*.h`; do
echo $file
echo '#include "'$file'"' > ht_temp.cpp ;
echo 'void noop() {}' >> ht_temp.cpp ;
$CXX -c -I common -O0 ht_temp.cpp ;
done ;
for file in `ls i18n/*.h`; do
echo $file
echo '#include "'$file'"' > ht_temp.cpp ;
echo 'void noop() {}' >> ht_temp.cpp ;
$CXX -c -I common -I i18n -O0 ht_temp.cpp ;
done ;
for file in `ls io/*.h`; do
echo $file
echo '#include "'$file'"' > ht_temp.cpp ;
echo 'void noop() {}' >> ht_temp.cpp ;
$CXX -c -I common -I i18n -I io -O0 ht_temp.cpp ;
done ;
rm ht_temp.cpp ht_temp.o

View File

@ -1,5 +1,5 @@
/**
* Copyright (c) 1999-2015, International Business Machines Corporation and
* Copyright (c) 1999-2016, International Business Machines Corporation and
* others. All Rights Reserved.
*
* Generator for source/i18n/collunsafe.h
@ -106,6 +106,8 @@ int main(int argc, const char *argv[]) {
printf("#ifndef COLLUNSAFE_H\n"
"#define COLLUNSAFE_H\n"
"\n"
"#include \"unicode/utypes.h\"\n"
"\n"
"#define COLLUNSAFE_ICU_VERSION \"" U_ICU_VERSION "\"\n");
printf("#define COLLUNSAFE_COLL_VERSION \"%s\"\n", verString);