Skip to content

Guard type generic macro from C++ compilation#162

Merged
awvwgk merged 8 commits intomainfrom
copilot/fix-type-generic-macro-usage
Feb 6, 2026
Merged

Guard type generic macro from C++ compilation#162
awvwgk merged 8 commits intomainfrom
copilot/fix-type-generic-macro-usage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

The dftd3_delete type generic macro uses C11's _Generic, which is incompatible with C++. Including the header in C++ code fails compilation.

Changes

  • Wrapped dftd3_delete macro with #ifndef __cplusplus guard in include/s-dftd3.h

Usage

C code continues using the type generic macro:

dftd3_error error = dftd3_new_error();
dftd3_delete(error);

C++ code calls specific delete functions:

dftd3_error error = dftd3_new_error();
dftd3_delete_error(&error);  // macro not available in C++
Original prompt

This section details on the original issue you should resolve

<issue_title>Type generic macro for C header not working for C++ usage</issue_title>
<issue_description>The type generic macro for C should not be exposed when using in C++.</issue_description>

<agent_instructions>Do not expose type generic macros if C++ compiler is used.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 6, 2026 13:51
Co-authored-by: awvwgk <28669218+awvwgk@users.noreply.github.com>
Co-authored-by: awvwgk <28669218+awvwgk@users.noreply.github.com>
Co-authored-by: awvwgk <28669218+awvwgk@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix type generic macro exposure for C++ Guard type generic macro from C++ compilation Feb 6, 2026
Copilot AI requested a review from awvwgk February 6, 2026 13:55
Copilot AI and others added 2 commits February 6, 2026 14:34
@awvwgk awvwgk marked this pull request as ready for review February 6, 2026 14:38
@awvwgk awvwgk merged commit 2ec0e33 into main Feb 6, 2026
26 of 27 checks passed
@awvwgk awvwgk deleted the copilot/fix-type-generic-macro-usage branch February 6, 2026 14:41
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.34%. Comparing base (80b548d) to head (b3439a6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #162   +/-   ##
=======================================
  Coverage   66.34%   66.34%           
=======================================
  Files          33       33           
  Lines        4627     4627           
  Branches     1608     1608           
=======================================
  Hits         3070     3070           
  Misses        637      637           
  Partials      920      920           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Type generic macro for C header not working for C++ usage

2 participants