Fixed the last bugs stopping the compilation and linking under VC & CMake.

This commit is contained in:
urioxis 2011-02-24 15:00:44 +00:00
parent 29f4f116fc
commit c55a1fc9fb
5 changed files with 21 additions and 38 deletions

View File

@ -52,6 +52,7 @@ if(WIN32 AND NOT UNIX)
#endif (VLD_FOUND)
add_definitions (
-DUNICODE
-D_UNICODE
)
else(WIN32 AND NOT UNIX)
find_package(Boost 1.42.0 REQUIRED ${BOOST_LIBS})

View File

@ -99,7 +99,7 @@ void TagReaderTaglib::Destroy() {
bool TagReaderTaglib::CanReadTag(const utfchar *extension){
if(extension){
utfstring ext(UTF(extension));
utfstring ext(extension);
boost::algorithm::to_lower(ext); // Convert to lower case

View File

@ -46,7 +46,7 @@
#include <windows.h>
#include <tchar.h>
#include "musik_dll_exports.h"
//#include "musik_dll_exports.h"
typedef unsigned __int64 UINT64;
@ -74,7 +74,6 @@ typedef unsigned int DBTIME;
#include <string>
#ifdef _MSC_VER
//////////////////////////////////////////
@ -92,7 +91,7 @@ typedef unsigned int DBTIME;
///\remarks
///We thought that the _T was a little bit too microsoft specific.
//////////////////////////////////////////
#define UTF(x) L"x"
#define UTF(x) _T(x)
//////////////////////////////////////////
///\brief

View File

@ -69,46 +69,31 @@ LocalFileStream::~LocalFileStream(){
}
bool LocalFileStream::Open(const utfchar *filename,unsigned int options){
#ifdef _DEBUG
std::cerr << "LocalFileStream::Open()" << std::endl;
#endif
if(filename==NULL){
return false;
}
try{
boost::filesystem::utfpath file(UTF(filename));
//#ifdef _DEBUG
// std::cerr << "file: " << file << std::endl;
//#endif
if (!boost::filesystem::exists(file)) {
std::cerr << "File not found" << std::endl;
}
if (!boost::filesystem::is_regular(file)) {
std::cerr << "File not a regular file" << std::endl;
}
boost::filesystem::utfpath file(filename);
if (!boost::filesystem::exists(file)) {
std::cerr << "File not found" << std::endl;
}
if (!boost::filesystem::is_regular(file)) {
std::cerr << "File not a regular file" << std::endl;
}
this->filesize = (long)boost::filesystem::file_size(file);
//#ifdef _DEBUG
// std::cerr << "filesize: " << this->filesize << std::endl;
//#endif
this->extension = file.extension();
//#ifdef _DEBUG
// std::cerr << "extension: " << this->extension << std::endl;
//#endif
this->file = UTFFopen(filename,UTF("rb"));
//#ifdef _DEBUG
// std::cerr << "this->file: " << this->file << std::endl;
//#endif
this->file = UTFFopen(filename,UTF("rb"));
this->fd = new boost::iostreams::file_descriptor(file);
//#ifdef _DEBUG
// std::cerr << "fd: " << this->fd << std::endl;
//#endif
this->fileStream = new boost::iostreams::stream<boost::iostreams::file_descriptor>(*this->fd);
//#ifdef _DEBUG
// std::cerr << "this->fileStream: " << this->fileStream << std::endl;
//#endif
this->fileStream->exceptions ( std::ios_base::eofbit | std::ios_base::failbit | std::ios_base::badbit );
return this->file!=NULL;
this->fileStream = new boost::iostreams::stream<boost::iostreams::file_descriptor>(*this->fd);
this->fileStream->exceptions ( std::ios_base::eofbit | std::ios_base::failbit | std::ios_base::badbit );
return this->file!=NULL;
}
catch(...){

View File

@ -110,8 +110,6 @@ void ConsoleUI::PrintCommands()
void ConsoleUI::ProcessCommand(utfstring commandString)
{
//using namespace boost::algorithm;
Args args;
boost::algorithm::split(args, commandString, boost::is_any_of(" "));