Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Problem with macrodef after type name
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Sir Zooro
Junior Member

Poland
15 Posts

Posted - Jul 09 2004 :  1:15:28 PM  Show Profile
Hello,
I'm working on library for Windows & Linux. I need to specify default alignment of struct members. In GCC you can do this by appending attributes after type definition, in VS.NET - before. Unfortunately, VAX gets my macrodef as typename. Try this:

#ifdef _WIN32
	#define VC_ALIGN __declspec(align(1))
	#define GCC_ALIGN
#else
	#define VC_ALIGN
	#define GCC_ALIGN __attribute__((aligned (1)))
#endif

typedef struct VC_ALIGN MyStruct_ {
	int x;
} MyStruct GCC_ALIGN ;

GCC_ALIGN is colored blue (like other types, instead of purple). MyStruct is colored black (and it's unknown to VAX)

I'm using VS.NET 2003 & VAX 1237

Best Regards,
Daniel

Edited by - Sir Zooro on Jul 09 2004 1:21:48 PM

support
Whole Tomato Software

5566 Posts

Posted - Jul 09 2004 :  2:05:33 PM  Show Profile
VA X does not resolve VC_ALIGN nor GCC_ALIGN in your definition. VA X assumes you want to see these words when you click on a symbol of a the type.

You need to prod VA X into resolving the #defines before deciding what a MyStruct is. This happens by default for #defines that take arguments, or if you enable "Evaluate all macros..." in our options dialog. (We do not recommend the latter if not absolutely necessary. Lots of defintions appear foreign to you.)

In lieu of changing your source, update Misc\\stdafx.h in the VA X installation directory. VA X reads this file, and uses these definitions, before reading any other header.

Press Rebuild on the Performance node of our options dialog.
Exit your IDE.
Add these lines to our stdafx.h (you might have to make the file writeable):

#define VC_ALIGN()
#define GCC_ALIGN()

Start your IDE and wait for parsing to finish. You should be fine. VA X should know what MyStruct is, or should we say, VA X thinks the same way you do about MyStruct.

Whole Tomato Software, Inc.
Go to Top of Page

Sir Zooro
Junior Member

Poland
15 Posts

Posted - Jul 10 2004 :  07:30:13 AM  Show Profile
Thanks.

Best Regards,
Daniel
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000