foo.c   [plain text]


#include <stddef.h>


typedef void (*NotifyProc)(void);

NotifyProc gNotifer = NULL;


static __attribute__((destructor))
void myTerm()
{
    if ( gNotifer )
        gNotifer();
}