Skip to content

Commit

Permalink
Fixed the last bugs stopping the compilation and linking under VC & C…
Browse files Browse the repository at this point in the history
…Make.
  • Loading branch information
urioxis committed Feb 24, 2011
1 parent 29f4f11 commit c55a1fc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 38 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion src/contrib/taglib_plugin/TagReaderTaglib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions src/core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include <windows.h>
#include <tchar.h>

#include "musik_dll_exports.h"
//#include "musik_dll_exports.h"

typedef unsigned __int64 UINT64;

Expand Down Expand Up @@ -74,7 +74,6 @@ typedef unsigned int DBTIME;

#include <string>


#ifdef _MSC_VER

//////////////////////////////////////////
Expand All @@ -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
Expand Down
49 changes: 17 additions & 32 deletions src/core/filestreams/LocalFileStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(...){
Expand Down
2 changes: 0 additions & 2 deletions src/square/ConsoleUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(" "));
Expand Down

0 comments on commit c55a1fc

Please sign in to comment.