Skip to content

Commit 08c1263

Browse files
Merge pull request htacg#57 from johnweldon/master
Better MSVC 2010 fix for CleanGoogleDocument unresolved externals.
2 parents 79439b0 + 46e8e9d commit 08c1263

File tree

3 files changed

+37
-23
lines changed

3 files changed

+37
-23
lines changed

build/msvc2010/tidydll.vcxproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@
273273
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
274274
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
275275
</ClCompile>
276+
<ClCompile Include="..\..\src\gdoc.c">
277+
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
278+
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
279+
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
280+
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
281+
</ClCompile>
276282
</ItemGroup>
277283
<ItemGroup>
278284
<None Include="tidy.def" />
@@ -302,8 +308,9 @@
302308
<ClInclude Include="..\..\src\utf8.h" />
303309
<ClInclude Include="..\..\src\version.h" />
304310
<ClInclude Include="..\..\src\win32tc.h" />
311+
<ClInclude Include="..\..\src\gdoc.h" />
305312
</ItemGroup>
306313
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
307314
<ImportGroup Label="ExtensionTargets">
308315
</ImportGroup>
309-
</Project>
316+
</Project>

build/msvc2010/tidylib.vcxproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@
270270
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
271271
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
272272
</ClCompile>
273+
<ClCompile Include="..\..\src\gdoc.c">
274+
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
275+
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
276+
<UndefinePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(UndefinePreprocessorDefinitions)</UndefinePreprocessorDefinitions>
277+
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
278+
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
279+
</ClCompile>
273280
</ItemGroup>
274281
<ItemGroup>
275282
<ClInclude Include="..\..\src\access.h" />
@@ -296,8 +303,9 @@
296303
<ClInclude Include="..\..\src\utf8.h" />
297304
<ClInclude Include="..\..\src\version.h" />
298305
<ClInclude Include="..\..\src\win32tc.h" />
306+
<ClInclude Include="..\..\src\gdoc.h" />
299307
</ItemGroup>
300308
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
301309
<ImportGroup Label="ExtensionTargets">
302310
</ImportGroup>
303-
</Project>
311+
</Project>

src/tidylib.c

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
66
CVS Info :
77
8-
$Author: arnaud02 $
9-
$Date: 2008/06/18 20:18:54 $
10-
$Revision: 1.75 $
8+
$Author: arnaud02 $
9+
$Date: 2008/06/18 20:18:54 $
10+
$Revision: 1.75 $
1111
1212
Defines HTML Tidy API implemented by tidy library.
13-
13+
1414
Very rough initial cut for discussion purposes.
1515
1616
Public interface is const-correct and doesn't explicitly depend
1717
on any globals. Thus, thread-safety may be introduced w/out
1818
changing the interface.
1919
20-
Looking ahead to a C++ wrapper, C functions always pass
20+
Looking ahead to a C++ wrapper, C functions always pass
2121
this-equivalent as 1st arg.
2222
2323
Created 2001-05-20 by Charles Reitzel
@@ -118,7 +118,7 @@ TidyOption tidyImplToOption( const TidyOptionImpl* option )
118118
** 0 -> SUCCESS
119119
** >0 -> WARNING
120120
** <0 -> ERROR
121-
**
121+
**
122122
*/
123123

124124
TidyDoc TIDY_CALL tidyCreate(void)
@@ -629,8 +629,8 @@ Bool TIDY_CALL tidyOptCopyConfig( TidyDoc to, TidyDoc from )
629629

630630
/* I/O and Message handling interface
631631
**
632-
** By default, Tidy will define, create and use
633-
** tdocances of input and output handlers for
632+
** By default, Tidy will define, create and use
633+
** tdocances of input and output handlers for
634634
** standard C buffered I/O (i.e. FILE* stdin,
635635
** FILE* stdout and FILE* stderr for content
636636
** input, content output and diagnostic output,
@@ -640,7 +640,7 @@ Bool TIDY_CALL tidyOptCopyConfig( TidyDoc to, TidyDoc from )
640640
*/
641641

642642
/* Use TidyReportFilter to filter messages by diagnostic level:
643-
** info, warning, etc. Just set diagnostic output
643+
** info, warning, etc. Just set diagnostic output
644644
** handler to redirect all diagnostics output. Return true
645645
** to proceed with output, false to cancel.
646646
*/
@@ -799,7 +799,7 @@ uint TIDY_CALL tidyConfigErrorCount( TidyDoc tdoc )
799799
}
800800

801801

802-
/* Error reporting functions
802+
/* Error reporting functions
803803
*/
804804
void TIDY_CALL tidyErrorSummary( TidyDoc tdoc )
805805
{
@@ -975,7 +975,7 @@ int tidyDocSaveFile( TidyDocImpl* doc, ctmbstr filnam )
975975
if ( doc->errors > 0 &&
976976
cfgBool(doc, TidyWriteBack) && !cfgBool(doc, TidyForceOutput) )
977977
status = tidyDocStatus( doc );
978-
else
978+
else
979979
fout = fopen( filnam, "wb" );
980980

981981
if ( fout )
@@ -1009,7 +1009,7 @@ int tidyDocSaveFile( TidyDocImpl* doc, ctmbstr filnam )
10091009
** The code has been left in in case it works w/ other compilers
10101010
** or operating systems. If stdout is in Text mode, be aware that
10111011
** it will garble UTF16 documents. In text mode, when it encounters
1012-
** a single byte of value 10 (0xA), it will insert a single byte
1012+
** a single byte of value 10 (0xA), it will insert a single byte
10131013
** value 13 (0xD) just before it. This has the effect of garbling
10141014
** the entire document.
10151015
*/
@@ -1074,7 +1074,7 @@ int tidyDocSaveString( TidyDocImpl* doc, tmbstr buffer, uint* buflen )
10741074
TidyBuffer outbuf;
10751075
StreamOut* out;
10761076
int status;
1077-
1077+
10781078
tidyBufInitWithAllocator( &outbuf, doc->allocator );
10791079
out = TY_(BufferOutput)( doc, &outbuf, outenc, nl );
10801080
status = tidyDocSaveStream( doc, out );
@@ -1098,7 +1098,7 @@ int tidyDocSaveBuffer( TidyDocImpl* doc, TidyBuffer* outbuf )
10981098
uint outenc = cfg( doc, TidyOutCharEncoding );
10991099
uint nl = cfg( doc, TidyNewline );
11001100
StreamOut* out = TY_(BufferOutput)( doc, outbuf, outenc, nl );
1101-
1101+
11021102
status = tidyDocSaveStream( doc, out );
11031103
TidyDocFree( doc, out );
11041104
}
@@ -1145,7 +1145,7 @@ int TIDY_CALL tidyRunDiagnostics( TidyDoc tdoc )
11451145

11461146
/* Workhorse functions.
11471147
**
1148-
** Parse requires input source, all input config items
1148+
** Parse requires input source, all input config items
11491149
** and diagnostic sink to have all been set before calling.
11501150
**
11511151
** Emit likewise requires that document sink and all
@@ -1227,7 +1227,7 @@ int tidyDocRunDiagnostics( TidyDocImpl* doc )
12271227
TY_(ReportMarkupVersion)( doc );
12281228
TY_(ReportNumWarnings)( doc );
12291229
}
1230-
1230+
12311231
if ( doc->errors > 0 && !force )
12321232
TY_(NeedsAuthorIntervention)( doc );
12331233

@@ -1281,7 +1281,7 @@ int tidyDocCleanAndRepair( TidyDocImpl* doc )
12811281
TY_(CleanDocument)( doc );
12821282

12831283
/* clean up html exported by Google Focs */
1284-
#if 0
1284+
#if 1
12851285
if ( gdoc )
12861286
TY_(CleanGoogleDocument)( doc );
12871287
#endif
@@ -1404,7 +1404,6 @@ int tidyDocSaveStream( TidyDocImpl* doc, StreamOut* out )
14041404
{
14051405
/* noop */
14061406
TY_(DropFontElements)(doc, &doc->root, NULL);
1407-
TY_(WbrToSpace)(doc, &doc->root);
14081407
}
14091408

14101409
if ((makeClean && asciiChars) || makeBare)
@@ -1455,8 +1454,8 @@ int tidyDocSaveStream( TidyDocImpl* doc, StreamOut* out )
14551454
**
14561455
** The big issue here is the degree to which we should mimic
14571456
** a DOM and/or SAX nodes.
1458-
**
1459-
** Is it 100% possible (and, if so, how difficult is it) to
1457+
**
1458+
** Is it 100% possible (and, if so, how difficult is it) to
14601459
** emit SAX events from this API? If SAX events are possible,
14611460
** is that 100% of data needed to build a DOM?
14621461
*/
@@ -1587,7 +1586,7 @@ Bool TIDY_CALL tidyNodeGetText( TidyDoc tdoc, TidyNode tnod, TidyBuffer* outbuf
15871586

15881587
TY_(PFlushLine)( doc, 0 );
15891588
doc->docOut = NULL;
1590-
1589+
15911590
TidyDocFree( doc, out );
15921591
return yes;
15931592
}

0 commit comments

Comments
 (0)