aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCNLohr <charles@cnlohr.com>2018-03-10 18:09:00 -0500
committerGitHub <noreply@github.com>2018-03-10 18:09:00 -0500
commit78507e78bc7ff8aaffbe24642cf7b7a689b419c6 (patch)
treeb73ec4341a111fd0fd007f24f7d94a3b9b5b6b4b /src
parentc96eba564989b1f5956c2b6c0f38e72195a9fd58 (diff)
parentf5022be0b94cbd5b5ead8dc6035551ae1d011db0 (diff)
downloadlibsurvive-78507e78bc7ff8aaffbe24642cf7b7a689b419c6.tar.gz
libsurvive-78507e78bc7ff8aaffbe24642cf7b7a689b419c6.tar.bz2
Merge pull request #103 from jdavidberger/verify_FLT_at_startup
Added a check at init that makes sure the user agrees with what FLT is
Diffstat (limited to 'src')
-rwxr-xr-xsrc/survive.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/survive.c b/src/survive.c
index 0386275..76bf8e4 100755
--- a/src/survive.c
+++ b/src/survive.c
@@ -94,7 +94,16 @@ static void *button_servicer(void * context)
return NULL;
}
-SurviveContext * survive_init( int headless )
+void survive_verify_FLT_size(uint32_t user_size) {
+ if(sizeof(FLT) != user_size) {
+ fprintf(stderr, "FLT type incompatible; the shared library libsurvive has FLT size %lu vs user program %u\n", sizeof(FLT), user_size);
+ fprintf(stderr, "Add '#define FLT %s' before including survive.h or recompile the shared library with the appropriate flag. \n",
+ sizeof(FLT) == sizeof(double) ? "double" : "float");
+ exit(-1);
+ }
+}
+
+SurviveContext * survive_init_internal( int headless )
{
#ifdef RUNTIME_SYMNUM
if( !did_runtime_symnum )