[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
isascii/toascii with MSVC
From: |
Michael Goffioul |
Subject: |
isascii/toascii with MSVC |
Date: |
Sun, 24 Feb 2008 21:17:33 +0100 |
I have a problem with recent changes in mappers and isascii/toascii.
The problem is that MSVC uses #define to define isascii and toascii to
something else (prefix with __). These definition are located in ctype.h,
such that octave_value class definition will be different, depending on
whether you included ctype.h or not.
Up to now, I could re-enable MSVC compilation with a patch like the
one attached (it's not a changeset as it's only a temporary solution;
once finalized, I'll provide a real changeset), but I find it rather ugly.
With the previous code, I could solve the problem locally, but now that
classes have isascii/toascii members, this is more tricky. The patch
itself is not perfect and fails if you include ctype.h after ov.h (then you
have re-undefine isascii/toascii).
Another solution would be to use other names than isascii/toascii
in octave code (except in the DEFUN's), but I don't know if this would
be acceptable. Any opinion?
BTW, this whole problem is related to a common pattern found in
MSVC headers that prepend most of the C runtime functions with
an underscore. When looking in the headers, one can read this is
required by ANSI. Is this really so? I've never heard that...
Michael.
- isascii/toascii with MSVC,
Michael Goffioul <=
- Re: isascii/toascii with MSVC, Michael Goffioul, 2008/02/25
- Re: isascii/toascii with MSVC, John W. Eaton, 2008/02/25
- Re: isascii/toascii with MSVC, Michael Goffioul, 2008/02/25
- Re: isascii/toascii with MSVC, John W. Eaton, 2008/02/25
- Re: isascii/toascii with MSVC, Michael Goffioul, 2008/02/25
- Re: isascii/toascii with MSVC, John W. Eaton, 2008/02/25
- Re: isascii/toascii with MSVC, Michael Goffioul, 2008/02/25
- Re: isascii/toascii with MSVC, John W. Eaton, 2008/02/25
- Re: isascii/toascii with MSVC, Michael Goffioul, 2008/02/25
- Re: isascii/toascii with MSVC, John W. Eaton, 2008/02/25