Skip to content

Commit e82c6c4

Browse files
Ozaqclaude
andcommitted
Unify include guards to #pragma once
Traditional #ifndef guards are verbose, error-prone (copy-paste of wrong macro names), and add noise to diffs. #pragma once is supported by all compilers we target and eliminates these issues. - Convert 489 headers from #ifndef guards to #pragma once - Add #pragma once to 5 headers that had no guard at all - Skip src/eckit/contrib/ (third-party code) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e78f873 commit e82c6c4

File tree

494 files changed

+508
-2514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

494 files changed

+508
-2514
lines changed

src/eckit/bases/Loader.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
// File Loader.h
1212
// Baudouin Raoult - ECMWF Jul 96
1313

14-
#ifndef eckit_Loader_h
15-
#define eckit_Loader_h
16-
14+
#pragma once
1715
#include "eckit/eckit.h"
1816

1917
#include "eckit/container/ClassExtent.h"
@@ -41,5 +39,3 @@ class Loader : public ClassExtent<Loader> {
4139
//-----------------------------------------------------------------------------
4240

4341
} // namespace eckit
44-
45-
#endif

src/eckit/bases/Watcher.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
// File Watcher.h
1212
// Baudouin Raoult - ECMWF Jun 98
1313

14-
#ifndef eckit_Watcher_h
15-
#define eckit_Watcher_h
16-
14+
#pragma once
1715
//-----------------------------------------------------------------------------
1816

1917
namespace eckit {
@@ -36,5 +34,3 @@ class Watcher {
3634
//-----------------------------------------------------------------------------
3735

3836
} // namespace eckit
39-
40-
#endif

src/eckit/cmd/AliasCmd.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
/// @author Manuel Fuentes
1212
/// @date Jan 1997
1313

14-
#ifndef eckit_cmd_AliasCmd_H
15-
#define eckit_cmd_AliasCmd_H
16-
14+
#pragma once
1715
#include "eckit/cmd/CmdResource.h"
1816

1917

@@ -52,5 +50,3 @@ class AliasCmd : public CmdResource {
5250
//----------------------------------------------------------------------------------------------------------------------
5351

5452
} // namespace eckit
55-
56-
#endif

src/eckit/cmd/Arg.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
/// @author Manuel Fuentes
1212
/// @date Jan 1997
1313

14-
#ifndef eckit_cmd_Arg_H
15-
#define eckit_cmd_Arg_H
16-
14+
#pragma once
1715
#include <iosfwd>
1816
#include <memory>
1917
#include <string>
@@ -90,5 +88,3 @@ class Arg {
9088
//-----------------------------------------------------------------------------
9189

9290
} // namespace eckit
93-
94-
#endif

src/eckit/cmd/CmdApplication.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
/// @author Florian Rathgeber
1313
/// @date June 2015
1414

15-
#ifndef eckit_cmd_CmdApplication_H
16-
#define eckit_cmd_CmdApplication_H
17-
15+
#pragma once
1816
#include "eckit/cmd/CmdParser.h"
1917

2018
namespace eckit {
@@ -45,5 +43,3 @@ class CmdApplication : public Prompter {
4543
//----------------------------------------------------------------------------------------------------------------------
4644

4745
} // namespace eckit
48-
49-
#endif

src/eckit/cmd/CmdArg.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
* nor does it submit to any jurisdiction.
99
*/
1010

11-
#ifndef eckit_cmd_CmdArg_H
12-
#define eckit_cmd_CmdArg_H
13-
11+
#pragma once
1412
#include "eckit/config/Resource.h"
1513
#include "eckit/serialisation/Streamable.h"
1614
#include "eckit/value/Value.h"
@@ -115,5 +113,3 @@ class CmdArg : public eckit::Streamable {
115113
//-----------------------------------------------------------------------------
116114

117115
} // namespace eckit
118-
119-
#endif

src/eckit/cmd/CmdParser.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
/// @author Florian Rathgeber
1313
/// @date June 2015
1414

15-
#ifndef eckit_cmd_CmdParser_H
16-
#define eckit_cmd_CmdParser_H
17-
15+
#pragma once
1816
#include <iostream>
1917
#include <vector>
2018

@@ -100,5 +98,3 @@ class CmdParser {
10098
//-----------------------------------------------------------------------------
10199

102100
} // namespace eckit
103-
104-
#endif

src/eckit/cmd/CmdResource.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
* nor does it submit to any jurisdiction.
99
*/
1010

11-
#ifndef eckit_cmd_CmdResource_H
12-
#define eckit_cmd_CmdResource_H
13-
11+
#pragma once
1412
#include "eckit/cmd/Arg.h"
1513
#include "eckit/cmd/CmdArg.h"
1614
#include "eckit/eckit.h"
@@ -82,5 +80,3 @@ class CmdResource {
8280

8381

8482
} // namespace eckit
85-
86-
#endif

src/eckit/cmd/ConfigCmd.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
/// @author Baudouin Raoult
1313
/// @date Jan 1997
1414

15-
#ifndef eckit_cmd_ConfigCmd_H
16-
#define eckit_cmd_ConfigCmd_H
17-
15+
#pragma once
1816
#include "eckit/cmd/CmdResource.h"
1917

2018
//-----------------------------------------------------------------------------
@@ -54,5 +52,3 @@ class ConfigCmd : public CmdResource {
5452
//-----------------------------------------------------------------------------
5553

5654
} // namespace eckit
57-
58-
#endif

src/eckit/cmd/DirCmd.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
/// @author Baudouin Raoult
1313
/// @date Jan 1997
1414

15-
#ifndef eckit_cmd_DirCmd_H
16-
#define eckit_cmd_DirCmd_H
17-
15+
#pragma once
1816
#include "eckit/cmd/CmdResource.h"
1917

2018
//-----------------------------------------------------------------------------
@@ -54,5 +52,3 @@ class DirCmd : public CmdResource {
5452
//-----------------------------------------------------------------------------
5553

5654
} // namespace eckit
57-
58-
#endif

0 commit comments

Comments
 (0)