Commit Graph

51 Commits

Author SHA1 Message Date
catalinr
c150ece20f Cast int to double to avoid arithmetic overflow warning 2019-10-14 07:49:28 +03:00
Vadim Zeitlin
1c68979fb4 Move wxCTZ() documentation to the appropriate place
The documentation comment belongs to interface/wx/math.h, not the header
under include.

Also change the argument type to wxUint32 as the non-gcc version only
works for 32 bit values.
2018-11-05 19:27:53 +01:00
Mick Phillips
291a880d0c Synchronize joystick events between all ports
Generate wxJoystickEvent with the same fields under all platforms by
making the Linux and macOS versions follow MSW convention of using
"1 << N" for the changed button.

Add GetButtonOrdinal() accessor which can be used to retrieve just N.

Closes #18233.
2018-11-05 19:27:36 +01:00
Benjamin Drung
bc41cbeb25 Define wxIsNaN() as std::isnan() in C++11 mode
std::isnan() is always available when using C++11, so just use it.

Also pout the test for C++11 implementations of both wxIsNaN() and wxFinite()
first, eventually the rest of the checks will become obsolete and will be
removed.

Closes https://github.com/wxWidgets/wxWidgets/pull/283
2016-05-14 00:13:47 +02:00
Tobias Taschner
2eccc1a57d Remove remaining MSDOS support code
The remaining DOS source files where already removed in
26a0a24f38. This removes the remaining __DOS__
and __DJGPP__ (the DOS gcc) code paths.

Closes https://github.com/wxWidgets/wxWidgets/pull/100
2015-09-24 14:38:22 +02:00
Tobias Taschner
8282c1be0f Remove Windows CE support
Windows CE doesn't seem to be supported by Microsoft any longer. Last CE
release was in early 2013 and the PocketPC and Smartphone targets supported by
wxWidgets are long gone.

The build files where already removed in an earlier cleanup this commit
removes all files, every #ifdef and all documentation regarding the Windows CE
support.

Closes https://github.com/wxWidgets/wxWidgets/pull/81
2015-09-23 00:52:30 +02:00
Vadim Zeitlin
c6c19dc580 Remove extraneous semicolons after wxDECL_FOR_STRICT_MINGW32().
This macro shouldn't be followed by a semicolon because it can be empty, so
remove the extra semicolons to avoid -Wpedantic g++ warnings about it.
2015-07-01 00:39:05 +02:00
Vadim Zeitlin
6787d2268a Improve workaround for MinGW math.h bug in strict ANSI mode.
Declare _hypot() function globally, predefining __NO_INLINE__ in wx/math.h is
not enough as <math.h> is also included from some other standard headers, e.g.
<algorithm>, and including them results in the same bug as in wx/math.h
(i.e. https://sourceforge.net/p/mingw/bugs/2250/).
2015-06-15 02:21:58 +02:00
Vadim Zeitlin
c8a3c01424 Work around a bug in MinGW math.h.
Including standard math.h header with both -O2 and -std=c++NN options results
in compilation error due to a bug in the header, see MinGW bug report at
https://sourceforge.net/p/mingw/bugs/2250/

Work around this to allow the library to compile in release build with
-std=c++11. This is ugly but better than failing to compile at all.
2015-06-14 19:52:26 +02:00
Vadim Zeitlin
cc774bb301 Fix building and using the library with MinGW -std=c++{98,11} options.
These options enable "strict ANSI" mode in MinGW which omits declarations of
POSIX functions from the standard headers. To allow the library and, possibly
even more importantly, the user code including our headers, to compile with
these options, declare the functions that we need ourselves.

This might appear to go against the spirit of "strict ANSI" mode, but the only
alternative would be to not use such functions at all and silently cripple the
library when -std=c++NN is used, compared to -std=g++NN case, and this doesn't
seem appealing neither.

Closes #16984.
2015-06-14 19:52:26 +02:00
Vadim Zeitlin
e871a2157d Add wxGCD() helper function.
It is needed in wxMSW code and it looks like it could be useful to the library
users, so make it public.

See #16254.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-07 21:03:25 +00:00
Vadim Zeitlin
a380c1e46f Add public wxDegToRad() and wxRadToDeg() functions.
Define these functions just once in wx/math.h instead of duplicating them in a
dozen of places.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76555 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-17 12:29:15 +00:00
Vadim Zeitlin
49b8d79c87 Remove (Open)Watcom support.
This compiler is not being developed since several years and almost certainly
can't be used to build the current wxWidgets sources anyhow, so remove all
support for it, including a lot of extremely ugly workarounds for its bugs
with template functions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-16 13:01:06 +00:00
Vadim Zeitlin
866a7cd7ca MinGW-w64 provides isfinite() in both 32 and 64 bit builds.
So use __MINGW64_TOOLCHAIN__ to test for it and not __MINGW64__, which is only
defined in 64 bits.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-09-30 23:49:05 +00:00
Vadim Zeitlin
bfdaa9173e Use std::isfinite() for wxFinite() for C++11 compilers.
This should fix compilation with MinGW 4.8.1 cross-compiler in C++11 mode as
it doesn't seem to provide finite() any more then.

Also, only defined wxFinite() and wxIsNaN() for C++, not C. This makes the
checks for __cplusplus >= 201103 simpler and is consistent with how
wxIsSameDouble() and wxRound() were already only defined for C++ (this is also
the source of most of the changes in this diff, viewing it ignoring whitespace
will show the only real changes).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-09-18 17:30:30 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Václav Slavík
f256de1125 Work around wxFinite() definition conflict with <cmath>.
Using the GNU libstdc++ or Clang's libc++ implementations of the
standard library, <cmath> inclusion undefines the isfinite macro,
resulting in compilation errors when wxFinite() is used.  <cmath> can be
included unintentionally, e.g.  wx/hashmap.h may result in its inclusion
when using STD containers.

Work around this mess by checking if one of these <cmath>
implementations were already included and using std::isfinite() in that
case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-09 15:44:01 +00:00
Vadim Zeitlin
33f9dbda89 Add wxGCC_WARNING_{SUPPRESS,RESTORE} macros and use them for -Wfloat-equal.
Suppress the warnings about comparing floating point values for equality in
wxWidgets headers when the user code is compiled with -Wfloat-equal (at least
when using g++ 4.6 or later).

Closes #14895.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-12-28 00:44:01 +00:00
Stefan Csomor
9ce18df82e fixing c++11 build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-18 10:34:32 +00:00
Vadim Zeitlin
2415cf6725 Remove support for MetroWerks CodeWarrior compiler.
This compiler doesn't exist any more and was probably unsupported even in 2.8,
let alone 2.9, so remove all the __MWERKS__ tests to simplify things.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-05 18:40:11 +00:00
Vadim Zeitlin
d98a58c543 Use __WINDOWS__ for OS kind checks and reserve __WXMSW__ for GUI toolkit.
This change prepares the way for using wxGTK under Windows as this would
still define __WINDOWS__ but use __WXGTK__ instead of __WXMSW__.

Closes #14064.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-04 00:29:31 +00:00
Dimitri Schoolwerth
e78c47e3b8 Replaced C++ comments with C ones in C files.
Replaced C++ comments (occurring outside of __cplusplus blocks) in files that contain the warning "THIS IS A C FILE" with C comments.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-15 19:18:34 +00:00
Václav Slavík
7ca3cc6fc3 Fix wxMulDivInt32() to round the result like win32 MulDiv() does.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-19 22:02:59 +00:00
Vadim Zeitlin
9a83f86094 Globally replace _T() with wxT().
Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-23 20:30:22 +00:00
Vadim Zeitlin
eb00016c5a fix METRIC_CONVERSION_CONSTANT which got accidentally divided by 10 in r45721
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-09-22 16:20:43 +00:00
Vadim Zeitlin
a8be206acc no changes, fix typo in comment
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-08-30 21:08:43 +00:00
Vadim Zeitlin
0475d322f7 use C99 isfinite() for 64 bit mingw32 instead of BSD-ish finite() which it apparently doesn't have
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-08-30 12:55:43 +00:00
Stefan Csomor
ac9e3f1f1c osx regrouping
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54824 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-07-29 20:22:57 +00:00
Stefan Neis
d897635497 Added header needed for Solaris to find finite() prototype.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52963 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-01 19:43:41 +00:00
Vadim Zeitlin
163b3ad72c replace wrong WXDLLEXPORT declarations with correct WXDLLIMPEXP_BASE/ADV/GL (patch from Tim Stahlhut)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50646 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-12 01:35:53 +00:00
Vadim Zeitlin
225dfbc517 added wxConvertTo/FromIeeeExtended() synonyms for ConvertTo/FromIeeeExtended() and deprecated the latters; also added missing dll export declarations for them (patch 1772233)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-08-15 11:07:13 +00:00
Vadim Zeitlin
97b253782a use a marginally more precise but, more importantly, easier to understand, value for METRIC_CONVERSION_CONSTANT
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45721 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-30 16:25:57 +00:00
Vadim Zeitlin
f11af09331 assert that wxRound() argument is in the supported range
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45720 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-30 16:23:17 +00:00
Paul Cornett
ca88598dd1 remove unreachable declaration
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-03-08 04:31:24 +00:00
Paul Cornett
b34497d885 configure test for round
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-08-19 21:28:18 +00:00
Włodzimierz Skiba
23f826bdf9 wxRound() workaround to avoid unexpected compile and link errors on incomplete environments (Tinderbox build fix).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-07-06 09:09:09 +00:00
Włodzimierz Skiba
068becf562 Move wxMulDivInt32 to common math.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36005 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-10-24 18:56:33 +00:00
Vadim Zeitlin
67036b2497 added wxIsNullDouble()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-25 23:58:29 +00:00
Vadim Zeitlin
17a1ebd101 first round of Intel compiler warning fixes: down from a few thousands just to slightly more than 100
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-25 19:59:19 +00:00
Vadim Zeitlin
bc14c8b21f added wxIsSameDouble() which wraps double comparison in a pragmas disabling icc warning about it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35685 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-25 18:14:53 +00:00
Mart Raudsepp
8907154c1a Nuke #pragma implementation/interface's
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-23 12:56:45 +00:00
Julian Smart
99d800190a Added licence/copyright information
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-05-04 18:57:50 +00:00
Vadim Zeitlin
5f8ba10e86 replaced C++ comment with a C one
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-03-06 12:16:24 +00:00
Włodzimierz Skiba
e2bcbdfbc7 Metric conversion constants not doubled in each port code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-12-21 16:25:59 +00:00
Włodzimierz Skiba
83c5e93495 Be C file.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-12-14 20:34:23 +00:00
Włodzimierz Skiba
19edb09cd9 math.h/PI integration
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-12-13 19:54:38 +00:00
Włodzimierz Skiba
4e32eea148 Source cleaning: whitespaces, tabs, -1/wxDefaultCoord/wxID_ANY/wxNOT_FOUND, TRUE/true, FALSE/false.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-09-17 22:23:59 +00:00
Julian Smart
655719367a Use old licence name
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-23 20:53:33 +00:00
Julian Smart
77ffb5937e Name and version changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-23 14:56:36 +00:00
Václav Slavík
1202890513 added support for gcc precompiled headers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-09 12:38:21 +00:00