From 8d09940c527bd7ed18bf309f070b4e43b9eca21d Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 7 Jan 2025 12:11:27 +0000 Subject: [PATCH] core: Use extern "C" for RPiCamAppsVersion() call This avoids name mangling when it is not needed. Signed-off-by: Naushir Patuck --- core/version.cpp.in | 14 ++++++++++---- core/version.hpp | 9 +++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/core/version.cpp.in b/core/version.cpp.in index 74cec7b9..b0490227 100644 --- a/core/version.cpp.in +++ b/core/version.cpp.in @@ -4,6 +4,8 @@ * * AUTO-GENERATED, DO NOT MODIFY! */ +#include + #include "core/version.hpp" #if LIBEGL_PRESENT @@ -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(); +} + } diff --git a/core/version.hpp b/core/version.hpp index 3ba1896b..81005107 100644 --- a/core/version.hpp +++ b/core/version.hpp @@ -5,7 +5,8 @@ */ #pragma once -#include - -const std::string &RPiCamAppsVersion(); -const std::string &RPiCamAppsCapabilities(); +extern "C" +{ + const char *RPiCamAppsVersion(); + const char *RPiCamAppsCapabilities(); +}