mirror of
https://github.com/taglib/taglib.git
synced 2025-05-25 20:20:25 -04:00
Fix compilation on MSVC/Windows
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@777124 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
8cfcb4823f
commit
705fa9d79b
@ -1,6 +1,7 @@
|
||||
if(BUILD_EXAMPLES)
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../taglib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/toolkit
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/ape
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v1
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <tbytevector.h>
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <tlist.h>
|
||||
@ -46,7 +45,11 @@ bool isArgument(const char *s)
|
||||
bool isFile(const char *s)
|
||||
{
|
||||
struct stat st;
|
||||
#ifdef _WIN32
|
||||
return ::stat(s, &st) == 0 && (st.st_mode & (S_IFREG));
|
||||
#else
|
||||
return ::stat(s, &st) == 0 && (st.st_mode & (S_IFREG | S_IFLNK));
|
||||
#endif
|
||||
}
|
||||
|
||||
void usage()
|
||||
|
@ -98,7 +98,7 @@ Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader)
|
||||
// characters. Also make sure that there is data in the frame.
|
||||
|
||||
if(!frameID.size() == (version < 3 ? 3 : 4) ||
|
||||
header->frameSize() <= (header->dataLengthIndicator() ? 4 : 0) ||
|
||||
header->frameSize() <= uint(header->dataLengthIndicator() ? 4 : 0) ||
|
||||
header->frameSize() > data.size())
|
||||
{
|
||||
delete header;
|
||||
|
@ -91,18 +91,23 @@ File::FilePrivate::FilePrivate(FileName fileName) :
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
file = _wfopen(name, L"rb+");
|
||||
if(wcslen((const wchar_t *) fileName) > 0) {
|
||||
|
||||
if(file)
|
||||
readOnly = false;
|
||||
else
|
||||
file = _wfopen(name, L"rb");
|
||||
file = _wfopen(name, L"rb+");
|
||||
|
||||
if(file)
|
||||
return;
|
||||
if(file)
|
||||
readOnly = false;
|
||||
else
|
||||
file = _wfopen(name, L"rb");
|
||||
|
||||
if(file)
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
debug("trying ot use char");
|
||||
file = fopen(name, "rb+");
|
||||
|
||||
if(file)
|
||||
|
Loading…
Reference in New Issue
Block a user