浏览代码

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

Peter Cai 1 年之前
父节点
当前提交
2a8fb99ed0
共有 1 个文件被更改,包括 3 次插入0 次删除
  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 <jni.h>
 
+_Static_assert(sizeof(void *) <= sizeof(jlong),
+               "jlong must be big enough to hold a platform raw pointer");
+
 struct lpac_jni_ctx {
     jobject apdu_interface;
     jobject http_interface;