Skip to content

Restore __cplusplus guard absent from oid.h - #10927

Open
HelloOO7 wants to merge 1 commit into
Mbed-TLS:developmentfrom
HelloOO7:development
Open

Restore __cplusplus guard absent from oid.h#10927
HelloOO7 wants to merge 1 commit into
Mbed-TLS:developmentfrom
HelloOO7:development

Conversation

@HelloOO7

Copy link
Copy Markdown

Description

Since release 4.0.0, mbedtls/oid.h no longer includes an extern "C" guard for when the header is used from C++ code. This makes such C++ code fail to compile with an undefined reference error unless manually wrapped in extern C. I've had this happen in an ESP-IDF project.

This appears to be a regression, as the guard was present up until and including this commit:

#ifdef __cplusplus

Since this looked like a rather rudimentary bug to fix, I've created this PR to restore the appropriate preprocessor guards to the file. I apologize if this should have been an issue first, it did not appear necessary to me to create one for such a tiny little thing.

PR checklist

  • changelog not required because of the fix being overly trivial to mention
  • framework PR - not applicable
  • TF-PSA-Crypto development PR - not applicable
  • TF-PSA-Crypto 1.1 PR - not applicable
  • mbedtls development PR provided
  • mbedtls 4.1 PR provided # | not required because:
  • mbedtls 3.6 PR not required because this issue did not exist in 3.x
  • tests not required because this is a preprocessor guard, not a feature

Signed-off-by: HelloOO7 <cendarehor@gmail.com>
@bjwtaylor bjwtaylor added bug needs-review Every commit must be reviewed by at least two team members, needs-backports Backports are missing or are pending review and approval. component-x509 needs-ci Needs to pass CI tests needs-reviewer This PR needs someone to pick it up for review size-s Estimated task size: small (~2d) priority-medium Medium priority - this can be reviewed as time permits labels Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug component-x509 needs-backports Backports are missing or are pending review and approval. needs-ci Needs to pass CI tests needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review priority-medium Medium priority - this can be reviewed as time permits size-s Estimated task size: small (~2d)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants