octave-maintainers
[Top][All Lists]
Advanced

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

Re: isascii/toascii with MSVC


From: John W. Eaton
Subject: Re: isascii/toascii with MSVC
Date: Mon, 25 Feb 2008 05:05:21 -0500

On 25-Feb-2008, Michael Goffioul wrote:

| On Mon, Feb 25, 2008 at 10:27 AM, John W. Eaton <address@hidden> wrote:
| > So maybe we should replace all
| >
| >  #include <cctype>
| >
| > lines in Octave with
| >
| >  #include "lo-ctype.h"
| >
| > and create liboctave/lo-cctype.h that does the right thing (undefines
| > the macros)?
| >
| > Maybe we should also add a corresponding lo-ctype.c file that provides
| > xisacii and xtoascii functions, and then use those everywhere in place
| > of isascii/toascii?  Would that fix the problem for you?  If it does,
| > then I think this would be a good solution as it would hide these
| > details in just two files.
| 
| Using an alternate name would definitely fix the problem, as long as you
| also use xisascii/xtoascii in the class definitions (that is for instance 
using
| MAPPERS_FORWARD(xisascii) instead of MAPPERS_FORWARD(isascii)
| in ov.h). If you do that, you don't really need lo-cctype.h with undef's; the
| only things you need are something like:
| 
| #include <cctype>
| 
| int
| xisascii (int c)
| {
|   return isascii (c);
| }
| 
| int
| xtoascii (int c)
| {
|   return toascii (c);
| }

I think I'd prefer to have the octave_value function names be the same
as they are in the scripting language, so what about

  #include <cctype>

  inline int xisascii (int c) { return isascii (c); }
  inline int xtoascii (int c) { return toascii (c); }

  #undef isascii
  #undef toascii

?  Are these the only two functions in cctype that might be defined as
macros or should we do the same for other functions as well?

jwe


reply via email to

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