Solved

_W64 Annotation

Posted on 2011-03-14
2
474 Views
Last Modified: 2012-05-11

I am compiling a open source library using Embarcadero RAD studio.

The library builds OK under VS2010. So I am keeping all the include/library paths the same as what is used in the VS2010 project.

The following are the VC++ Directories used in VS2010 as part of the project properties.

Executable Directories
Include Directories
Reference Directories
Library Directories
Source Directories
Exclude Directories

Out of the above I am only syncing Include and Library directories.

The directories refenced in the include section are:

$(VCInstallDir)include;
$(VCInstallDir)atlmfc\include;
$(WindowsSdkDir)include;
$(FrameworkSDKDir)\include;

I am not using atlmfc and .Net Framework. So I am just using VC include and SDK include. Similar set-up for library directories too.

Since I have included the SDK folder in the include path I was not expecting an error with the line below

typedef _W64 unsigned int   uintptr_t;

And yet when the build the library Embarcadero C++ builder throws the error below:

[BCC32 Error] vadefs.h(48): E2257 , expected

The file refered above I beleive is pulled into my build as an external dependency.

So my questions are, is _W64 a typedef? Where is it defined?

Why is my build giving the error above? Is there another include location I need to include to fix this error?
0
Comment
Question by:olmuser
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 35132898
Well, it is more like a helper and it is defined as '__w64' in BaseTsd.h' when building a 32 bit project:

 
#if !defined(_W64)
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
#define _W64 __w64
#else
#define _W64
#endif
#endif

Open in new window


Regarding '__w64', see http://msdn.microsoft.com/en-us/library/s04b5w00%28v=VS.100%29.aspx

"(Microsoft Specific) Lets you mark variables, such that when you compile with /Wp64 the compiler will report any warnings that would be reported if you were compiling with a 64-bit compiler."

So you can basically get rid of that by adding

#define _W64

before including any headers.
0
 
LVL 86

Expert Comment

by:jkr
ID: 35148931
Anything still unclear?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now