Fix VC++ compile failures

pull/193/head
Michael R Sweet 16 years ago
parent 1646671128
commit 9643c13183
  1. 8
      mxml-file.c
  2. 17
      mxmldoc.c
  3. 6
      testmxml.c

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

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

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

Loading…
Cancel
Save