How can I get Vcc to accept macros?

May 9, 2012 at 12:07 AM
Edited May 9, 2012 at 12:40 AM

I've got the following problem: I want to get Vcc to verify a file, let's say foo.c.

foo.c included a header file foo.h containing a code fragment like this:

#if defined(_MSC_VER)
# ifndef __cplusplus
// Do some C stuff specific to Visual C++
# endif
#else
# ifndef __cplusplus
#  include <some_file_not_available_on_windows>
# else
// Some boring stuff
# endif
#endif

If I try to verify foo.c using Vcc I get

fatal error C1083: Cannot open include file: 'some_file_not_available_on_windows': No such file or directory

This shows the problem that Vcc does not detect that we are on Visual Studio on Windows - thus _MSC_VER is defined and  the #else part shall be ignored.

How can I get Vcc to use these additional preprocessor definitions, that Visual Studio defines, automatically.

May 9, 2012 at 12:41 AM

Replacing _MSC_VER by _WIN32 solved the problem.