Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the macro-based include guards by #pragma once #9401

Merged
merged 3 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/engine/agg_file.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2020 - 2024 *
* Copyright (C) 2020 - 2025 *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
Expand All @@ -18,8 +18,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef AGG_FILE_H
#define AGG_FILE_H
#pragma once

#include <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -70,5 +69,3 @@ namespace fheroes2
}

IStreamBase & operator>>( IStreamBase & stream, fheroes2::ICNHeader & icn );

#endif
7 changes: 2 additions & 5 deletions src/engine/audio.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2008 by Andrey Afletdinov <[email protected]> *
Expand All @@ -21,8 +21,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef H2AUDIO_H
#define H2AUDIO_H
#pragma once

#include <cstdint>
#include <optional>
Expand Down Expand Up @@ -110,5 +109,3 @@ namespace Music

std::vector<uint8_t> Xmi2Mid( const std::vector<uint8_t> & buf );
}

#endif
8 changes: 3 additions & 5 deletions src/engine/dir.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2009 by Andrey Afletdinov <[email protected]> *
Expand All @@ -20,8 +20,8 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef H2DIR_H
#define H2DIR_H

#pragma once

#include <list>
#include <string>
Expand All @@ -40,5 +40,3 @@ struct ListFiles : public std::list<std::string>
// Returns true if there are no files in the 'path' directory with names ending in 'filter', case-insensitive, otherwise returns false.
static bool IsEmpty( const std::string & path, const std::string & filter );
};

#endif
8 changes: 3 additions & 5 deletions src/engine/localevent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2008 by Josh Matthews <[email protected]> *
Expand All @@ -21,8 +21,8 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef H2LOCALEVENT_H
#define H2LOCALEVENT_H

#pragma once

#include <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -519,5 +519,3 @@ class LocalEvent
_actionStates &= ~states;
}
};

#endif
7 changes: 2 additions & 5 deletions src/engine/logging.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2021 - 2024 *
* Copyright (C) 2021 - 2025 *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
Expand All @@ -18,8 +18,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef H2LOGGING_H
#define H2LOGGING_H
#pragma once

#include <iostream>
#include <sstream> // IWYU pragma: keep
Expand Down Expand Up @@ -191,5 +190,3 @@ namespace Logging
return; \
} \
const Logging::TextSupportLogger _temp_logger; // The name was chosen on purpose to avoid collisions with other variable names within a code block.

#endif // H2LOGGING_H
8 changes: 3 additions & 5 deletions src/engine/pal.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2020 - 2024 *
* Copyright (C) 2020 - 2025 *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
Expand All @@ -17,8 +17,8 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef H2PAL_H
#define H2PAL_H

#pragma once

#include <cstdint>
#include <vector>
Expand Down Expand Up @@ -47,5 +47,3 @@ namespace PAL
const std::vector<uint8_t> & GetPalette( const PaletteType type );
std::vector<uint8_t> CombinePalettes( const std::vector<uint8_t> & first, const std::vector<uint8_t> & second );
}

#endif
7 changes: 2 additions & 5 deletions src/engine/system.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2013 by Andrey Afletdinov <[email protected]> *
Expand All @@ -21,8 +21,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef H2SYSTEM_H
#define H2SYSTEM_H
#pragma once

#include <ctime>
#include <filesystem>
Expand Down Expand Up @@ -88,5 +87,3 @@ namespace System

tm GetTM( const time_t time );
}

#endif
7 changes: 2 additions & 5 deletions src/engine/tinyconfig.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2010 by Andrey Afletdinov <[email protected]> *
Expand All @@ -21,8 +21,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef TINYCONFIG_H
#define TINYCONFIG_H
#pragma once

#include <functional>
#include <map>
Expand Down Expand Up @@ -53,5 +52,3 @@ class TinyConfig : private std::map<std::string, std::string, std::less<>>
const char separator;
const char comment;
};

#endif
8 changes: 3 additions & 5 deletions src/engine/tools.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2009 by Andrey Afletdinov <[email protected]> *
Expand All @@ -20,8 +20,8 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef H2TOOLS_H
#define H2TOOLS_H

#pragma once

#include <bitset>
#include <cstddef>
Expand Down Expand Up @@ -148,5 +148,3 @@ namespace fheroes2
}
}
}

#endif
7 changes: 2 additions & 5 deletions src/engine/zzlib.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2009 by Andrey Afletdinov <[email protected]> *
Expand All @@ -21,8 +21,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef H2ZLIB_H
#define H2ZLIB_H
#pragma once

#include <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -56,5 +55,3 @@ namespace Compression

fheroes2::Image CreateImageFromZlib( int32_t width, int32_t height, const uint8_t * imageData, size_t imageSize, bool doubleLayer );
}

#endif
7 changes: 2 additions & 5 deletions src/fheroes2/agg/agg.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2009 by Andrey Afletdinov <[email protected]> *
Expand All @@ -21,8 +21,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef H2AGG_H
#define H2AGG_H
#pragma once

#include <cstdint>
#include <string>
Expand Down Expand Up @@ -58,5 +57,3 @@ namespace AGG

std::vector<uint8_t> getDataFromAggFile( const std::string & key, const bool ignoreExpansion );
}

#endif
6 changes: 2 additions & 4 deletions src/fheroes2/agg/bin_info.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2020 - 2024 *
* Copyright (C) 2020 - 2025 *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
Expand All @@ -18,8 +18,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef H2BIN_FRM_H
#define H2BIN_FRM_H
#pragma once

#include <algorithm>
#include <cstddef>
Expand Down Expand Up @@ -93,4 +92,3 @@ namespace Bin_Info

MonsterAnimInfo GetMonsterInfo( uint32_t monsterID );
}
#endif
7 changes: 2 additions & 5 deletions src/fheroes2/agg/icn.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2009 by Andrey Afletdinov <[email protected]> *
Expand All @@ -21,8 +21,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef H2ICN_H
#define H2ICN_H
#pragma once

#include <cstdint>

Expand Down Expand Up @@ -1143,5 +1142,3 @@ namespace ICN

int getFlagIcnId( const int color );
}

#endif
7 changes: 2 additions & 5 deletions src/fheroes2/agg/m82.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2009 by Andrey Afletdinov <[email protected]> *
Expand All @@ -21,8 +21,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef H2M82_H
#define H2M82_H
#pragma once

namespace Maps
{
Expand Down Expand Up @@ -359,5 +358,3 @@ namespace M82
// Returns the ambient soundtrack for a given tile or M82::UNKNOWN if there is no track
SoundType getAdventureMapTileSound( const Maps::Tile & tile );
}

#endif
7 changes: 2 additions & 5 deletions src/fheroes2/agg/mus.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2024 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2008 by Josh Matthews <[email protected]> *
Expand All @@ -21,8 +21,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef H2MUS_H
#define H2MUS_H
#pragma once

#include <string>

Expand Down Expand Up @@ -94,5 +93,3 @@ namespace MUS

int GetBattleRandom();
}

#endif
7 changes: 2 additions & 5 deletions src/fheroes2/agg/til.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***************************************************************************
* fheroes2: https://github.com/ihhub/fheroes2 *
* Copyright (C) 2019 - 2022 *
* Copyright (C) 2019 - 2025 *
* *
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
* Copyright (C) 2009 by Andrey Afletdinov <[email protected]> *
Expand All @@ -21,8 +21,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#ifndef H2TIL_H
#define H2TIL_H
#pragma once

namespace TIL
{
Expand All @@ -37,5 +36,3 @@ namespace TIL
LASTTIL
};
}

#endif
Loading
Loading