The C/C++ Include Guard extension enables you to add, remove or update include guard macros to your C/C++ header files in one go.
Thanks to contributors: @erkan-ozkan, @HO-COOH, @sleiner, @Philanatidae, @alexolog, headhunter45, smuke
Automatically insert include guard when creating a new header file
Insert and Remove include guard
Update existing include guard
Automatically update include guard when renaming a header file
// GUID
#define E8A33412_A210_4F05_99A4_F6E2019B7137
// File name
#define UTILS_H
// File path form the prject root
#define FOO_BAR_UTILS_H
#endif
. Block, line or none./* Block comment. */
#endif /* AE2E827A_F4B3_422C_801F_DF9020986F2B */
// Line comment.
#endif // B93E7584_5E15_48C3_9D9C_92263000BF7B
// Without comment.
#endif
// Can prevent ill-formed macros like this.
#define 47A7840C_D31B_4D39_BF77_E5E957F0A97A
#define ABC_7FE87DA8_601D_4D8E_AEE5_E6BE6EAB5678_XYZ
// From a path like 'foo/_bar_/utils.h'.
#define FOO_BAR_UTILS_H // not FOO__BAR__UTILS_H
// From a path like 'foo/bar/utils.h'.
#define FOO_BAR_UTILS
// From a path like 'foo/bar/utils.h'.
#define BAR_UTILS
/**
* Copyright (c) 2019 Akira Miyakoda
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#ifndef FOO_BAR_UTILS_H // <- Inserted here.
#define FOO_BAR_UTILS_H
Removes #pragma once when an include guard is added. (Optional)
Customizable number of spaces between #endif
and its comment.