c++precompiled-headersc++builder-2009

#pragma once equivalent for c++builder


Is there anything equivalent to #pragma once for Codegear RAD Studio 2009?

I am using the precompiled header wizard and I would like to know if it is still necessary to use include guards when including header files?


Solution

  • Support for #pragma once was added in C++Builder 2010 In C++Builder 2009 and earlier, the unknown pragma will simply be ignored. I would suggest using

    #ifndef X 
    #define X
    //code 
    #endif
    

    style header guards in the versions of C++Builder that do not support #pragma once.