Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new ScopedHookInstall constructor which can set/override the new hook destination #24

Merged
merged 1 commit into from
Mar 31, 2017
Merged

Add new ScopedHookInstall constructor which can set/override the new hook destination #24

merged 1 commit into from
Mar 31, 2017

Conversation

gocha
Copy link
Contributor

@gocha gocha commented Mar 31, 2017

Why ScopedHookInstall does not have a constructor which can specify installation details? I think it would be sometimes useful.

subhook::Hook foo_hook;

void foo_fake(void) {
  subhook::ScopedHookRemove foo_remove(&foo_hook);
  foo();
}

int main(void) {
  {
    subhook::ScopedHookInstall foo_install(&foo_hook, foo, foo_fake); // NEW

    do_something();
  }

  return 0;
}

@Zeex Zeex merged commit 2f9d0c1 into Zeex:master Mar 31, 2017
@Zeex
Copy link
Owner

Zeex commented Mar 31, 2017

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants