problems about #define and so on..

J

jungleman

I've seen so many as followings :

00085 #if !defined(__STRICT_ANSI__)
00086 #if defined(__GNUC__)
00087 #define FETION_HAS_64BIT_TYPE long long
00088 #endif


but I don't know what the above means ! and I wonder where i can know
deep into these macros .

thank you in advance.
 
P

Pascal J. Bourguignon

jungleman said:
I've seen so many as followings :

00085 #if !defined(__STRICT_ANSI__)
00086 #if defined(__GNUC__)
00087 #define FETION_HAS_64BIT_TYPE long long
00088 #endif


but I don't know what the above means ! and I wonder where i can know
deep into these macros .

Macros are managed by the C pre-processor, or cpp.

Therefore first you will type:

man cpp

Read it, and notice how the SEE ALSO section mention the Info entry for cpp. Therefore type;

info cpp

and further jump into the deepness of these macros.


(If you use emacs, you may also type C-h i m cpp RET)
 
I

Ivan

Like in any if-else structure, ! is negative. So the above reads:

"If __STRICT_ANSI__ IS NOT defined, if __GNUC__ IS defined, ..."

__STRICT_ANSI__ and __GNUC__ are usually defined by the compiler.

Correct on explaining the means of the macros.

But the macro __GNUC__ are no alway defined in all the compiler. It's
a platform dependent macro. If this macro was defined, it means the
gcc/g++ series compiler you are using rather than VC++ or Borland C++.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top