Re: if !defined and #pragma once
- From: Ajay Kalra <ajaykalra@xxxxxxxxx>
- Date: Wed, 2 Apr 2008 06:59:10 -0700 (PDT)
On Apr 1, 3:24 pm, David Wilkinson <no-re...@xxxxxxxxxxxx> wrote:
Ajay Kalra wrote:
On Apr 1, 6:18 am, asm23 <asmwarr...@xxxxxxxxx> wrote:
Hi,I'm a visual c++ 6.0 user. I'm confused that the CPP file generated
by the IDE always have these statement below:
#if!defined(AFX_XXXXX_H__32583F3A_E701_4274_AFD6_426BC1C59E81__INCLUDED_)
#define AFX_XXXXX_H__32583F3A_E701_4274_AFD6_426BC1C59E81__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
So, my question is "#if! defined (XXXX...)" is really useless? as the
newer compiler such as VS.NET 2001 VC.NET 2003...2008 all support the
#pragma once. the "if! ..." is functionally redundant.Is it right? Thanks.
Just use #pragma once instead. Since this pragma was added in VC6,
anything before that will not recognize. So for code for VC5 etc, this
was kept in VC6. It no longer is an issue and I only use #pragma once.
Ajay:
VC5 was _MSC_VER = 1100. "#pragma once" was in the wizard code in VC5.
Thanks. Is it correct that it was introduced in VC5 then?
---
Ajay
.
- Follow-Ups:
- Re: if !defined and #pragma once
- From: Joseph M . Newcomer
- Re: if !defined and #pragma once
- From: David Wilkinson
- Re: if !defined and #pragma once
- References:
- Re: if !defined and #pragma once
- From: Ajay Kalra
- Re: if !defined and #pragma once
- From: David Wilkinson
- Re: if !defined and #pragma once
- Prev by Date: Re: CListBox sorting
- Next by Date: Re: How to display png file in toolbar
- Previous by thread: Re: if !defined and #pragma once
- Next by thread: Re: if !defined and #pragma once
- Index(es):
Relevant Pages
|