mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-29 12:32:36 +00:00
Over a quarter of the core now compiles on linux :)
Jooles
This commit is contained in:
parent
9c7159776a
commit
aec9230767
@ -1,3 +1,4 @@
|
|||||||
|
cmake_minimum_required(VERSION 2.6)
|
||||||
project( core )
|
project( core )
|
||||||
|
|
||||||
SET (CMAKE_BUILD_TYPE DEBUG)
|
SET (CMAKE_BUILD_TYPE DEBUG)
|
||||||
@ -71,6 +72,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
|||||||
if(NOT DEFINED MINGW)
|
if(NOT DEFINED MINGW)
|
||||||
SET(SOURCES ${SOURCES} ${WINDOWS_EXTRAS})
|
SET(SOURCES ${SOURCES} ${WINDOWS_EXTRAS})
|
||||||
endif(NOT DEFINED MINGW)
|
endif(NOT DEFINED MINGW)
|
||||||
|
else(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fpermissive)
|
||||||
endif(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
endif(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
@ -86,5 +89,5 @@ add_definitions(
|
|||||||
-D_DEBUG
|
-D_DEBUG
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library( core STATIC ${SOURCES} )
|
add_library( core SHARED ${SOURCES} )
|
||||||
|
|
||||||
|
@ -113,11 +113,15 @@ utfstring musik::core::GetDataDirectory(){
|
|||||||
///String with path.
|
///String with path.
|
||||||
//////////////////////////////////////////
|
//////////////////////////////////////////
|
||||||
utfstring musik::core::GetPath(const utfstring &sFile){
|
utfstring musik::core::GetPath(const utfstring &sFile){
|
||||||
|
|
||||||
utfstring sPath;
|
utfstring sPath;
|
||||||
|
int iStrLength;
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
|
||||||
utfchar szPath[2048];
|
utfchar szPath[2048];
|
||||||
utfchar *szFile=NULL;
|
utfchar *szFile=NULL;
|
||||||
int iStrLength = GetFullPathName(sFile.c_str(),2048,szPath,&szFile);
|
iStrLength = GetFullPathName(sFile.c_str(),2048,szPath,&szFile);
|
||||||
if(iStrLength!=0 && iStrLength<2048 ){
|
if(iStrLength!=0 && iStrLength<2048 ){
|
||||||
sPath.assign(szPath);
|
sPath.assign(szPath);
|
||||||
if(szFile!=0){
|
if(szFile!=0){
|
||||||
@ -127,7 +131,11 @@ utfstring musik::core::GetPath(const utfstring &sFile){
|
|||||||
}else{
|
}else{
|
||||||
sPath.assign(sFile);
|
sPath.assign(sFile);
|
||||||
}
|
}
|
||||||
|
#else //TODO: check this POSIX GetPath works
|
||||||
|
utfchar* szDir;
|
||||||
|
sPath.assign(getcwd((char*)szDir, (size_t) iStrLength));
|
||||||
|
|
||||||
|
#endif //WIN32
|
||||||
return sPath;
|
return sPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,4 +85,3 @@ namespace musik{ namespace core{
|
|||||||
#define UTF16_TO_UTF(s) musik::core::ConvertUTF8(s)
|
#define UTF16_TO_UTF(s) musik::core::ConvertUTF8(s)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -44,6 +44,10 @@
|
|||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#endif //WIN32
|
||||||
|
|
||||||
namespace musik{ namespace core{
|
namespace musik{ namespace core{
|
||||||
|
|
||||||
class PluginFactory{
|
class PluginFactory{
|
||||||
@ -92,7 +96,7 @@ namespace musik{ namespace core{
|
|||||||
template <class T, class D> std::vector< boost::shared_ptr<T> > QueryInterface(const char* functionName){
|
template <class T, class D> std::vector< boost::shared_ptr<T> > QueryInterface(const char* functionName){
|
||||||
boost::mutex::scoped_lock lock(this->mutex);
|
boost::mutex::scoped_lock lock(this->mutex);
|
||||||
|
|
||||||
typedef T* (__stdcall* PluginInterfaceCall)();
|
typedef T* STDCALL((* PluginInterfaceCall)());
|
||||||
|
|
||||||
std::vector< boost::shared_ptr<T> > plugins;
|
std::vector< boost::shared_ptr<T> > plugins;
|
||||||
HandleList& allDlls = PluginFactory::sInstance.loadedDLLs;
|
HandleList& allDlls = PluginFactory::sInstance.loadedDLLs;
|
||||||
@ -100,9 +104,13 @@ namespace musik{ namespace core{
|
|||||||
typedef HandleList::iterator Iterator;
|
typedef HandleList::iterator Iterator;
|
||||||
Iterator currentDll = allDlls.begin();
|
Iterator currentDll = allDlls.begin();
|
||||||
while (currentDll != allDlls.end()){
|
while (currentDll != allDlls.end()){
|
||||||
PluginInterfaceCall funcPtr =
|
|
||||||
(PluginInterfaceCall) GetProcAddress((HMODULE)(*currentDll), functionName);
|
|
||||||
|
|
||||||
|
PluginInterfaceCall funcPtr =
|
||||||
|
#ifdef WIN32
|
||||||
|
(PluginInterfaceCall) GetProcAddress((HMODULE)(*currentDll), functionName);
|
||||||
|
#else
|
||||||
|
(PluginInterfaceCall) dlsym(*currentDll, functionName);
|
||||||
|
#endif //WIN32
|
||||||
if(funcPtr) {
|
if(funcPtr) {
|
||||||
T* result = funcPtr();
|
T* result = funcPtr();
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
|
|
||||||
#include <core/Query/Base.h>
|
#include <core/Query/Base.h>
|
||||||
#include <core/Library/Base.h>
|
#include <core/Library/Base.h>
|
||||||
|
@ -137,9 +137,10 @@ class Base : public sigslot::has_slots<> {
|
|||||||
unsigned int options;
|
unsigned int options;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class Library::Base;
|
/*friend class Library::Base;
|
||||||
friend class Library::LocalDB;
|
friend class Library::LocalDB;
|
||||||
friend class server::Connection;
|
friend class server::Connection;*/
|
||||||
|
//Friended twice - throwing up lots of warnings
|
||||||
|
|
||||||
// Methods:
|
// Methods:
|
||||||
virtual std::string Name();
|
virtual std::string Name();
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
// POSSIBILITY OF SUCH DAMAGE.
|
// POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/Query/Factory.h>
|
#include <core/Query/Factory.h>
|
||||||
|
|
||||||
#include <core/Query/ListSelection.h>
|
#include <core/Query/ListSelection.h>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/Query/ListBase.h>
|
#include <core/Query/ListBase.h>
|
||||||
#include <core/Library/Base.h>
|
#include <core/Library/Base.h>
|
||||||
#include <core/Common.h>
|
#include <core/Common.h>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/Query/ListSelection.h>
|
#include <core/Query/ListSelection.h>
|
||||||
#include <core/Library/Base.h>
|
#include <core/Library/Base.h>
|
||||||
#include <core/xml/ParserNode.h>
|
#include <core/xml/ParserNode.h>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/Query/PlaylistLoad.h>
|
#include <core/Query/PlaylistLoad.h>
|
||||||
#include <core/Library/Base.h>
|
#include <core/Library/Base.h>
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/Query/PlaylistSave.h>
|
#include <core/Query/PlaylistSave.h>
|
||||||
#include <core/Library/Base.h>
|
#include <core/Library/Base.h>
|
||||||
#include <core/LibraryTrack.h>
|
#include <core/LibraryTrack.h>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/Query/Playlists.h>
|
#include <core/Query/Playlists.h>
|
||||||
#include <core/Library/Base.h>
|
#include <core/Library/Base.h>
|
||||||
#include <core/tracklist/Playlist.h>
|
#include <core/tracklist/Playlist.h>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/Query/SortTracks.h>
|
#include <core/Query/SortTracks.h>
|
||||||
#include <core/Library/Base.h>
|
#include <core/Library/Base.h>
|
||||||
#include <core/config_format.h>
|
#include <core/config_format.h>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/Query/SortTracksWithData.h>
|
#include <core/Query/SortTracksWithData.h>
|
||||||
#include <core/Library/Base.h>
|
#include <core/Library/Base.h>
|
||||||
#include <core/config_format.h>
|
#include <core/config_format.h>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
|
|
||||||
#include <core/Common.h>
|
#include <core/Common.h>
|
||||||
#include <core/Query/TrackMetadata.h>
|
#include <core/Query/TrackMetadata.h>
|
||||||
|
@ -54,9 +54,12 @@
|
|||||||
#endif
|
#endif
|
||||||
typedef unsigned __int64 UINT64;
|
typedef unsigned __int64 UINT64;
|
||||||
|
|
||||||
|
#define STDCALL(fp) __stdcall fp
|
||||||
#else
|
#else
|
||||||
typedef unsigned long long UINT64;
|
typedef unsigned long long UINT64;
|
||||||
typedef long long __int64; //TODO: Is this necessary?
|
typedef long long __int64; //TODO: Is this necessary?
|
||||||
|
|
||||||
|
#define STDCALL(fp) fp __attribute__((stdcall))
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/tracklist/Base.h>
|
#include <core/tracklist/Base.h>
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/tracklist/LibraryList.h>
|
#include <core/tracklist/LibraryList.h>
|
||||||
#include <core/LibraryTrack.h>
|
#include <core/LibraryTrack.h>
|
||||||
#include <core/Query/SortTracks.h>
|
#include <core/Query/SortTracks.h>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "pch.hpp"
|
#include "../pch.hpp"
|
||||||
#include <core/tracklist/MultiLibraryList.h>
|
#include <core/tracklist/MultiLibraryList.h>
|
||||||
#include <core/LibraryTrack.h>
|
#include <core/LibraryTrack.h>
|
||||||
#include <core/LibraryFactory.h>
|
#include <core/LibraryFactory.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user