[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 01:38:05 -0500 |
On 25-Feb-2008, Michael Goffioul wrote:
| This time with the attachment.
|
| On 2/24/08, Michael Goffioul <address@hidden> wrote:
| > 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.
Even with the #undef toascii, you still need to use __toascii to get
the function instead of the macro? I don't think that conforms to the
C langauge standard.
What happens for the following if you compile it as a C program?
#include <stdio.h>
#include <ctype.h>
#undef toascii
int
main (void)
{
typedef int (*fptr) (int);
char c = '*';
int i;
fptr f = toascii;
i = (*f) (c);
printf ("%c: %d\n", c, i);
return 0;
}
Does that fail because toascii is undefined?
I think this is supposed to be one of the accepted ways to avoid
macros defined in ctype.h and use the functions instead, so I would
expect it to work.
jwe
- isascii/toascii with MSVC, Michael Goffioul, 2008/02/24
- Re: isascii/toascii with MSVC, Michael Goffioul, 2008/02/25
- Re: isascii/toascii with MSVC,
John W. Eaton <=
- 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/26
- Re: isascii/toascii with MSVC, Daniel J Sebald, 2008/02/25