Re: Confusing #ifdef

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



It's used so that when the compiler is doing it's job it will only compile
that header file once.
You can change that define to what every you want it to be, as long as you
don't use the save value in anyother header file in your project.
What Visual studio does is that they try to make it as unique as possible by
using all those numbers (look like a UUID).

Anyway, I am not sure if VC++ 6.0 compiler handles this or not. but you
might be able to get rid of the entire #ifdef #define thing and use

#pragma once

at the top of the h file.

AliR.

"AVee" <AVee@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D769F2C5-48E4-4065-B640-67A51A4F7C40@xxxxxxxxxxxxxxxx
VC6 inserts a legnthy, apparently encoded #ifdef in the Application,
Document
and View class header files. My questions:

1) What is this used for? and
2) What effect is might there be in removing it?


.



Relevant Pages

  • Re: include file question
    ... First off I first read that you could keep the compiler ... from including a header file twice with the #pragma once But then I read that #pragma once is obsolete? ... #pragma once is only designed to prevent including the same header file more than once within the same cpp file. ...
    (microsoft.public.vc.mfc)
  • Re: Correspondence between headers and macros
    ... Richard Heathfield a écrit: ... This pragma means that the header file should be included once. ... MPW C compiler (Macintosh) ...
    (comp.lang.c)
  • Re: include file question
    ... First off I first read that you could keep the compiler ... pragma once was introduced after MFC's original ... I have never used #import for including an header file. ...    by the compiler. ...
    (microsoft.public.vc.mfc)
  • Re: header files
    ... As all code can be written in the header file ... > void foo() ... > compiler tries to compile main.c it eventually reaches the line ... > the compiler has never heared about a function called printf(). ...
    (alt.comp.lang.learn.c-cpp)
  • Re: include file question
    ... Where did you read that #pragma once is obsolete? ... because it suggests that what you need is some kind of weird compiler hack to make your ... inside the header file to prevent multiple execution of the contents. ... documentation about Objective C, which is a language which is NOT the C++ language, has ...
    (microsoft.public.vc.mfc)