Only show SSE2 warning in debug build

This commit is contained in:
Zane U. Ji 2019-11-24 08:57:49 +08:00
parent 740e8a1927
commit 67d2210bdc
5 changed files with 1082 additions and 1120 deletions

View File

@ -1,6 +1,7 @@
# Version number followed by the release date # Version number followed by the release date
1.2.1.5 1.2.1.5
* Only show SSE2 warning in debug build
* Bug #228 Misleading translation when file was changed externally, may lead to data loss * Bug #228 Misleading translation when file was changed externally, may lead to data loss
* Bug #227 Dead Link: Help > Forum * Bug #227 Dead Link: Help > Forum
* Bug #221 Patch for building with C++11 (Roger Leigh) * Bug #221 Patch for building with C++11 (Roger Leigh)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -807,7 +807,9 @@ MyFrame::MyFrame (
lastSymbol = config->Read( _T( "lastSymbol" ), _T ( "*" ) ); lastSymbol = config->Read( _T( "lastSymbol" ), _T ( "*" ) );
#if defined(XERCES_HAVE_SSE2_INTRINSIC) && defined(__WXDEBUG__)
xercescSSE2Warning = config->Read ( _T ( "xercescSSE2Warning" ), true ); xercescSSE2Warning = config->Read ( _T ( "xercescSSE2Warning" ), true );
#endif
} }
else // config not found else // config not found
{ {
@ -858,7 +860,10 @@ MyFrame::MyFrame (
exportEpub = exportRtf = exportDoc = exportFullDaisy = true; exportEpub = exportRtf = exportDoc = exportFullDaisy = true;
lastSymbol = _T( "*" ); lastSymbol = _T( "*" );
#if defined(XERCES_HAVE_SSE2_INTRINSIC) && defined(__WXDEBUG__)
xercescSSE2Warning = true; xercescSSE2Warning = true;
#endif
} }
largeFileProperties.completion = false; largeFileProperties.completion = false;
@ -888,24 +893,23 @@ MyFrame::MyFrame (
// Initialize Xerces-C++ // Initialize Xerces-C++
WrapXerces::Init ( libxmlNetAccess ); WrapXerces::Init ( libxmlNetAccess );
#if _XERCES_VERSION >= 30100 && wxDEBUG_LEVEL > 0 #if defined(XERCES_HAVE_SSE2_INTRINSIC) && defined(__WXDEBUG__)
if ( XMLPlatformUtils::fgSSE2ok if ( xercescSSE2Warning && wxTheApp->argc == 1 )
&& xercescSSE2Warning
&& wxTheApp->argc == 1 )
{ {
xercescSSE2Warning = wxMessageBox ( xercescSSE2Warning = wxMessageBox (
_ ("SSE2 is enabled in Xerces-C++ library. Xerces-C++ didn't "\ _ ("SSE2 is enabled in Xerces-C++ library. SSE2 should be "\
"use them in a thread-safe way. It may cause program crashes "\ "checked at run time rather than compile time. The program " \
"(segmentation faults).\n\n"\ "may crash (segmentation fault) on a machine that " \
"doesn't support SSE2.\n\n"\
"If it happens, please try compiling Xerces-C++ with SSE2 "\ "If it happens, please try compiling Xerces-C++ with SSE2 "\
"disabled.\n\n"\ "disabled.\n\n"\
"OK:\tShow this warning next time\n"\ "OK:\tShow this warning next time\n"\
"Cancel:\tDisable the warning\n"), "Cancel:\tDisable the warning\n"),
_ ("SSE2 problem in Xerces-C++"), _ ("SSE2 is checked at compile time"),
wxOK | wxCANCEL | wxICON_WARNING wxOK | wxCANCEL | wxICON_WARNING
) == wxOK; ) == wxOK;
} }
#endif // _XERCES_VERSION >= 30101 #endif // XERCES_HAVE_SSE2_INTRINSIC
size_t findFlags = 0; size_t findFlags = 0;
findFlags |= wxFR_DOWN; findFlags |= wxFR_DOWN;
@ -1165,7 +1169,10 @@ MyFrame::~MyFrame()
config->Write ( _T ( "unlimitedUndo" ), unlimitedUndo ); config->Write ( _T ( "unlimitedUndo" ), unlimitedUndo );
config->Write ( _T ( "lastSymbol" ), lastSymbol ); config->Write ( _T ( "lastSymbol" ), lastSymbol );
#if defined(XERCES_HAVE_SSE2_INTRINSIC) && defined(__WXDEBUG__)
config->Write ( _T ( "xercescSSE2Warning" ), xercescSSE2Warning ); config->Write ( _T ( "xercescSSE2Warning" ), xercescSSE2Warning );
#endif
manager.UnInit(); manager.UnInit();
wxTheClipboard->Flush(); wxTheClipboard->Flush();

View File

@ -60,6 +60,7 @@
#include "myhtmlpane.h" #include "myhtmlpane.h"
#include "xmlencodinghandler.h" #include "xmlencodinghandler.h"
#include <wx/aui/framemanager.h> #include <wx/aui/framemanager.h>
#include <xercesc/util/XercesDefs.hpp>
enum enum
{ {
@ -483,6 +484,9 @@ class MyFrame : public wxFrame
showFullPathOnFrame, showFullPathOnFrame,
findRegex, findRegex,
commandSync, commandSync,
#if defined(XERCES_HAVE_SSE2_INTRINSIC) && defined(__WXDEBUG__)
xercescSSE2Warning,
#endif
exportQuiet, exportQuiet,
exportMp3Album, exportMp3Album,
exportSuppressOptional, exportSuppressOptional,
@ -490,8 +494,7 @@ class MyFrame : public wxFrame
exportEpub, exportEpub,
exportRtf, exportRtf,
exportDoc, exportDoc,
exportFullDaisy, exportFullDaisy;
xercescSSE2Warning;
wxBitmap newBitmap, wxBitmap newBitmap,
new16Bitmap, new16Bitmap,
openBitmap, openBitmap,