#pragma once equivalent for c++builder

1.1k Views Asked by At

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?

2

There are 2 best solutions below

0
On BEST ANSWER

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.

5
On

Rad Studio supports #pragma once, along with all of the following.