1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2024-12-23 01:59:43 +08:00
Commit Graph

12 Commits

Author SHA1 Message Date
Nick Hastings
732b5b29b5 More mathlib unification with SDK 2013, including 3dnow fixes (#231) 2024-04-21 11:52:42 -04:00
Nick Hastings
0d247b9566 Port GetCPUInformation and mathlib from sdk2013 2024-04-20 13:42:47 -04:00
Benoist
8a6d1c6cd2
TF2 win64 + Ambuild tier1/mathlib + long=devil (#198)
* Fix compilation for windows, setup ambuild

* Add built tier1 and mathlib for win64

* Ensure compilation is working on windows and linux

* Add -fPIC

* Add compiled libs, with optimisation enabled

* Added windows lib

* Fix hl2sdk for windows

* Longs are the devil

* Fix up threadtools functions

* Add updated libs

* Rework lib naming, and package script

* Update lib directory according to new packaging

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
2024-03-09 03:57:12 +00:00
sigsegv
669d017fda Fix cases where V_swap didn't need the global scope resolution operator 2016-01-24 17:23:29 -08: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
99bfb50b2b Rebuilt tier1 and mathlib for OS X using clang. 2013-04-27 00:18:49 -05:00
Scott Ehlert
c8788cc5ac Removed 3DNow support from mathlib.
MathLib_3DNowEnabled() will always return false.
2013-04-27 00:18:21 -05:00
Nicholas Hastings
af9cf6a553 Fix mathlib compile from missing MIN/MAX. 2012-10-26 14:45:48 -04: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