Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Usage :
- "test.cpp"
- ----------
- #include <iostream>
- #define _START_ begin
- #define _EXIT_ end
- #include "Startup_Exit.h"
- void begin()
- {
- std::cout << "Running before main()\n";
- }
- void end()
- {
- std::cout << "Running after main()\n";
- }
- int main()
- {
- std::cout << "Running main\n";
- }
- */
- #ifndef START_EXIT_H
- #define START_EXIT_H
- #ifdef __GNUC__
- void _START_ (void) __attribute__((constructor));
- void _EXIT_ (void) __attribute__((destructor));
- #endif
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement