Re: [xml] Libxml changes for Macintosh Carbon libraries. (Patch)



On Mon, Jan 05, 2004 at 12:17:52PM -0700, Johnson, Cameron wrote:
I found that I needed libxml2 to work on the Macintosh in Carbon, not
just in OS X. The product did not work correctly without making changes
to the source code.  The problem was how file paths were treated. In a
Mac OS X only application, the file paths were POSIX and so it worked
correctly with libxml. Within a Carbon application the file paths used
the Mac file system (A colon is used as the separator).  Libxml
internally depends on a POSIX style path. My solution was to change the
path to a Mac style path just before the file path is used when calling
file IO functionality.

  Okay, I don't have objections to applying such changes, assuming that
you tested the resulting code on both Carbon and Mac OS X (I doubt that
__MACOS__ symbol may appear anywhere else !).

TRIOSTR.C:

              I made the following change at around line 57. I found
that USE_STRTOF was causing problems in Carbon. I used the __MACOS__
define to conditional it, but I'm not 100% sure that was the appropriate
one to use.

              ------------------------------------------
              #if defined(TRIO_COMPILER_SUPPORTS_C99)
              # define USE_STRTOD
              # ifndef __MACOS__
              # define USE_STRTOF
              # endif
              #elif defined(TRIO_COMPILER_MSVC)
              # define USE_STRTOD
              #endif
              ------------------------------------------

  I don't really maintain the TRIO code, it's borrowed so this would have
to go upstream too, but it's not a big deal.

XMLIO.C:

  Okay the changes looks okay, but please provide them as contextual patches
I assume you can build them on Max OS X using 
   diff -c xmlIO.c.old xmlIO.c > xmlIO.c.patch
  then send the patches for triostr.c and xmlIO.c as attachments.
It's 10 times easier for me to review and apply a contextual patch
than some out of context C code reindented and processed though mail
clients !

CONFIG.H:

              Finally, because I was using CodeWarrior, I had to
manually create a config.h file for myself. These are the extra defines
I used.

  Hum, again can you provide it as an attachment. Also there is 
already a macos subdirectory in libxml2 distribution, I assume it's
different but if the config.h must be shipped I would put it there.

We here at FileNet would like these changes to go into the next version
of Libxml if at all possible.  We have not been upgrading our libxml as
this can take up to 2 days of work due to the changes we have made. 

  Well, send them as contextual patches, they have a good probability
of going in then,

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]