From a06bfd3b8f39b967071e8758ca76ae31268ab81c Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Fri, 12 Mar 2021 11:32:34 +0900 Subject: [PATCH] [java] add JAVA_INC_DIR --- ffi/java/Makefile | 10 +++++--- ffi/java/com/herumi/mcl/CipherText.java | 2 +- ffi/java/com/herumi/mcl/Elgamal.java | 2 +- ffi/java/com/herumi/mcl/ElgamalJNI.java | 2 +- ffi/java/com/herumi/mcl/PrivateKey.java | 2 +- ffi/java/com/herumi/mcl/PublicKey.java | 2 +- ffi/java/com/herumi/mcl/SWIGTYPE_p_bool.java | 2 +- ffi/java/elgamal_wrap.cxx | 12 ++++++---- ffi/java/mcl_wrap.cxx | 24 +++++++++++--------- 9 files changed, 33 insertions(+), 25 deletions(-) diff --git a/ffi/java/Makefile b/ffi/java/Makefile index bb581db..eba3e41 100644 --- a/ffi/java/Makefile +++ b/ffi/java/Makefile @@ -1,14 +1,18 @@ TOP_DIR=../.. include $(TOP_DIR)/common.mk ifeq ($(UNAME_S),Darwin) - JAVA_INC?=-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/JavaVM.framework/Headers/ + JAVA_INC_DIR?=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/JavaVM.framework/Headers/ + JAVA_INC?=-I$(JAVA_INC_DIR) + CFLAGS+=$(JAVA_INC)/darwin else - JAVA_INC?=-I/usr/lib/jvm/default-java/include + JAVA_INC_DIR?=/usr/lib/jvm/default-java/include + JAVA_INC?=-I$(JAVA_INC_DIR) #JAVA_INC=-I/usr/lib/jvm/java-7-openjdk-amd64/include + CFLAGS+=$(JAVA_INC)/linux CFLAGS+=-z noexecstack LDFLAGS+=-lrt endif -CFLAGS+=$(JAVA_INC) $(JAVA_INC)/linux -I $(TOP_DIR)/include -I $(TOP_DIR)/../xbyak -I $(TOP_DIR)/../cybozulib/include -Wno-strict-aliasing +CFLAGS+=$(JAVA_INC) -I $(TOP_DIR)/include -I -Wno-strict-aliasing MCL_LIB=$(TOP_DIR)/lib/libmcl.a PACKAGE_NAME=com.herumi.mcl diff --git a/ffi/java/com/herumi/mcl/CipherText.java b/ffi/java/com/herumi/mcl/CipherText.java index 87175bb..ccb3837 100644 --- a/ffi/java/com/herumi/mcl/CipherText.java +++ b/ffi/java/com/herumi/mcl/CipherText.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.0 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/ffi/java/com/herumi/mcl/Elgamal.java b/ffi/java/com/herumi/mcl/Elgamal.java index 8249c84..f1b4c05 100644 --- a/ffi/java/com/herumi/mcl/Elgamal.java +++ b/ffi/java/com/herumi/mcl/Elgamal.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.0 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/ffi/java/com/herumi/mcl/ElgamalJNI.java b/ffi/java/com/herumi/mcl/ElgamalJNI.java index 67f0f22..3306f67 100644 --- a/ffi/java/com/herumi/mcl/ElgamalJNI.java +++ b/ffi/java/com/herumi/mcl/ElgamalJNI.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.0 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/ffi/java/com/herumi/mcl/PrivateKey.java b/ffi/java/com/herumi/mcl/PrivateKey.java index 96603e5..7d9ac1e 100644 --- a/ffi/java/com/herumi/mcl/PrivateKey.java +++ b/ffi/java/com/herumi/mcl/PrivateKey.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.0 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/ffi/java/com/herumi/mcl/PublicKey.java b/ffi/java/com/herumi/mcl/PublicKey.java index 8da13c0..5bfb9ef 100644 --- a/ffi/java/com/herumi/mcl/PublicKey.java +++ b/ffi/java/com/herumi/mcl/PublicKey.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.0 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/ffi/java/com/herumi/mcl/SWIGTYPE_p_bool.java b/ffi/java/com/herumi/mcl/SWIGTYPE_p_bool.java index d49f742..1794299 100644 --- a/ffi/java/com/herumi/mcl/SWIGTYPE_p_bool.java +++ b/ffi/java/com/herumi/mcl/SWIGTYPE_p_bool.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.0 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/ffi/java/elgamal_wrap.cxx b/ffi/java/elgamal_wrap.cxx index 15e2995..9935eeb 100644 --- a/ffi/java/elgamal_wrap.cxx +++ b/ffi/java/elgamal_wrap.cxx @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.0 + * Version 4.0.2 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -182,15 +182,16 @@ template T SwigValueInit() { /* Support for throwing Java exceptions */ typedef enum { - SWIG_JavaOutOfMemoryError = 1, - SWIG_JavaIOException, - SWIG_JavaRuntimeException, + SWIG_JavaOutOfMemoryError = 1, + SWIG_JavaIOException, + SWIG_JavaRuntimeException, SWIG_JavaIndexOutOfBoundsException, SWIG_JavaArithmeticException, SWIG_JavaIllegalArgumentException, SWIG_JavaNullPointerException, SWIG_JavaDirectorPureVirtual, - SWIG_JavaUnknownError + SWIG_JavaUnknownError, + SWIG_JavaIllegalStateException, } SWIG_JavaExceptionCodes; typedef struct { @@ -211,6 +212,7 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, { SWIG_JavaUnknownError, "java/lang/UnknownError" }, + { SWIG_JavaIllegalStateException, "java/lang/IllegalStateException" }, { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } }; const SWIG_JavaExceptions_t *except_ptr = java_exceptions; diff --git a/ffi/java/mcl_wrap.cxx b/ffi/java/mcl_wrap.cxx index 1cca360..3c2d95f 100644 --- a/ffi/java/mcl_wrap.cxx +++ b/ffi/java/mcl_wrap.cxx @@ -1623,20 +1623,22 @@ SWIGEXPORT jboolean JNICALL Java_com_herumi_mcl_MclJNI_G1_1isZero(JNIEnv *jenv, return jresult; } + SWIGEXPORT jboolean JNICALL Java_com_herumi_mcl_MclJNI_G1_1isValidOrder(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - G1 *arg1 = (G1 *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(G1 **)&jarg1; - result = (bool)((G1 const *)arg1)->isValidOrder(); - jresult = (jboolean)result; - return jresult; + jboolean jresult = 0 ; + G1 *arg1 = (G1 *) 0 ; + bool result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(G1 **)&jarg1; + result = (bool)((G1 const *)arg1)->isValidOrder(); + jresult = (jboolean)result; + return jresult; } + SWIGEXPORT void JNICALL Java_com_herumi_mcl_MclJNI_G1_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { G1 *arg1 = (G1 *) 0 ; Fp *arg2 = 0 ;