diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a7d9efc7..b8dcbd176 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/src/contrib/taglib_plugin/TagReaderTaglib.cpp b/src/contrib/taglib_plugin/TagReaderTaglib.cpp index d910b15c8..1aaf02643 100644 --- a/src/contrib/taglib_plugin/TagReaderTaglib.cpp +++ b/src/contrib/taglib_plugin/TagReaderTaglib.cpp @@ -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 diff --git a/src/core/config.h b/src/core/config.h index e6724dd23..b70ab82b2 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -46,7 +46,7 @@ #include #include - #include "musik_dll_exports.h" + //#include "musik_dll_exports.h" typedef unsigned __int64 UINT64; @@ -74,7 +74,6 @@ typedef unsigned int DBTIME; #include - #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 diff --git a/src/core/filestreams/LocalFileStream.cpp b/src/core/filestreams/LocalFileStream.cpp index 140fc9f75..0609d098f 100644 --- a/src/core/filestreams/LocalFileStream.cpp +++ b/src/core/filestreams/LocalFileStream.cpp @@ -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(*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(*this->fd); + + this->fileStream->exceptions ( std::ios_base::eofbit | std::ios_base::failbit | std::ios_base::badbit ); + return this->file!=NULL; } catch(...){ diff --git a/src/square/ConsoleUI.cpp b/src/square/ConsoleUI.cpp index 47aa9905e..24ae1ff28 100644 --- a/src/square/ConsoleUI.cpp +++ b/src/square/ConsoleUI.cpp @@ -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(" "));