diff options
author | Marcel Groothuis <margro.xbmc@gmail.com> | 2011-01-09 21:15:01 +0100 |
---|---|---|
committer | Marcel Groothuis <margro.xbmc@gmail.com> | 2011-01-09 21:15:01 +0100 |
commit | ce7222a76b3c8ff14d25ca7208e7be1162b32c07 (patch) | |
tree | 2252e90a705daabfeae31757242d0d293a211a47 /lib/addons | |
parent | b27ec62fe74f097482a92b4f73cb80aced87ad67 (diff) |
pvr: libXBMC_addon.dll is a C dll and should not use std::string as function argument or return type. This fixes heap corruption problems under VC++.
Diffstat (limited to 'lib/addons')
3 files changed, 14 insertions, 6 deletions
diff --git a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp index d14ec2657a..22651af154 100644 --- a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp +++ b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp @@ -77,12 +77,12 @@ DLLEXPORT void XBMC_log(const addon_log_t loglevel, const char *format, ... ) m_cb->Log(m_Handle->addonData, loglevel, buffer); } -DLLEXPORT bool XBMC_get_setting(string settingName, void *settingValue) +DLLEXPORT bool XBMC_get_setting(const char* settingName, void *settingValue) { if (m_cb == NULL) return false; - return m_cb->GetSetting(m_Handle->addonData, settingName.c_str(), settingValue); + return m_cb->GetSetting(m_Handle->addonData, settingName, settingValue); } DLLEXPORT void XBMC_queue_notification(const queue_msg_t type, const char *format, ... ) @@ -107,22 +107,22 @@ DLLEXPORT void XBMC_unknown_to_utf8(string &str) str = buffer; } -DLLEXPORT string XBMC_get_localized_string(int dwCode) +DLLEXPORT const char* XBMC_get_localized_string(int dwCode) { if (m_cb == NULL) return ""; string buffer = m_cb->GetLocalizedString(m_Handle->addonData, dwCode); - return buffer; + return buffer.c_str(); } -DLLEXPORT string XBMC_get_dvd_menu_language() +DLLEXPORT const char* XBMC_get_dvd_menu_language() { if (m_cb == NULL) return ""; string buffer = m_cb->GetDVDMenuLanguage(m_Handle->addonData); - return buffer; + return buffer.c_str(); } }; diff --git a/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj b/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj index 27ce636fa7..af5c26fc7a 100644 --- a/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj +++ b/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj @@ -79,6 +79,9 @@ <ItemGroup> <ClCompile Include="..\..\libXBMC_addon.cpp" /> </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\..\..\..\addons\library.xbmc.addon\libXBMC_addon.h" /> + </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> diff --git a/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj.filters b/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj.filters index 169e7a4f32..916673ca41 100644 --- a/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj.filters +++ b/lib/addons/library.xbmc.addon/project/VS2010Express/libXBMC_addon.vcxproj.filters @@ -11,4 +11,9 @@ <Filter>Source Files</Filter> </ClCompile> </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\..\..\..\addons\library.xbmc.addon\libXBMC_addon.h"> + <Filter>Source Files</Filter> + </ClInclude> + </ItemGroup> </Project>
\ No newline at end of file |