main.cpp 349 B

123456789101112131415161718192021
  1. /*
  2. * Copyright 2019-2022 Yury Gribov
  3. *
  4. * The MIT License (MIT)
  5. *
  6. * Use of this source code is governed by MIT license that can be
  7. * found in the LICENSE.txt file.
  8. */
  9. #include <stdio.h>
  10. #include "interposed.h"
  11. int main() {
  12. try {
  13. foo(1, 2);
  14. } catch (const err &e) {
  15. printf("Caught exception: %d\n", e.cookie);
  16. }
  17. return 0;
  18. }