diff options
-rw-r--r-- | main.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -148,7 +148,17 @@ void signal_handler(int sig){ } } +static bool constructors_work = false; + +__attribute__((constructor)) +static void constructor(void) { constructors_work = true; } + int main(int argc,char **argv){ + if (!constructors_work) { + fprintf(stderr, "This platform does not support application constructors, which tomsg requires\n"); + return 1; + } + srandomdev(); if(sodium_init()<0){ fprintf(stderr,"Could not initialise libsodium!\n"); |