Fix VC++ compile failures

This commit is contained in:
Michael R Sweet 2009-02-05 06:06:11 +00:00
parent 1646671128
commit 9643c13183
3 changed files with 18 additions and 13 deletions

View File

@ -55,12 +55,10 @@
* Include necessary headers...
*/
#include "mxml-private.h"
#ifdef WIN32
# include <io.h>
#else
#ifndef WIN32
# include <unistd.h>
#endif /* WIN32 */
#endif /* !WIN32 */
#include "mxml-private.h"
/*

View File

@ -3183,6 +3183,7 @@ write_html(const char *section, /* I - Section */
* output directory...
*/
#ifdef __APPLE__
const char *id; /* Identifier */
@ -3347,6 +3348,12 @@ write_html(const char *section, /* I - Section */
strerror(errno));
return;
}
#else
fputs("mxmldoc: Xcode documentation sets can only be created on "
"Mac OS X.\n", stderr);
return;
#endif /* __APPLE__ */
}
else
out = stdout;
@ -3672,6 +3679,7 @@ write_html(const char *section, /* I - Section */
if (out != stdout)
fclose(out);
#ifdef __APPLE__
/*
* When generating document sets, run the docsetutil program to index it...
*/
@ -3722,6 +3730,7 @@ write_html(const char *section, /* I - Section */
}
}
}
#endif /* __APPLE__ */
}
@ -4750,7 +4759,7 @@ write_toc(FILE *out, /* I - Output file */
end = line + strlen(line);
if (end == (line + sizeof(line) - 1) ||
!fgets(end, sizeof(line) - (end - line), fp))
!fgets(end, (int)(sizeof(line) - (end - line)), fp))
break;
}
@ -4767,7 +4776,7 @@ write_toc(FILE *out, /* I - Output file */
*/
for (ptr = strchr(line, '<'); ptr; ptr = strchr(ptr + 1, '<'))
if (!strncasecmp(ptr, "<A NAME=", 8))
if (!strncmp(ptr, "<A NAME=", 8) || !strncmp(ptr, "<a name=", 8))
break;
if (!ptr)
@ -4849,7 +4858,7 @@ write_toc(FILE *out, /* I - Output file */
}
else if (*ptr == '<')
{
if (!strncasecmp(ptr, "</A>", 4))
if (!strncmp(ptr, "</A>", 4) || !strncmp(ptr, "</a>", 4))
break;
inelement = 1;
@ -4893,7 +4902,7 @@ write_toc(FILE *out, /* I - Output file */
}
else if (*ptr == '<')
{
if (!strncasecmp(ptr, "</A>", 4))
if (!strncmp(ptr, "</A>", 4) || !strncmp(ptr, "</a>", 4))
break;
inelement = 1;

View File

@ -30,11 +30,9 @@
#include "config.h"
#include "mxml.h"
#ifdef WIN32
# include <io.h>
#else
#ifndef WIN32
# include <unistd.h>
#endif /* WIN32 */
#endif /* !WIN32 */
#include <fcntl.h>
#ifndef O_BINARY
# define O_BINARY 0