Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. /*
  2. Usage :
  3. "test.cpp"
  4. ----------
  5. #include <iostream>
  6.  
  7. #define _START_ begin
  8. #define _EXIT_ end
  9. #include "Startup_Exit.h"
  10.  
  11. void begin()
  12. {
  13. std::cout << "Running before main()\n";
  14. }
  15.  
  16. void end()
  17. {
  18. std::cout << "Running after main()\n";
  19. }
  20.  
  21. int main()
  22. {
  23. std::cout << "Running main\n";
  24. }
  25. */
  26.  
  27. #ifndef START_EXIT_H
  28. #define START_EXIT_H
  29.  
  30. #ifdef __GNUC__
  31. void _START_ (void) __attribute__((constructor));
  32. void _EXIT_ (void) __attribute__((destructor));
  33. #endif
  34.  
  35. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement