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

Add extern "C" to headers for easier use by C++ #207

Merged
merged 1 commit into from
Feb 3, 2022

Commits on Feb 2, 2022

  1. Add extern "C" to headers for easier use by C++

    Add `extern "C"` directly to all headers except efivar-guids.h, which
    is generated. Because it interferes with C compilers, wrap each
    `extern` in an `#ifdef __cplusplus`. For efivar-guids.h update the
    generator, makeguids.c, to add the desired code.
    
    From https://en.cppreference.com/w/cpp/language/language_linkage:
    > extern "C" makes it possible to include header files containing
    > declarations of C library functions in a C++ program, but if the
    > same header file is shared with a C program, extern "C" (which
    > is not allowed in C) must be hidden with an appropriate #ifdef,
    > typically __cplusplus.
    
    Signed-off-by: Ted Brandston <tbrandston@google.com>
    tedbrandston committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    28789d1 View commit details
    Browse the repository at this point in the history