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