Commit Graph

60 Commits

Author SHA1 Message Date
Joshua
8695a16ccd
Merge 756433786c into 07c708a59e 2025-11-03 14:55:36 -05:00
PeakKS
6091f15217 Fix missing includes and standardize non-system includes to quotes 2025-04-20 11:38:45 -04:00
tschumann
7e24188759 Add loader tests. 2025-03-16 12:42:30 -04:00
Nick Hastings
5d48696528 fix(sourcehook): Disable tests on linux x64 for now 2024-08-04 15:02:26 -04:00
Nick Hastings
994b382754 fix(sourcehook): Fix compilation issues with standalone SourceHook 2024-08-04 15:02:26 -04:00
Kenzzer
7947580a60 lower log level 2024-08-03 12:17:47 -04:00
Kenzzer
a5aee4fe3b remove the test suite for now 2024-08-03 12:17:15 -04:00
Kenzzer
1097e2bebf remove sourcehook generated file 2024-08-03 12:16:22 -04:00
Kenzzer
ca78915d59 Fix compilation for 32bits 2024-08-03 12:15:53 -04:00
Kenzzer
87fcaca024 make jit writer public 2024-08-03 12:00:32 -04:00
Kenzzer
222c174f0d add x64 stub generator support 2024-08-03 11:59:56 -04:00
Mooshua
6112248775 Code review requested changes
- A few style improvements
- Add & correct some documentation
- Change AddHook signature to not allow DVP as an option (for now!)
- Fix cstdio not being pulled in on linux (bleh)
- Add some more static_asserts to make errors easier to interpret (yay)
2024-05-02 15:11:16 -07:00
Mooshua
6548671084 I love spreading misinformation
Turns out this isn't true. Yay! Less work for me :^)
2024-04-25 20:45:47 -07:00
Mooshua
916f4058bf Grammar, fix reference handling, add missing typenames. 2024-04-25 10:04:40 -07:00
Mooshua
8abbfbb810 Remove dependency on ISourceHook** from MethodInvoker templates. 2024-04-24 19:59:59 -07:00
Mooshua
50772ffc46 Introduce varardic hook macros
This is a large refactor that splits our mega-template into a few smaller ones. First off, the PLUGIN_GLOBALVARS() helpers were put in the SourceHook namespace.

- HookHandlerImpl: Responsible for the lowered delegates (post-vafmt), can be used independently of other templates added here. Relies on parent HookManager class to handle the unlowered original invocation logic. (As a template parameter)
- HookCoreImpl: Adds a public interface & glue layer beterrn managers and HookHandlerImpl

- HookImpl: non-varardic hook manager
- FmtHookImpl: format-string hook manager

FmtHookImpl was tested by hooking IVEngineServer::ClientCommand.
2024-04-24 19:48:14 -07:00
Mooshua
d96b3adb0a Hook->HookImpl, expose "public" hook template in PLUGIN_EXPOSE
This allows us to specify the SH pointer and the Plugin ID pointer in the template, so when the plugin uses Hook<> it doesn't have to touch g_PLID or g_SHPtr.

Also added a little struct that wraps ISourceHook->xHookById methods.
2024-04-24 00:05:15 -07:00
Mooshua
aa88f23880 Initial draft: Templated SourceHook
Introduces one massive template for generating SourceHook managers.
The goal is for this to simplify the definition of SourceHooks long-term by replacing macros with templates.

This introduces some new templates for metaprogramming, but they're hidden away in the SourceHook::metaprogramming namespace.

Tested on Windows 32 bit and Linux 32 bit TF2.
2024-04-23 22:55:25 -07:00
Kenzzer
37408219ba Shut msvc 2024-02-07 22:03:17 -05:00
icedrocket
e907e5293f Remove deprecated syntax for compatibility 2024-01-11 21:19:12 -08:00
Kaela
bc36e072a1 Update sh_memory.h (tidy up things) 2023-12-18 19:31:18 -05:00
KaelaSavia
f2d9d3e9e5 Replace fscanf with faster parsing #2 2023-12-18 19:31:18 -05:00
Peak
2fe0c36845
Replace fscanf with faster parsing (#127) 2023-10-07 10:45:54 -07:00
Benoist
2261ff4f9c
Fix sourcehook compilation warning (#106)
Fix sourcehook compilation warning.

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
2023-07-30 21:36:23 -07:00
David Anderson
acea12f29b Upgrade to AMBuild 2.2. 2020-08-19 14:41:55 -07:00
peace-maker
b267567e50
Fix detection of Blade Symphony on Windows x64 (#67)
* Fix detection of Blade Symphony on Windows x64

Port finding the module base address on x64 builds from SourceMod.
Fix a bunch of truncation warnings on x64 while at it too.

* Fix mm_TrimComments stripping last char before comment

```c
char test[] = "hi this is a a test!// comment";
mm_TrimComments(test);
puts(test); // prints "hi this is a test" without the !
```

* Fix unsigned comparison warnings

* Fix truncation warnings in SourceHook::String

* Fix unsigned comparison warnings

clang does have some nice analysis.
2020-06-25 00:04:36 +00:00
David Anderson
7efa054b82
Merge pull request #52 from alliedmodders/warnings
Prevent some warnings for SM builds
2018-07-31 21:23:52 -07:00
Headline
d5030d0612 Re-add dummy, cast to void 2018-07-31 21:14:08 -07:00
Michael Flaherty
37738022ee dvander foxes 2018-07-31 13:17:48 -07:00
Kyle Sanderson
625c59dad5
Disable de-virtualization in sh-tests for gcc-4.9+ (#53)
* Update AMBuilder
* Re-add gcc6 to .travis.yml
* right; 🐍
* where Travis-CI?
* fix whitespace problems w/ travis.yml
2018-07-31 11:02:13 -07:00
Headline
b9b150e638 Fix warnings for SM builds 2018-07-29 04:09:18 -07:00
Nick Hastings
1b83816c7e Crank up SourceHook param count support from 17 to 20. 2018-07-07 08:45:23 -04:00
Scott Ehlert
79435093d9
64-bit support for CSGO on Linux and macOS (#35) 2017-12-20 01:11:57 -06:00
Nicholas Hastings
f17a958c66 Merge branch 'master' into S2
Conflicts:
	configure.py
	core/sourcehook/test/main.cpp
2015-11-23 15:12:55 -05:00
David Anderson
270c8714e3 Add variadic versions of the SH_DECL_MANUALEXTERN macro family, and wrap the hardcoded macros around these. 2015-10-25 13:47:33 -07:00
David Anderson
4918d4ff4c Add variadic versions of the SH_DECL_EXTERN macro family, and wrap the hardcoded macros around these. 2015-10-25 13:03:02 -07:00
David Anderson
fdd571fc06 Use C++11 variadic templates for sh_memfuncinfo.h. 2015-10-24 19:36:33 -07:00
David Anderson
196d28a45a Remove extra, unused copies of sh_memfuncinfo.h. 2015-10-24 19:31:49 -07:00
David Anderson
2ce09bfa70 Use C++11 variadic templates for core FastDelegate. 2015-10-24 18:52:31 -07:00
David Anderson
ef43db47b2 Regenerate sourcehook.h. 2015-10-24 18:22:40 -07:00
David Anderson
edba55f4a8 Remove extra, unused copies of FastDelegate.h/sourcehook.h from the tree. 2015-10-24 18:22:01 -07:00
David Anderson
4a652ceea6 Use variadic templates for ExecutableClass (core changes). 2015-09-25 17:53:45 -07:00
David Anderson
60f878f132 Merge pull request #22 from alliedmodders/tl
Replace SetOverrideResult/GetRecallIface with variadic templates.
2015-09-25 17:19:00 -07:00
David Anderson
4477448924 Replace SetOverrideResult/GetRecallIface with variadic templates. 2015-09-24 21:16:29 -07:00
David Anderson
219cd7203f Fix testvphooks. 2015-09-24 21:03:49 -07:00
David Anderson
5f44dd2d22 Enable SourceHook tests on Travis. 2015-09-24 20:40:05 -07:00
Scott Ehlert
77e74a5eeb Partial 64-bit support for SourceHook on Windows 2015-07-09 15:12:16 -05:00
Scott Ehlert
1f1aca02f3 Fix build of SourceHook tests 2015-07-09 14:24:18 -05:00
Nicholas Hastings
2800d66712 Convert compile-time checks to use static_assert.
Fixes unused-local-typedefs warnings when checks pass.
2015-04-15 08:16:16 -07:00
Nicholas Hastings
3aa20f1405 Added support for CS: Global Offensive (bug 5228, r=DS). 2012-05-26 17:07:26 -04:00