Home | History | Annotate | Download | only in init-fini-arrays
      1 /* For details, see README */
      2 
      3 extern "C" {
      4 
      5 void __attribute__((constructor))
      6 my_constructor(void)
      7 {
      8     /* nothing */
      9 }
     10 
     11 void __attribute__((destructor))
     12 my_destructor(void)
     13 {
     14     /* nothing */
     15 }
     16 
     17 }
     18 
     19 class Foo {
     20 public:
     21     Foo() : mValue(1) {}
     22     ~Foo() { mValue = 0; }
     23 private:
     24     int mValue;
     25 };
     26 
     27 static Foo foo;
     28