aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.c b/main.c
index 78c98cb..bec763f 100644
--- a/main.c
+++ b/main.c
@@ -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");