[Top][All Lists]

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

Re: Windows Build Broken: /ccvs/lib/ getopt.h, getopt_.h, getopt_int.h

From: Derek Robert Price
Subject: Re: Windows Build Broken: /ccvs/lib/ getopt.h, getopt_.h, getopt_int.h
Date: Sat, 09 Oct 2004 16:59:00 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

Hash: SHA1

Conrad T. Pino wrote:

>>I tried to define what I thought I could guess at accurately, but
>>there are a few definitions missing on Windows now that probably
>>aren't vital but could speed things up:
>>$ ./mkconfig -q ../config.h.in ./config.h.in ./config.h.in.in
>>../config.h.in line 468 has #undef HAVE_STDIO_EXT_H not found in
>>../config.h.in line 474 has #undef HAVE_STRCASECMP not found in
>>./config.h.in.in../config.h.in line 495 has #undef HAVE_STRNCASECMP
>>not found in ./config.h.in.in
>>../config.h.in line 629 has #undef HAVE_WMEMCHR not found in
>>../config.h.in line 632 has #undef HAVE_WMEMCPY not found in
>>../config.h.in line 992 has #undef optarg not found in ./config.h.in.in
>>../config.h.in line 995 has #undef optind not found in ./config.h.in.in
>>../config.h.in line 998 has #undef optopt not found in ./config.h.in.in
>>I'm guessing HAVE_STDIO_EXT_H won't exist and needs to be defined to
>>0, but I didn't really know.  HAVE_STRCASECMP and the other HAVE_s, I
>>have no idea about.  I have no idea about optarg, optind, and optopt
>>either.  Those need to be defined to rpl_optarg, rpl_optind, and
>>rpl_optopt, respectively, if they don't exist on Windows.  These
>>globals are normally exported as part of the getopt() function.  I
>>gathered that Windows wouldn't have a GNU compatible getopt(), but
>>didn't know if it had some form of getopt() which did export these
>The Windows Build completes without any of the above.  I don't claim to
>know or imply that means anything about the function of the executable.

Well, it would complete - these are issues the GNULIB modules are
designed to work around, but at least in theory, it is better to get
them right to track API changes and the like.

>I really can't claim authorative knowledge about Windows having a GNU
>compatible "getopt" function.  I coded a test program with a "getopt"
>call with no arguments and the linker was unable to resolve it.

It almost certainly isn't.  GNU has a lot of extensions.  Most UNIX
getopts are not GNU compatible.  That's why I guessed and just defined
this one.

>The patch at the end of this message quit the "mkconfig.pl" warnings
>without acutally doing anything.  It's a crude starting point and I'd
>like to know if you think it's worthwhile committing.

Well, it's probably worth shutting up the warnings, but it would be
better to get the defines right for efficiency and possibly for later
extensions, such as UNICODE support.

Upon further inspection, I discovered that the GNULIB getopt function
seems designed to always use the rpl_optopt, rpl_optarg, and
rpl_optind versions of the globals if the GNULIB getopt is used at
all, so I've committed definitions for those.

>I'm open to other suggestions regarding lines of investigation leading
>towards a better resolution.

That just leaves the one header macro, HAVE_STDIO_EXT_H looking for
stdio_ext.h, which I am guessing Windows does not have, and the four
HAVE_WMEMCPY, looking for strcasecmp(), strncasecmp(), wmemchr(), and
wmemcpy(), respectively.

A quick web search on MSDN brings up entries for wmemchr() and
wmemcpy(), but none of the others.  Glancing at some of the older
defines we haven't bothered with, defining HAVE_WMEMCHR & HAVE_WMEMCPY
would probably require defining at least HAVE_WCHAR_H & HAVE_WCHAR_T
too, so maybe it's not worth the trouble of investigating and testing
just now.  If you don't have the time or inclination, go ahead and
commit undefs on all of them since it works now.



- --

Email: derek@ximbiot.com

Get CVS support at <http://ximbiot.com>!
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

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