Fixed clangen/cmakeosx to compile and run against Windows.

This commit is contained in:
casey 2016-05-27 18:10:41 -07:00
parent 8d3d24c5e6
commit a64ccf16a6
10 changed files with 57 additions and 36 deletions

View File

@ -36,20 +36,37 @@
#include "TaglibMetadataReader.h"
#include <taglib/tlist.h>
#include <taglib/tfile.h>
#include <taglib/tag.h>
#include <taglib/fileref.h>
#include <taglib/audioproperties.h>
#include <taglib/mpegfile.h>
#include <taglib/id3v1tag.h>
#include <taglib/id3v1genres.h>
#include <taglib/id3v2tag.h>
#include <taglib/id3v2header.h>
#include <taglib/id3v2frame.h>
#include <taglib/attachedpictureframe.h>
#include <taglib/commentsframe.h>
#include <taglib/oggfile.h>
#ifdef WIN32
#include <taglib/toolkit/tlist.h>
#include <taglib/toolkit/tfile.h>
#include <taglib/tag.h>
#include <taglib/fileref.h>
#include <taglib/audioproperties.h>
#include <taglib/mpeg/mpegfile.h>
#include <taglib/mpeg/id3v1/id3v1tag.h>
#include <taglib/mpeg/id3v1/id3v1genres.h>
#include <taglib/mpeg/id3v2/id3v2tag.h>
#include <taglib/mpeg/id3v2/id3v2header.h>
#include <taglib/mpeg/id3v2/id3v2frame.h>
#include <taglib/mpeg/id3v2/frames/attachedpictureframe.h>
#include <taglib/mpeg/id3v2/frames/commentsframe.h>
#include <taglib/ogg/oggfile.h>
#else
#include <taglib/tlist.h>
#include <taglib/tfile.h>
#include <taglib/tag.h>
#include <taglib/fileref.h>
#include <taglib/audioproperties.h>
#include <taglib/mpegfile.h>
#include <taglib/id3v1tag.h>
#include <taglib/id3v1genres.h>
#include <taglib/id3v2tag.h>
#include <taglib/id3v2header.h>
#include <taglib/id3v2frame.h>
#include <taglib/attachedpictureframe.h>
#include <taglib/commentsframe.h>
#include <taglib/oggfile.h>
#endif
#include <vector>
#include <string>

View File

@ -38,21 +38,21 @@
#include "stdafx.h"
#ifndef _HAVE_TAGLIB
#include <taglib/tlist.h>
#include <taglib/tfile.h>
#include <taglib/tag.h>
#include <taglib/fileref.h>
#include <taglib/audioproperties.h>
#include <taglib/id3v2tag.h>
#else //_HAVE_TAGLIB
#include <taglib/tlist.h>
#include <taglib/tfile.h>
#include <taglib/tag.h>
#include <taglib/fileref.h>
#include <taglib/audioproperties.h>
#include <taglib/id3v2tag.h>
#endif //_HAVE_TAGLIB
#ifdef WIN32
#include <taglib/toolkit/tlist.h>
#include <taglib/toolkit/tfile.h>
#include <taglib/tag.h>
#include <taglib/fileref.h>
#include <taglib/audioproperties.h>
#include <taglib/mpeg/id3v2/id3v2tag.h>
#else
#include <taglib/tlist.h>
#include <taglib/tfile.h>
#include <taglib/tag.h>
#include <taglib/fileref.h>
#include <taglib/audioproperties.h>
#include <taglib/id3v2tag.h>
#endif
#include <set>
#include <core/sdk/IMetadataReader.h>

View File

@ -40,6 +40,7 @@
#define WIN32_LEAN_AND_MEAN
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#define NOMINMAX
#include <windows.h>
#include <tchar.h>

View File

@ -40,7 +40,10 @@
#include <utf8/utf8.h>
#include <cstdlib>
#include <iostream>
#ifdef __APPLE__
#include <mach-o/dyld.h>
#endif
std::string musik::core::GetPluginDirectory() {
std::string path(GetApplicationDirectory());

View File

@ -139,7 +139,7 @@ double WindowsSystemInfo::GetCpuUsage() {
(double) (user.QuadPart - lastUserCpu.QuadPart);
ULONGLONG diff = now.QuadPart - lastCpu.QuadPart;
diff = max(1, diff);
diff = std::max((ULONGLONG) 1, diff);
percent /= diff;
percent /= processorCount;

View File

@ -20,9 +20,9 @@ namespace musik {
}
catch (...) {
/* invalid encoding, just treat as a single char */
++it;
}
++it;
++c;
}

View File

@ -73,7 +73,7 @@ void removeUtf8Char(std::string& value) {
}
void CommandWindow::Write(const std::string& key) {
if (key == "KEY_BACKSPACE" || key == "^?") { /* backspace */
if (key == "^H" || key == "^?") { /* backspace */
removeUtf8Char(this->buffer);
}
else if (key == "^J") { /* return */

View File

@ -25,7 +25,7 @@ void ListWindow::ScrollToTop() {
void ListWindow::ScrollToBottom() {
IScrollAdapter& adapter = this->GetScrollAdapter();
this->SetSelectedIndex(std::max(0UL, adapter.GetEntryCount() - 1));
this->SetSelectedIndex(std::max((size_t) 0, adapter.GetEntryCount() - 1));
adapter.DrawPage(this->GetContent(), selectedIndex, &scrollPosition);
this->Repaint();
}

View File

@ -14,7 +14,7 @@ MultiLineEntry::MultiLineEntry(const std::string& value, int64 attrs) {
}
size_t MultiLineEntry::GetLineCount() {
return std::max(1UL, this->lines.size());
return std::max((size_t) 1, this->lines.size());
}
std::string MultiLineEntry::GetLine(size_t n) {

View File

@ -59,7 +59,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>./;../;../3rdparty/include;../../../boost_1_60_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>./;../;../3rdparty/include;../3rdparty/win32_include;../../../boost_1_60_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@ -88,7 +88,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>./;../;../3rdparty/include;../../../boost_1_60_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>./;../;../3rdparty/include;../3rdparty/win32_include;../../../boost_1_60_0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>