Hi Peter,

Sorry for writing a reply to the previous post before checking for
non-subscriber replys in need of moderation. It would appear on-list
that your reply was a repeat of mine while the truth was actually the
opposite.

On 5/10/06, Peter Moulder <[EMAIL PROTECTED]> wrote:
Try adding `#include <stdint.h>' (or inttypes.h) to common.c.  My
reading of
http://www.opengroup.org/onlinepubs/000095399/basedefs/stdint.h.html
is that WCHAR_MAX should be defined in stdint.h; so if adding this
#include line isn't enough to fix the problem, then I think you can file
a bug report against OpenBSD's stdint.h file.

This is interesting. From WG14 N1124, the latest publicly available
C99 standard document (available at
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf):

"The header <wchar.h> declares four data types, one tag, four macros,
and many functions. ...  The macros defined are NULL (described in
7.17); WCHAR_MIN and WCHAR_MAX (described in 7.18.3); and WEOF"

I think this is unchanged from C90, amendment 1, though I could not
find that one online to make sure.

As near as I can tell, this makes it clear that in ISO C, WCHAR_MAX
should be defined in wchar.h, which _is_ included by the code, so
WCHAR_MAX really should be defined already.

That said, if indeed some other standard define WCHAR_MAX in stdint.h,
and some OS:es follow that standard in preference to ISO C, I see no
problem with including both. I'll add it at once.


As a workaround if stdint.h isn't enough, you can try

  find /usr/include -name '*.h' -type f -print | xargs grep WCHAR_MAX

to see if it's defined somewhere else.

If all else fails, add the following to common.c, after all the #include
lines:

  #ifndef WCHAR_MAX
  # define WCHAR_MAX 0x7fffffff
  #endif

Note that max_val is of type int.  The above assumes that wchar_t and
int are both at least 32 bits.

That's kind of hard to work around, since WCHAR_MAX needs to be known
at runtime, so you can't use any clever sizeof-based tests. In other
words, one would have to use an Autoconf test. But I'm lazy, so I'll
settle for assuming 32-bit:ness, since this is just a bug-workaround.


I suggest you write back to let the fish maintainers know the solution,
so that it can be incorporated into subsequent versions of fish (so that
you and others don't need to make the same change each time).

pjrm.  (Not subscribed to fish-users.)


--
Axel


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to