Browse Source

lpac-jni: Assert jlong is enough to hold a platform sized pointer

Peter Cai 1 year ago
parent
commit
2a8fb99ed0
1 changed files with 3 additions and 0 deletions
  1. 3 0
      libs/lpac-jni/src/main/jni/lpac-jni/lpac-jni.h

+ 3 - 0
libs/lpac-jni/src/main/jni/lpac-jni/lpac-jni.h

@@ -4,6 +4,9 @@
 #include <pthread.h>
 #include <pthread.h>
 #include <jni.h>
 #include <jni.h>
 
 
+_Static_assert(sizeof(void *) <= sizeof(jlong),
+               "jlong must be big enough to hold a platform raw pointer");
+
 struct lpac_jni_ctx {
 struct lpac_jni_ctx {
     jobject apdu_interface;
     jobject apdu_interface;
     jobject http_interface;
     jobject http_interface;