Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Fix windows 7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Naamloos committed Nov 20, 2017
1 parent 87a754c commit 9d9116b
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 15 deletions.
1 change: 1 addition & 0 deletions foobar2000/ATLHelpers/foobar2000_ATL_helpers.vcxproj
Expand Up @@ -116,6 +116,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<AdditionalIncludeDirectories>$(ProjectDir)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down
1 change: 1 addition & 0 deletions foobar2000/SDK/foobar2000_SDK.vcxproj
Expand Up @@ -134,6 +134,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
3 changes: 1 addition & 2 deletions foobar2000/foo_mediacontrol/Discord.h
Expand Up @@ -24,7 +24,6 @@ void handleDiscordJoinRequest(const DiscordJoinRequest* request) {}

void discordInit()
{
char buffer[256];
DiscordEventHandlers handlers;
memset(&handlers, 0, sizeof(handlers));
handlers.ready = handleDiscordReady;
Expand All @@ -39,7 +38,7 @@ void discordInit()
void UpdatePresence(wchar_t *songname, wchar_t *artist)
{
char buffer[256];
sprintf(buffer, "%s - %s", util::wide_to_utf8(artist), util::wide_to_utf8(songname));
sprintf_s(buffer, 256, "%s - %s", util::wide_to_utf8(artist), util::wide_to_utf8(songname));
DiscordRichPresence discordPresence;
memset(&discordPresence, 0, sizeof(discordPresence));
discordPresence.largeImageKey = "fb2000";
Expand Down
3 changes: 2 additions & 1 deletion foobar2000/foo_mediacontrol/foo_mediacontrol.vcxproj
Expand Up @@ -88,7 +88,8 @@
<AdditionalIncludeDirectories>$(SolutionDir)..\ATLHelpers\Include</AdditionalIncludeDirectories>
<AdditionalOptions>/ZW:nostdlib /FUplatform.winmd /FUwindows.winmd /Zi /sdl- %(AdditionalOptions)</AdditionalOptions>
<AdditionalUsingDirectories>$(VSInstallDir)\vc\vcpackages;$(WindowsSdkDir)UnionMetadata;%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<CompileAsWinRT>true</CompileAsWinRT>
<CompileAsWinRT>false</CompileAsWinRT>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down
2 changes: 1 addition & 1 deletion foobar2000/foo_mediacontrol/main.cpp
@@ -1,4 +1,4 @@
#include "stdafx.h"

DECLARE_COMPONENT_VERSION("Discord Rich Presences","1.1","Adds the ability for foobar2000 to interact with Discord.");
DECLARE_COMPONENT_VERSION("Discord Rich Presences","1.2","Adds the ability for foobar2000 to interact with Discord.");
VALIDATE_COMPONENT_FILENAME("foo_discord.dll");
2 changes: 0 additions & 2 deletions foobar2000/foo_mediacontrol/track_data.cpp
Expand Up @@ -15,7 +15,6 @@ track_data::track_data(metadb_handle_ptr metadb_data) {

if (container != nullptr) {
const file_info& info = container->info();
m_genres = genre_data_vector();

// populate basic info map
for (track_data_map::iterator it = m_data.begin(); it != m_data.end(); ++it) {
Expand All @@ -35,7 +34,6 @@ track_data::track_data(metadb_handle_ptr metadb_data) {
wchar_t* substring = wcstok_s(genres, genre_separator, &context);

while (substring) {
m_genres.push_back(ref new Platform::String(substring));
substring = wcstok_s(nullptr, genre_separator, &context);
}

Expand Down
9 changes: 1 addition & 8 deletions foobar2000/foo_mediacontrol/track_data.h
Expand Up @@ -7,10 +7,8 @@
#define QUERY_TRACK_NUMBER "track number"

#include <map>
#include <vector>

typedef std::map<const char*, wchar_t*> track_data_map;
typedef std::vector<Platform::String^> genre_data_vector;

class track_data {
public:
Expand Down Expand Up @@ -49,10 +47,6 @@ class track_data {
return m_name;
}

inline genre_data_vector& get_genres() {
return m_genres;
}

inline album_art_data::ptr& get_album_art() {
return m_album_art;
}
Expand All @@ -67,8 +61,7 @@ class track_data {
{ QUERY_ALBUM, empty },
{ QUERY_TRACK_NUMBER, empty }
};

genre_data_vector m_genres;

album_art_data::ptr m_album_art = nullptr;
wchar_t* m_name;

Expand Down
Expand Up @@ -132,6 +132,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
2 changes: 1 addition & 1 deletion foobar2000/helpers/CPowerRequest.h
Expand Up @@ -53,7 +53,7 @@ class CPowerRequestAPI {

static bool IsWin8() {
auto ver = myGetOSVersion();
return ver >= 0x602;
return true;
}
static WORD myGetOSVersion() {
const DWORD ver = GetVersion();
Expand Down
1 change: 1 addition & 0 deletions foobar2000/helpers/foobar2000_sdk_helpers.vcxproj
Expand Up @@ -91,6 +91,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
1 change: 1 addition & 0 deletions pfc/pfc.vcxproj
Expand Up @@ -134,6 +134,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down

0 comments on commit 9d9116b

Please sign in to comment.