Skip to content

Fix duplicate __guard macro definition in set/procedures.inc#270

Merged
tclune merged 2 commits intofeature/#268-remove-warningfrom
copilot/sub-pr-269
Feb 20, 2026
Merged

Fix duplicate __guard macro definition in set/procedures.inc#270
tclune merged 2 commits intofeature/#268-remove-warningfrom
copilot/sub-pr-269

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

Addresses feedback from PR #269: set/procedures.inc still had two __guard definitions that could trigger redefinition warnings in nested template instantiations.

Changes

  • Removed unconditional #define __guard __set_guard before includes
  • Repositioned conditional undef/define block between copy_set_T_to_internal_T.inc and define_derived_macros.inc
  • Now matches the pattern used in vector, deque, ptr, queue, and stack templates

Before

#define __guard __set_guard
#include "parameters/T/copy_set_T_to_internal_T.inc"
#include "parameters/T/define_derived_macros.inc"

#if (defined(__guard))
#  undef __guard
#endif
#define __guard __set_guard

After

#include "parameters/T/copy_set_T_to_internal_T.inc"
#if (defined(__guard))
#  undef __guard
#endif
#define __guard __set_guard
#include "parameters/T/define_derived_macros.inc"

The macro is now defined exactly once with conditional undef protection, eliminating redefinition warnings.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: tclune <6225888+tclune@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix macro redefinition warnings in templates Fix duplicate __guard macro definition in set/procedures.inc Feb 20, 2026
Copilot AI requested a review from tclune February 20, 2026 01:01
@tclune tclune marked this pull request as ready for review February 20, 2026 13:20
@tclune tclune merged commit 1d9d02d into feature/#268-remove-warning Feb 20, 2026
15 of 17 checks passed
@tclune tclune deleted the copilot/sub-pr-269 branch February 20, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants