libtool-patches
[Top][All Lists]
Advanced

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

Re: [3/11] Native MSVC support (msvc-cwrapper)


From: Charles Wilson
Subject: Re: [3/11] Native MSVC support (msvc-cwrapper)
Date: Thu, 12 Jul 2007 02:19:43 -0400
User-agent: Thunderbird 1.5.0.12 (Windows/20070509)

Peter Rosin wrote:
Make the cwrapper build using MSVC and older MinGW.

        * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src): Add
        support for Microsoft Visual C. Also, older MinGW versions
        seem to need stdint.h to find intptr_t.

This also looks OK to me (and tested on cygwin and linux) -- but again, I don't know what the maintainers' policy is at the moment, for a large new feature like MSVC support.

I don't really like this:

+#ifdef _MSC_VER

that is, "platform" #ifdefs rather than "feature" #ifdefs. However, it's really not that different from the existing idiom, which does the "#ifdef" in shell code:

    case $host_os in
        mingw*) cat <<"EOF"
<mingw specific code>
EOF
           ;;
        *) cat <<"EOF"
<generic code>
EOF
           ;;
     esac

Furthermore,

(1) the cwrapper does not #include config.h (or whatever the enclosing project has decided to call its autoconf-generated configuration header), and even if it did,

(2) it's rather silly to have configure do a lot of checks, on every platform, that probably aren't necessary for the enclosing project just to satisfy the cwrapper's needs on a specific platform.

(3) we already make a lot of assumptions in the cwrapper code because we know it's only used for cygwin and mingw hosts (or rather, only used for an underlying mswin host). If we were to go all puritanically "feature #ifdef only" we need to revisit (1) above, AND make a LOT of new tests...errno.h, sys/stat.h, some syscalls...

(4) AND, who am I kidding: we already do this:

#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  defined (__OS2__)
blah blah blah
#endif

which is pretty dadgummed "platform" based as it is.

If it sounds like I'm taking myself into "platform" #ifdefs for the cwrapper...you're right. Looks OK.

--
Chuck




reply via email to

[Prev in Thread] Current Thread [Next in Thread]