Solved

Order of conditional defines

Posted on 2011-03-10
2
251 Views
Last Modified: 2012-06-27
I am building a VC++ project using Borland CPP Builder. Does it matter in what order the conditional defines are defined in cpp builder project options?
0
Comment
Question by:Mydeen Yussouf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 125 total points
ID: 35095629
(This feels like a trick question).

I would assume the way the compiler works is that all of the conditional defines are treated as if the defines existed in an include file that gets inserted as the very first line of each source code file that gets compiled.

So if you had the an options list of:
"WIN32;_WINDOWS;_DEBUG"
it would be like you had an include file with the contents:

#define WIN32
#define _WINDOWS
#define _DEBUG

and this #include would get added as the very first line of every C/C++ file in the project.

Since these commands are usually just turning ON various #ifdef lines later in the source code (or the #include files within the source code), it shouldn't mater which order these #define statements occur.
0
 
LVL 34

Expert Comment

by:sarabande
ID: 35107616
how do you build a Visual-C++ project with Borland Cpp Builder?

did you mean you took the same source code?

hookoodooku is fully right and only if you find something like XXX=YYY where YYY also is a preprocessor macro you need to care for the right order.

Sara
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

622 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