" :
"
" );
articleBody.append( "
" );
diff --git a/mouseover.cc b/mouseover.cc
index ed634064..df2826e1 100644
--- a/mouseover.cc
+++ b/mouseover.cc
@@ -25,16 +25,16 @@ MouseOver & MouseOver::instance()
#ifdef Q_OS_WIN32
const UINT WM_MY_SHOW_TRANSLATION = WM_USER + 301;
static wchar_t className[] = L"GoldenDictMouseover";
-typedef BOOL WINAPI ( *ChangeWindowMessageFilterFunc )( UINT, DWORD );
+typedef BOOL ( WINAPI *ChangeWindowMessageFilterFunc )( UINT, DWORD );
-#ifndef CHANGEFILTERSTRUCT
+#ifndef WINAPI_FAMILY
typedef struct tagCHANGEFILTERSTRUCT {
DWORD cbSize;
DWORD ExtStatus;
} CHANGEFILTERSTRUCT, *PCHANGEFILTERSTRUCT;
#endif
-typedef BOOL WINAPI ( *ChangeWindowMessageFilterExFunc )( HWND, UINT, DWORD, PCHANGEFILTERSTRUCT );
+typedef BOOL ( WINAPI *ChangeWindowMessageFilterExFunc )( HWND, UINT, DWORD, PCHANGEFILTERSTRUCT );
#endif // Q_OS_WIN32
diff --git a/termination.cc b/termination.cc
index c01c6787..0828bdf6 100644
--- a/termination.cc
+++ b/termination.cc
@@ -4,7 +4,11 @@
#include "termination.hh"
#include
#include
+
+#ifndef _MSC_VER
#include
+#endif
+
#include
#ifndef __WIN32
@@ -28,13 +32,24 @@ static void termHandler()
char * function = 0;
size_t functionLength = 0;
+#ifdef _MSC_VER
+ std::type_info * ti = 0;
+#else
std::type_info * ti = __cxxabiv1::__cxa_current_exception_type();
+#endif
if ( ti )
{
char const * name = ti->name();
+#ifdef _MSC_VER
+ char * ret = 0;
+ // avoid 'unused' warnings
+ (void) status;
+ (void) functionLength;
+#else
char * ret = abi::__cxa_demangle( name, function, &functionLength, &status );
+#endif
if ( ret )
{
diff --git a/ufile.cc b/ufile.cc
index 71145c84..c78079ee 100644
--- a/ufile.cc
+++ b/ufile.cc
@@ -1,6 +1,7 @@
#ifdef __WIN32
#include
+#include
#include
#include
diff --git a/ufile.hh b/ufile.hh
index 36dc12e8..a7a9d3d4 100644
--- a/ufile.hh
+++ b/ufile.hh
@@ -5,6 +5,11 @@
#include "zlib.h"
+// eliminate some VC++ warnings
+#ifdef _MSC_VER
+#define fileno _fileno
+#endif
+
#ifdef __cplusplus
extern "C"
{
diff --git a/utf8.cc b/utf8.cc
index d5151b7d..9d8e66dc 100644
--- a/utf8.cc
+++ b/utf8.cc
@@ -141,6 +141,10 @@ string encode( wstring const & in ) throw()
wstring decode( string const & in ) throw( exCantDecode )
{
+
+ if ( in.size() == 0 )
+ return wstring();
+
std::vector< wchar > buffer( in.size() );
long result = decode( in.data(), in.size(), &buffer.front() );
diff --git a/winlibs/lib/msvc b/winlibs/lib/msvc
new file mode 160000
index 00000000..36a76110
--- /dev/null
+++ b/winlibs/lib/msvc
@@ -0,0 +1 @@
+Subproject commit 36a7611087f93eae4f645bbae6b8a71b3c8c986f
diff --git a/wordbyauto.cc b/wordbyauto.cc
index bc20309d..c56b415f 100644
--- a/wordbyauto.cc
+++ b/wordbyauto.cc
@@ -1,6 +1,5 @@
#include
#include
-#include
#include "wordbyauto.hh"
#include "uiauto.hh"
@@ -12,7 +11,7 @@ public:
GDAutomationClient();
~GDAutomationClient();
bool getWordAtPoint( POINT pt );
- WCHAR *getText() { return buffer; };
+ WCHAR *getText() { return buffer; }
private:
WCHAR buffer[256];
IUIAutomation *pGDAutomation;
diff --git a/xdxf.cc b/xdxf.cc
index b8814155..4735b9b6 100644
--- a/xdxf.cc
+++ b/xdxf.cc
@@ -25,6 +25,10 @@
#include "indexedzip.hh"
#include "filetype.hh"
+#ifdef _MSC_VER
+#include
+#endif
+
#include
#include
#include
@@ -96,7 +100,11 @@ struct IdxHeader
// resource index.
uint32_t zipIndexRootOffset;
uint32_t revisionNumber; // Format revision
-} __attribute__((packed));
+}
+#ifndef _MSC_VER
+__attribute__((packed))
+#endif
+;
bool indexIsOldOrBad( string const & indexFile )
{
diff --git a/zipfile.cc b/zipfile.cc
index 397a111c..7c4f1562 100644
--- a/zipfile.cc
+++ b/zipfile.cc
@@ -16,7 +16,11 @@ struct EndOfCdirRecord
quint16 numDisk, numDiskCd, totalEntriesDisk, totalEntries;
quint32 size, offset;
quint16 commentLength;
-} __attribute__((packed));
+}
+#ifndef _MSC_VER
+__attribute__((packed))
+#endif
+;
struct CentralFileHeaderRecord
{
@@ -26,7 +30,11 @@ struct CentralFileHeaderRecord
quint16 fileNameLength, extraFieldLength, fileCommentLength, diskNumberStart,
intFileAttrs;
quint32 externalFileAttrs, offsetOfLocalHeader;
-} __attribute__((packed));
+}
+#ifndef _MSC_VER
+__attribute__((packed))
+#endif
+;
struct LocalFileHeaderRecord
{
@@ -34,7 +42,11 @@ struct LocalFileHeaderRecord
quint16 verNeeded, gpBits, compressionMethod, fileTime, fileDate;
quint32 crc32, compressedSize, uncompressedSize;
quint16 fileNameLength, extraFieldLength;
-} __attribute__((packed));
+}
+#ifndef _MSC_VER
+__attribute__((packed))
+#endif
+;
#pragma pack( pop )