From bd9983bc634cf12420e9518afdc5bbb9cc2c38ee Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 23 Feb 2020 19:42:57 +0000 Subject: [PATCH] upp.src: llvm-mingw fixes git-svn-id: svn://ultimatepp.org/upp/trunk@14068 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Value.hpp | 2 +- uppsrc/Core/mathutil.cpp | 4 +- uppsrc/CtrlCore/CtrlCore.upp | 1 - uppsrc/CtrlCore/ToDo.txt | 122 --------------------------- uppsrc/ide/Builders/GccBuilder.cpp | 20 +++-- uppsrc/ide/Debug.cpp | 30 ++----- uppsrc/ide/Debuggers/Debuggers.upp | 2 +- uppsrc/plugin/ndisasm/lib/compiler.h | 3 - uppsrc/plugin/ndisasm/ndisasm.upp | 3 - uppsrc/plugin/tif/lib/tif_fax3sm.c | 2 +- 10 files changed, 24 insertions(+), 165 deletions(-) delete mode 100644 uppsrc/CtrlCore/ToDo.txt diff --git a/uppsrc/Core/Value.hpp b/uppsrc/Core/Value.hpp index 0dd8ecb9e..03330c7d6 100644 --- a/uppsrc/Core/Value.hpp +++ b/uppsrc/Core/Value.hpp @@ -100,7 +100,7 @@ inline unsigned ValueGetHashValue(const int& x) { template<> inline unsigned ValueGetHashValue(const double& x) { - if(x >= INT64_MIN && x <= INT64_MAX && (int64)x == x) + if(x >= (double)INT64_MIN && x <= (double)INT64_MAX && (int64)x == x) return UPP::GetHashValue((int64)x); return UPP::GetHashValue(x); } diff --git a/uppsrc/Core/mathutil.cpp b/uppsrc/Core/mathutil.cpp index b36cc5a8b..3e6aaff90 100644 --- a/uppsrc/Core/mathutil.cpp +++ b/uppsrc/Core/mathutil.cpp @@ -128,7 +128,7 @@ int fceil(double value) int64 fround64(double value) { - return value >= INT64_MAX ? INT64_MAX : value <= INT64_MIN ? INT64_MIN + return value >= (double)INT64_MAX ? INT64_MAX : value <= (double)INT64_MIN ? INT64_MIN : (int64)floor(value + 0.5); } @@ -136,7 +136,7 @@ int64 fround64(double value) int64 ffloor64(double value) { - return value >= INT64_MAX ? INT64_MAX : value <= INT64_MIN ? INT64_MIN + return value >= (double)INT64_MAX ? INT64_MAX : value <= (double)INT64_MIN ? INT64_MIN : (int64)floor(value); } diff --git a/uppsrc/CtrlCore/CtrlCore.upp b/uppsrc/CtrlCore/CtrlCore.upp index 562e1d5f4..b6d7ca268 100644 --- a/uppsrc/CtrlCore/CtrlCore.upp +++ b/uppsrc/CtrlCore/CtrlCore.upp @@ -18,7 +18,6 @@ pkg_config((LINUX | FREEBSD) !X11) "gtk+-3.0 libnotify"; file Core readonly separator, - ToDo.txt, CtrlCore.h options(BUILDER_OPTION) PCH, MKeys.h, stdids.h, diff --git a/uppsrc/CtrlCore/ToDo.txt b/uppsrc/CtrlCore/ToDo.txt deleted file mode 100644 index 47673e64c..000000000 --- a/uppsrc/CtrlCore/ToDo.txt +++ /dev/null @@ -1,122 +0,0 @@ -- MacOS crash when adding Label to TestChStyles -- Mingw: Make things run with F5 even in release mode, "Failed to obtain" should only be shown when debugger stops and even then things should work -- Mingw: Release mode theide crash, symptom missing doc points -- Mingw compiled theide, TestChStyle, breakpoint 699 ChWin32.cpp - no info about local variables (also in Console, seems consistent) - -NTH: - - -DONE: - -- Remove ClassicCtrls, AmbientCtrls -- usc columnlist -- usc color pusher -- UHD tree [-] [+] -- InsetFrame vs DefaultFrame -- LayDes .usc: Small defect in slider thumb in SD mode -- Laydes Rect is still to aggresive -- Vertical centering of DropList text is a bit off -- Win32 - always use dark mode, always use UHD -- Some problem when switching skin should be solved -- Win32 menu checkbox -- Classic is broken -- ClassicCtrlsImg -- Ide: When dark editor in light theme, svn history is invisible (as text is white) -- Unknown layout type should have better visual -- LayDes menu background color -- usc treectrl - -macos done: - -- Make allocator work -- Inactive doc icon is not updated - [B] does not blink anymore -- TestChStyle problem with EditDate drop (needs one more click) -- FileChooser -- Slider in dark mode is transparent -- spin buttons slight visual problem in dark mode -- <-|-> cursor looks bad in dark mode -- Standard visual glitches in dark theme -- Option box focus issue -- Remove menu slide effect -- U++ menu has some issues - -gtk3 DONE: - -- Resizing delay -- Refresh issue -- Test & Fix filesel & fileselector -- Combobox push is weird -- right scrollbar -- Test grip resize -- toolbar button highlight -- correct checks in menu -- uword cannot be resized smaller -- Scrollbar margins (better fit for slider)i -- Scrollbar Correct minsize, barsize... -- FileSelector -- Mint-Y disabled color is wrong -- Mint-Y tooltip color is wrong -- .iml cursors in UHD are wrong (e.g. header <-|->) -- cxZ Uword - wrong caret -- Combobox appearance issues (minor, round corners broken on the left) -- spinbuttons in UWord -- read-only dropchoice left colorGUI -- ColorPopup background -- Fix IsPainting -- Header synthetise -- Resizing fix black -- Slider thumb -- Remove DDUMPs -- TabBar synthetise -- Problem with theide menu -- LabelBox -- GtkStyleBool("has-backward-stepper") -- DropChoice read only active edge -- Scale must not be same as UHD -- makefile pkg-config support -- Test with 3.8 -- TraditionalOk ugly scrollbars (centre image) -- Blue Menta ugly scrollbars (round) -- CleanTheme for X11 -- libgtk-3-dev to buildrequires -- Test dark theme -- Test rect theme -- Check FileSel -- a lot of work in Redmond -- check CtrlCore/Ctrl.tpp -- tooltip issue -- test DateTimeCtrl in dark mode -- 3.8 theme -- PopupInfo issue -- FileSel icons for Video etc -- ColumnList selected item background (Mint-X) -- disabled color in Breeze-Dark -- Problem with hot3 in scrollbar horizontal (check in SD) -- Problem with radio buttons in StdStyle - perhaps too big? -- OpenGL -- GtkWnd warnings -- GtkDnD warnings -- DnD Sample size UHD -- ide menu in X11 ch -- TrayIconGtk warnings -- Disabled empty combobox (FileSel::SelectDir) does not look nice -- Error state (red) EditField cosmetics -- Pushbutton push does not look nice -- DropChoice::Error problem -- DarkCold: problem slight problem with scrollbars -- Improve scrollbars button borders -- Scrollbars disabled monocolor -- spinbutton cosmetics -- ide missing vertical line -- DropChoice STDSIZE (.TopPosZ(10)) -- LeftRoundness with DropChoice (DropChoiceRdO) -- Improve progress? -- EditDate / EditTime problems -- Ide split buttons look unexpected -- Issue with editfield text clipping in the right -- Possible issue with Capture (e.g. ide about box) -- WithDropChoice ch issue (again...) -- Problem with multibutton is back again -- Redmond scrollbars width -- Improve focus visuals - diff --git a/uppsrc/ide/Builders/GccBuilder.cpp b/uppsrc/ide/Builders/GccBuilder.cpp index e95278bf1..e45559e92 100644 --- a/uppsrc/ide/Builders/GccBuilder.cpp +++ b/uppsrc/ide/Builders/GccBuilder.cpp @@ -481,12 +481,20 @@ bool GccBuilder::Link(const Vector& linkfile, const String& linkoptions, lnk << " -static"; if(HasFlag("WINCE")) lnk << " -mwindowsce"; - else if(HasFlag("WIN32") && !HasFlag("CLANG")) { - lnk << " -mwindows"; - // if(HasFlag("MT")) - lnk << " -mthreads"; - if(!HasFlag("GUI")) - lnk << " -mconsole"; + else if(HasFlag("WIN32")) { + lnk << " -mthreads"; + if(HasFlag("CLANG")) { + if(HasFlag("GUI")) + lnk << " -mwindows"; + else + lnk << " -mconsole"; + } + else { + lnk << " -mwindows"; + // if(HasFlag("MT")) + if(!HasFlag("GUI")) + lnk << " -mconsole"; + } } lnk << " -o " << GetHostPathQ(target); if(createmap) diff --git a/uppsrc/ide/Debug.cpp b/uppsrc/ide/Debug.cpp index 245943d8a..982313fd5 100644 --- a/uppsrc/ide/Debug.cpp +++ b/uppsrc/ide/Debug.cpp @@ -246,27 +246,8 @@ void Ide::BuildAndDebug0(const String& srcfile) One h = CreateHostRunDir(); h->ChDir(GetFileFolder(target)); VectorMap bm = GetMethodVars(method); - String dbg = bm.Get("DEBUGGER", Null); - if(IsNull(dbg)) { - if(bm.Get("BUILDER", Null) == "MSC71") { - String sln = ForceExt(target, ".sln"); - if(GetFileLength(sln) > 0) - h->Launch("devenv \"" + h->GetHostPath(sln) + "\" " - // + "\"" + h->GetHostPath(srcfile) + "\"" //TRC, 2011/09/26: wrong devenv argument - ); - else - h->Launch("devenv \"" + h->GetHostPath(target) - //+ "\" \"" + h->GetHostPath(srcfile) //TRC, 2011/09/26: wrong devenv argument - + "\" /debugexe " - ); - return; - } - dbg = "gdb"; - } - else - h->Launch('\"' + dbg + "\" \"" -// + h->GetHostPath(srcfile) + ' ' - + h->GetHostPath(target) + "\"", true); + String dbg = Nvl(bm.Get("DEBUGGER", Null), "gdb"); + h->Launch('\"' + dbg + "\" \"" + h->GetHostPath(target) + "\"", true); } } @@ -311,13 +292,12 @@ void Ide::BuildAndDebug(bool runto) bool console = ShouldHaveConsole(); - if(findarg(builder, "GCC", "CLANG") >= 0) { - debugger = GdbCreate(pick(host), target, runarg, console); - } #ifdef PLATFORM_WIN32 - else + if(findarg(builder, "GCC", "CLANG") < 0 || bm.Get("DEBUG_OPTIONS", String()).Find("-gcodeview") >= 0) // llvm-mingw can generate pdb symbolic info debugger = PdbCreate(pick(host), target, runarg); + else #endif + debugger = GdbCreate(pick(host), target, runarg, console); if(!debugger) { IdeEndDebug(); diff --git a/uppsrc/ide/Debuggers/Debuggers.upp b/uppsrc/ide/Debuggers/Debuggers.upp index a5f7acdc3..78484d5f6 100644 --- a/uppsrc/ide/Debuggers/Debuggers.upp +++ b/uppsrc/ide/Debuggers/Debuggers.upp @@ -7,7 +7,7 @@ uses uses(!POSIX) plugin/ndisasm; -library(WIN32 GCC) "dbghelp psapi"; +library(WIN32 (GCC | CLANG)) "dbghelp psapi"; file Debuggers.h options(BUILDER_OPTION) PCH, diff --git a/uppsrc/plugin/ndisasm/lib/compiler.h b/uppsrc/plugin/ndisasm/lib/compiler.h index 85ab3d228..2db4c8cd1 100644 --- a/uppsrc/plugin/ndisasm/lib/compiler.h +++ b/uppsrc/plugin/ndisasm/lib/compiler.h @@ -53,9 +53,6 @@ be able to #ifdef them... */ #else /* Default these to unsupported unless we have config.h */ -# ifndef inline -# define inline -# endif # ifndef restrict # define restrict # endif diff --git a/uppsrc/plugin/ndisasm/ndisasm.upp b/uppsrc/plugin/ndisasm/ndisasm.upp index e4442242f..f2042ff1f 100644 --- a/uppsrc/plugin/ndisasm/ndisasm.upp +++ b/uppsrc/plugin/ndisasm/ndisasm.upp @@ -2,9 +2,6 @@ description "Disassembler\3770,128,128"; options(BUILDER_OPTION) NOWARNINGS; -uses - Core; - file ndisasm.h, ndisupp.cpp, diff --git a/uppsrc/plugin/tif/lib/tif_fax3sm.c b/uppsrc/plugin/tif/lib/tif_fax3sm.c index 822191ecf..b897af97d 100644 --- a/uppsrc/plugin/tif/lib/tif_fax3sm.c +++ b/uppsrc/plugin/tif/lib/tif_fax3sm.c @@ -1,6 +1,6 @@ /* WARNING, this file was automatically generated by the mkg3states program */ -#include "tiff.h" +#include "tiffiop.h" #include "tif_fax3.h" const TIFFFaxTabEnt TIFFFaxMainTable[128] = { {12,7,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0},