1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-07 09:43:40 +08:00

10 Commits

Author SHA1 Message Date
David Anderson
140cc6dc66 Rename mathlib clamp to V_clamp. 2023-10-13 21:13:34 -07:00
infernalxdrm
4f04af6123
Get rid of warnings (#88)
* Get rid of warnings

-macro expansion producing 'defined' has undefined behaviour
-conversion from 'int' to 'float', possible loss of data

* Get rid of errors

-conversion from 'int' to 'float', possible loss of data
2021-11-04 21:14:31 +00:00
Michael Flaherty
1952d88fa8 Revert "Remove depricated register declaration"
This reverts commit c921714cc367358345e78086f64018a8c50bc896.
2018-07-19 18:58:12 -07:00
Michael Flaherty
c921714cc3 Remove depricated register declaration 2018-07-19 18:49:58 -07:00
sigsegv
0edbd27fb8 Backport swap() -> V_swap() rename to avoid C++11 ADL ambiguity errors
The swap() function provided in the MathLib header was renamed to V_swap in recent Source SDK versions (e.g. 2013) to avoid causing ambiguity problems with std::swap(). But older SDK versions (such as TF2) lack this change, as they predate it.

The ambiguity between MathLib's swap() and std::swap() causes considerable problems when using newer features of C++ (such as std::unique_ptr) which internally call swap() in an unqualified manner to implement move semantics:

/usr/include/c++/5.2.0/bits/unique_ptr.h:342:6: error: call of overloaded ‘swap(MyType*&, MyType*&)’ is ambiguous
/usr/include/c++/5.2.0/bits/move.h:176:5: note: candidate: void std::swap(_Tp&, _Tp&) [with _Tp = MyType*]
hl2sdk-tf2/public/mathlib/mathlib.h:611:18: note: candidate: void swap(T&, T&) [with T = MyType*]

This patch backports the swap() -> V_swap() rename from the 2013 SDK version to the TF2 SDK version, so that the TF2 SDK can be used in conjunction with C++11 features such as std::unique_ptr without difficulty.

More information on why swap() isn't called in a namespace-qualified manner by standard library functions:
http://en.cppreference.com/w/cpp/language/adl#Notes
2016-01-24 16:44:52 -08:00
Scott Ehlert
c8788cc5ac Removed 3DNow support from mathlib.
MathLib_3DNowEnabled() will always return false.
2013-04-27 00:18:21 -05:00
Scott Ehlert
3e7f7bdabd Fixed conflict between min/max macros and std::min/max when using GCC >= 4.2. 2011-04-28 01:30:09 -05:00
Scott Ehlert
b06949c4cc More portions of the SDK compile (and link!) on Mac OS X (bug 4392, r=dvander).
SourceMod compiles and links now. Hurray! Most plugins may also but there may be more work to do.
2010-05-13 04:08:37 -05:00
Scott Ehlert
7ff7f366d5 Modified SDK for GCC 4.2 2008-09-15 02:50:57 -05:00
Scott Ehlert
055f5cd168 Added most recent version of unmodified HL2 SDK for Orange Box engine 2008-09-15 01:07:45 -05:00