Author |
Topic |
|
squidge
Junior Member
23 Posts |
Posted - Jan 10 2005 : 06:07:36 AM
|
Is there a way of detecting VAX by means of a #ifdef or similar? Just as VAX doesn't like some of our variable definitions, and so therefore underlines all uses of them saying they are spelled wrong, as in:
@tiny char accControl;
Where "@tiny" is a compiler specific request to store the variable in a certain part of memory. Obviously we don't expect VAX to understand these, but could be do something like:
#ifdef VAX #define _TINY #else #define _TINY @tiny #endif
So the variables are recognised by the parser? |
|
WannabeeDeveloper
Tomato Guru
Germany
775 Posts |
Posted - Jan 10 2005 : 10:08:31 AM
|
Usually, VAX doesn't look into #ifdefs.
So whenever you #define something, VAX will color it in it's "Preprocesseor Macro" color...
|
|
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jan 10 2005 : 3:00:52 PM
|
VA X looks inside #ifdefs and parses all cases. If a symbol is defined in both cases, VA X sees both definitions and remembers both. It uses the first definition if the symbol is used subsequently when defining a different symbol.
For your case, we tried placing a definition of "tiny" that VA X would find first, then use in all definitions of your tiny symbols. We did this by placing the following line in stdafx.h in the installation directory of VA X. Then we rebuilt the symbol database via our the Performance node of our options dialog. (You can test within any one source file -- changing stdafx.h only when you have something that works.)
#define tiny()
Unfortunately, our attempt didn't have the effect we wanted. We can make VA X ignore "tiny", but not the at sign. VA X resolves your definitions into: @ char accControl ...which is not good.
We abandon our effort to find a global definition of "@tiny" that makes VA X forget the directive.
A cumbersome workaround is to create a file of definitions for all tiny symbols -- without the @tiny macros. VA X would parse this file first, e.g. #included from our stdafx.h or from a common header in your project, then see and use the definitions later in your code. Unfortunately, you need to keep this file up-to-date, and a change might force you to rebuild your entire project. Adding to our stdafx.h and pressing "Rebuild" on our Performance node might be better.
Yet another option is to wrap every one of your symbol definitions:
#ifdef NOTDEF char accControl; #else #tiny char accControl; #endif
VA X will look in both cases of the #ifdef. It will see the definition of accControl and use it as you edit. The compiler ignores the simple definition of accControl, assuming NOTDEF is never #defined, and uses only the tiny version.
The workaround that makes the most sense depends on your configuration, i.e. how many tiny symbols you have, where they are defined and how often you make new ones. |
|
|
|
Topic |
|
|
|