Hello,
<snip>
#if (WIN32)
#include "stdafx.h"
#endif
int _tmain(int argc, _TCHAR **argv) {
#if (WIN32)
printf("errrr\n");
#endif
return 0;
}
</snip>
I get a C1020 :-( on the first #if instruction.
Why ?
I should be able to use #if out of a function!!
When i remove the the first #if, the program compiles.
Is it a bug from my brain or ms ? :P
Mike
Mike Deep - 07 Feb 2004 23:11 GMT
I would like to inform you that the Managed C++ flag must be enabled to get
the error on VC7.
#if (WIN32)
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
#else
#include <stdio.h>
#include <stdlib.h>
#endif
#if (WIN32)
int _tmain(
int argc,
_TCHAR *argv[]
) {
#else
signed int main(
signed int argc,
signed char **argv
) {
#endif
because the pre-processor doesn't detect my first #ifdef the second pre-proc
instruction is dead.
/Od /AI "XXXXXXX" /D "WIN32" /D "_DEBUG" /D "_MBCS" /FD /EHsc /MTd /GS
/Yu"stdafx.h" /Fp"Debug/XX.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /nologo
/c /Zi /clr /TP /FU
It really look a microsoft bug, if not that sux for software port.
> Hello,
>
[quoted text clipped - 21 lines]
>
> Mike