Don't rely on time zone offset to check whether it is local as this
doesn't, and can't, work for the local time zone in Great Britain which
uses the same offset as UTC, but does use DST, unlike the latter.
Add a unit test (albeit disabled by default) checking that the code that
previously didn't work correctly in BST does work now (run the tests
using "TZ=Europe/London ./test wxDateTime-BST-bugs" under Unix to test).
Closes#14317, #17220.
See #10445.
Replace exactly the same code occurring in both wxDateTime::GetTm() and
Format() with a single version in a new wxTryGetTm() function.
No real changes yet, except for removing of some useless asserts.
The class needs to use WXDLLIMPEXP_ADV in order for its (default,
compiler-generated) dtor to be generated inside the library, otherwise
this doesn't happen and linking code using this class inside a shared
library fails with errors due to the dtor being undefined.
This is a tiny optimization (or maybe not so tiny on platforms other
than Linux where time() might not as fast as just reading a memory
location), but mostly is done to work around faketime bug[*] which
prevented it from being used for testing programs using wxWidgets, such
as our own unit tests because time() was called from wxLogTrace() in
wxCSConv::DoCreate() called when creating global conversion objects
during the library initialization.
Arguably, it might be better to avoid calling wxLogTrace() during the
initialization, but this can't be done as simply and this change might
have a small performance benefit too.
[*] https://github.com/wolfcw/libfaketime/issues/132
Subtracting a huge negative offset from the current position could
overflow it, which was correctly detected as undefined behaviour by
UBSAN.
Credit to OSS-Fuzz: this solves its issue 4388.
Although the object being created _will_ be of type wxAppConsole, it
doesn't have this type yet, as wxAppConsole ctor hadn't yet run, and so
the static cast is invalid and detected as such by UBSAN in g++ 6.3.
Currently lzma and jbig libraries are checked only for builtin
libtiff. When the system libtiff is built with lzma and jbig
support and when the `--with-libtiff=sys` flag is specified
the configure script will fail, due to missing linking with
lzma and jbig.
Fixed this by moving lzma and jbig checks from libtiff-builin check
above all libtiff checks. Also added lzma and jbig libs to
EXTRALIBS_GUI.
See https://github.com/wxWidgets/wxWidgets/pull/619
When using ftell to get the position in the file, it should be opened in binary mode.
Regenerate the poem index file with the correct start positions.
Use the wxICON macro for creating the icon, so .ico is used on Windows.
Fix wxFont, wxPen and wxBrush style deprecation warnings.
Add wxFALLTHROUGH to resolve implicit fallthrough warnings in switch statements.
Fix build error when using long for GetTextExtent (with wxUSE_GRID 0).
Remove unused icon from fractal demo.
We need to remove the directory containing sh.exe from the PATH as
otherwise mingw32-make seems to use it and not cmd.exe for executing the
commands in the makefile, but the wrong directory was being removed in
appveyor.yml, having no effect.
Fix this and undo 5f2ccde269 which
compensated for it by (almost) clearing the PATH entirely which, in
turn, broke one of our unit tests (and could break other things in the
future, as having an empty PATH is rather unexpected).
Also use the full path for head program now that its directory is not in
the PATH any more. Alternative could be to use PowerShell, but while
powershell -Command "'gcc','mingw32-make','ar'|%%{ iex \"$_ --version\"|select -first 1 }"
does work, it looks really ugly, so avoid it for now.
See https://github.com/wxWidgets/wxWidgets/pull/142
See #17274.
Apparently a locale can be available at MSW level, so that
wxLocale::IsAvailable() returns true, but not supported by the MSVC CRT,
so that constructing the corresponding wxXLocale fails, which resulted
in wxXLocale unit test failures.
Fix them by checking that wxXLocale can be constructed directly instead
of using wxLocale::IsAvailable() as a proxy.
This is not ideal and perhaps wxLocale::IsAvailable() should check that
the locale is supported in wxXLocale too, but should at least allow unit
tests to pass on AppVeyor for now.
Simplify the test by using a single function instead of all the
machinery inherited from CppUnit.
Also provide more information in case of test failure.
Standard/Unix format strings are intentionally used when using these
compilers/environments (see d62c535d4c for
the former), so don't check for Windows/MSVC format strings in the test.
Allow wxPrintf("%1$s %1$s", "foo") to work.
Take into account the possibility that the number of format specifiers
and the number of actual arguments can be different.
Closes#9367.
There is no need to rebuild everything if only the documentation files
have changed.
Unfortunately there doesn't seem to be any way to do the same thing for
Travis CI yet, see https://github.com/travis-ci/travis-ci/issues/6301
Probably a follow-up fix for commit from 10 years ago: 288b610
This fixes compilation with `--enable-extended_rtti` configure flag.
Also removed all trailing spaces in this file.
Replaced `wxToStringConverter<type, data, result)` with
`wxFromStringConverter<type>(data, result)`, which was broken
for 7 years since the commit 13830d6
This fixes compilation with `--enable-extended_rtti` configure flag.
Also removed all trailing spaces in this file.