From 523aa629b88c2b9a95f9413113bfe737a2f4c13e Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 24 Apr 2005 23:33:13 +0000 Subject: [PATCH] Fixed a MingW/Cygwin compilation problem (STR #18) --- CHANGES | 1 + doc/intro.html | 4 ++-- doc/mxml.book | 4 ++-- doc/mxml.html | 8 ++++---- testmxml.c | 11 +++++++---- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index d767c6e..3cf5ae1 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ CHANGES IN Mini-XML 2.2.1 - Fixed an XML output bug in mxmldoc. - The "make install" target now uses the install command to set the proper permissions on UNIX/Linux/OSX. + - Fixed a MingW/Cygwin compilation problem (STR #18) CHANGES IN Mini-XML 2.2 diff --git a/doc/intro.html b/doc/intro.html index c3fc6d7..55ae3a3 100644 --- a/doc/intro.html +++ b/doc/intro.html @@ -1,6 +1,6 @@ - Mini-XML Programmers Manual, Version 2.2 + Mini-XML Programmers Manual, Version 2.2.1 @@ -9,7 +9,7 @@

Introduction

-

This programmers manual describes Mini-XML version 2.2, a +

This programmers manual describes Mini-XML version 2.2.1, a small XML parsing library that you can use to read and write XML and XML-like data files in your application without requiring large non-standard libraries. Mini-XML only requires an ANSI C diff --git a/doc/mxml.book b/doc/mxml.book index f62676a..3b5b44a 100644 --- a/doc/mxml.book +++ b/doc/mxml.book @@ -1,5 +1,5 @@ -#HTMLDOC 1.8.24mrc1 --t pdf12 -f mxml.pdf --book --toclevels 3 --no-numbered --toctitle "Table of Contents" --title --titleimage logo.png --linkstyle underline --size Universal --left 1.00in --right 0.50in --top 0.50in --bottom 0.50in --header .t. --footer h.1 --nup 1 --tocheader .t. --tocfooter ..i --duplex --portrait --grayscale --no-pscommands --no-xrxcomments --compression=9 --jpeg=50 --fontsize 11.0 --fontspacing 1.2 --headingfont Helvetica --bodyfont Times --headfootsize 11.0 --headfootfont Helvetica --charset iso-8859-1 --links --embedfonts --pagemode outline --pagelayout single --firstpage c1 --pageeffect none --pageduration 10 --effectduration 1.0 --no-encryption --permissions all --owner-password "" --user-password "" --browserwidth 680 +#HTMLDOC 1.8.25 Commercial +-t pdf12 -f mxml.pdf --book --toclevels 3 --no-numbered --toctitle "Table of Contents" --title --titleimage logo.png --linkstyle underline --size Universal --left 1.00in --right 0.50in --top 0.50in --bottom 0.50in --header .t. --header1 ... --footer h.1 --nup 1 --tocheader .t. --tocfooter ..i --duplex --portrait --grayscale --no-pscommands --no-xrxcomments --compression=9 --jpeg=50 --fontsize 11.0 --fontspacing 1.2 --headingfont Helvetica --bodyfont Times --headfootsize 11.0 --headfootfont Helvetica --charset iso-8859-1 --links --no-embedfonts --pagemode outline --pagelayout single --firstpage c1 --pageeffect none --pageduration 10 --effectduration 1.0 --no-encryption --permissions all --owner-password "" --user-password "" --browserwidth 680 --no-strict --no-overflow intro.html install.html basics.html diff --git a/doc/mxml.html b/doc/mxml.html index 23ec500..ba33594 100644 --- a/doc/mxml.html +++ b/doc/mxml.html @@ -1,7 +1,7 @@ -Mini-XML Programmers Manual, Version 2.2 +Mini-XML Programmers Manual, Version 2.2.1 @@ -19,8 +19,8 @@ PRE { font-family: monospace } --> -

Mini-XML Programmers Manual, Version 2.2
-

Mini-XML Programmers Manual, Version 2.2


+
Mini-XML Programmers Manual, Version 2.2.1
+

Mini-XML Programmers Manual, Version 2.2.1


Michael Sweet
Copyright 2003-2005
@@ -179,7 +179,7 @@ Copyright 2003-2005

Introduction

-

This programmers manual describes Mini-XML version 2.2, a small XML +

This programmers manual describes Mini-XML version 2.2.1, a small XML parsing library that you can use to read and write XML and XML-like data files in your application without requiring large non-standard libraries. Mini-XML only requires an ANSI C compatible compiler (GCC diff --git a/testmxml.c b/testmxml.c index d93617c..9e3f6f5 100644 --- a/testmxml.c +++ b/testmxml.c @@ -33,8 +33,11 @@ # include #else # include -# include #endif /* WIN32 */ +#include +#ifndef O_BINARY +# define O_BINARY 0 +#endif /* !O_BINARY */ /* @@ -403,7 +406,7 @@ main(int argc, /* I - Number of command-line args */ if (argv[1][0] == '<') tree = mxmlLoadString(NULL, argv[1], type_cb); - else if ((fp = fopen(argv[1], "r")) == NULL) + else if ((fp = fopen(argv[1], "rb")) == NULL) { perror(argv[1]); return (1); @@ -478,7 +481,7 @@ main(int argc, /* I - Number of command-line args */ * Open the file again... */ - if ((fd = open(argv[1], O_RDONLY)) < 0) + if ((fd = open(argv[1], O_RDONLY | O_BINARY)) < 0) { perror(argv[1]); return (1); @@ -498,7 +501,7 @@ main(int argc, /* I - Number of command-line args */ snprintf(buffer, sizeof(buffer), "%sfd", argv[1]); - if ((fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) + if ((fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666)) < 0) { perror(buffer); mxmlDelete(tree);