Skip to content

Commit

Permalink
core: Use extern "C" for RPiCamAppsVersion() call
Browse files Browse the repository at this point in the history
This avoids name mangling when it is not needed.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
  • Loading branch information
naushir committed Jan 7, 2025
1 parent 9636ef2 commit 8d09940
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
14 changes: 10 additions & 4 deletions core/version.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*
* AUTO-GENERATED, DO NOT MODIFY!
*/
#include <string>

#include "core/version.hpp"

#if LIBEGL_PRESENT
Expand Down Expand Up @@ -37,12 +39,16 @@ static const std::string caps {"egl:" + std::to_string(egl) +
" drm:" + std::to_string(drm) +
" libav:" + std::to_string(libav)};

const std::string &RPiCamAppsVersion()
extern "C" {

const char *RPiCamAppsVersion()
{
return version;
return version.c_str();
}

const std::string &RPiCamAppsCapabilities()
const char *RPiCamAppsCapabilities()
{
return caps;
return caps.c_str();
}

}
9 changes: 5 additions & 4 deletions core/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*/
#pragma once

#include <string>

const std::string &RPiCamAppsVersion();
const std::string &RPiCamAppsCapabilities();
extern "C"
{
const char *RPiCamAppsVersion();
const char *RPiCamAppsCapabilities();
}

0 comments on commit 8d09940

Please sign in to comment.