From nobody Mon Oct 21 11:24:04 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XXCch6t80z5YsWm; Mon, 21 Oct 2024 11:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXCch6dlpz45LW; Mon, 21 Oct 2024 11:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729509844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FFGxvrei3gSPvkTGEXOcHavs3Xvb5VtmErhDAahEeh4=; b=cXxQpEoWUjMAvsvdfksf4FU8ipgkf6PaFLQjB0zvE/+9E+vFoUnuKjhjmZQzWBf+rIw+So J9EavTYvrkbd1/nykdRb718ZWcigRGY0ioOhtSkzpcgIydajUQb44weTYpDrci0OlG1So7 uWm8EqBt0E0YeDt5xdn1cv6xsGMABwsw9htSNkZBM7/BM/xxBxKZenQsTVj7oHVKdvqwYN 5snBF+bCCrrmXYa0Q885AmanEKrv6ZhBQ/4gh5FHtwQVxeMS27pk60khBG5Mjt01aYbe9e dlaW5uIEuQmj5G8DKy14vTdzfdG1HKaev1+3MsvZaqkCXM0IrETlx1uyI3CxDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729509844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FFGxvrei3gSPvkTGEXOcHavs3Xvb5VtmErhDAahEeh4=; b=asH7UrcihyPB11DkD9Dzc08zrACsoHn3zHolmKZ1p9ACKpCEn0asB6E30fOYMUV97g+bgT ZcXyROCIwJJILhsUyei/6iCaURO4LepRvhD3bnEzGnMeOMe17J2OUTKbbjX9QhHy+mtA0D puZO5HwBFAsdVAHijJk9BTmZ0yS52zZOs8M9202Z7ZONMXD9yOLDpfyBAL8KYU+oLrx3JB i/7WUjHW8lcbSRnrNs/ksgqb1Xx/PpI6MjwaSWUtffO3LfNPHY2IPc6uf4j2qRAqmZrr5D 15EtfiFdW2dRuQBUq7AKotKE3BZBbCVTBiXGNnLn23F3oTAfxBMLYKwzbQSsIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729509844; a=rsa-sha256; cv=none; b=GTqy3CtqKElLNf6I57LZMR7286PR2YNRQKBGmp720uMJ8nAEPn23ZVfOqRRz+Sedh5rDdh JF7l1yoV0aPudZv9nGYZaMFIH3EtEHiYuUsy6MMFkudZSR8rjFaKTxqOquYKvUBV7ZmRw4 6M7rTNDfh7U539gWlye3SMsACE4ZytDDtHRdn7sIm2H483YP6kVuoLO5wjSNsg7NjV0obl YdPlNNqVVen9/V6pmLzgx0mjZSqO6bfeZey8ZybGjR0IjWx/OAqiJYh4zofNjo+T5O2oTY 2nZMfoxUkWlwcTDVQZ8evH8bFlrzT9TMBTiw609/p+/pc/jQrzdkcDKb+kwIeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XXCch6DkyzSY3; Mon, 21 Oct 2024 11:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49LBO4kM036871; Mon, 21 Oct 2024 11:24:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LBO41b036868; Mon, 21 Oct 2024 11:24:04 GMT (envelope-from git) Date: Mon, 21 Oct 2024 11:24:04 GMT Message-Id: <202410211124.49LBO41b036868@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 2546696f9bd2 - main - devel/ocaml-camljava: Update to 0.5, improve port List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2546696f9bd2acb0ae9ce313973d7f812944bb52 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/ports/commit/?id=2546696f9bd2acb0ae9ce313973d7f812944bb52 commit 2546696f9bd2acb0ae9ce313973d7f812944bb52 Author: Benjamin Jacobs AuthorDate: 2024-10-19 22:32:18 +0000 Commit: Li-Wen Hsu CommitDate: 2024-10-21 11:21:22 +0000 devel/ocaml-camljava: Update to 0.5, improve port - Set MAKE_ARGS to -e, and add to MAKE_ENV the upstream Makefile variables which need to be configured, instead of REINPLACE_CMD them in post-patch. - Set the rpath in function of the JAVA_PORT_VERSION, to restore support for JDK8. - Drop patch to jnistubs.c, as it is essentially included upstream now. PR: 282214 --- devel/ocaml-camljava/Makefile | 31 ++- devel/ocaml-camljava/distinfo | 6 +- devel/ocaml-camljava/files/patch-lib_jnistubs.c | 353 ------------------------ 3 files changed, 22 insertions(+), 368 deletions(-) diff --git a/devel/ocaml-camljava/Makefile b/devel/ocaml-camljava/Makefile index a1693ba79288..955e80cb5392 100644 --- a/devel/ocaml-camljava/Makefile +++ b/devel/ocaml-camljava/Makefile @@ -1,5 +1,5 @@ PORTNAME= camljava -DISTVERSION= 0.4 +DISTVERSION= 0.5 CATEGORIES= devel java PKGNAMEPREFIX= ocaml- @@ -16,24 +16,31 @@ GH_TAGNAME= ${PORTNAME}${DISTVERSION:S/.//} USE_JAVA= yes USE_OCAML= yes +MAKE_ARGS= -e +MAKE_ENV+= CAMLJAVALIB=${PREFIX}/${OCAML_SITELIBDIR}/${PORTNAME} \ + JDKHOME=${JAVA_HOME} + +.include + +.if ${JAVA_PORT_VERSION} >= 11 +MAKE_ENV+= JNILIBOPTS="-L${JAVA_HOME}/lib -L${JAVA_HOME}/lib/server -Wl,-rpath=${JAVA_HOME}/lib -Wl,-rpath=${JAVA_HOME}/lib/server" +.else +MAKE_ENV+= JNILIBOPTS="-L${JAVA_HOME}/jre/lib/${ARCH} -L${JAVA_HOME}/jre/lib/${ARCH}/server -Wl,-rpath=${JAVA_HOME}/jre/lib/${ARCH} -Wl,-rpath=${JAVA_HOME}/jre/lib/${ARCH}/server -Wl,-rpath=${JAVA_HOME}/jre/lib/${ARCH}/native_threads" +.endif + post-patch: - @${REINPLACE_CMD} -e "s,^\(JAVAC=\).*,\1${JAVAC},g" \ - -e "s,^\(JDKHOME=\).*,\1${JAVA_HOME},g" \ - -e "s,include/linux,include/freebsd,g" \ - -e "s,^CFLAGS=.*,#\&,g" \ - -e "s,^\(CC=\).*,#\&,g" \ - -e "s,i386,${ARCH},g" \ + @${REINPLACE_CMD} \ + -e "s,include/linux,include/${OPSYS:tl}," \ ${WRKSRC}/Makefile.config - @${REINPLACE_CMD} -e 's,(int64,&_t,' ${WRKSRC}/lib/jnistubs.c do-install: - ${MKDIR} ${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/${PORTNAME} + @${MKDIR} ${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/${PORTNAME} @(cd ${WRKSRC}/lib; ${INSTALL_DATA} \ jni.cma jni.cmi jni.cmxa jni.a libcamljni.a jni.mli camljava.jar \ ${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/${PORTNAME}) test: - @${ECHO_CMD} "Testing IDL library" - cd ${WRKSRC}/test && ${SETENV} ${MAKE_ENV} ${MAKE} all + @${ECHO_CMD} "Testing camljava library" + ${SETENVI} ${MAKE_ENV} ${MAKE} -C ${WRKSRC} ${MAKE_ARGS} tst -.include +.include diff --git a/devel/ocaml-camljava/distinfo b/devel/ocaml-camljava/distinfo index 39596700ca33..833dce8e64be 100644 --- a/devel/ocaml-camljava/distinfo +++ b/devel/ocaml-camljava/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1717436134 -SHA256 (xavierleroy-camljava-0.4-camljava04_GH0.tar.gz) = b4124e94823208fc1dd50b19091be3955510f6e9f0fd44e06b0b024564604597 -SIZE (xavierleroy-camljava-0.4-camljava04_GH0.tar.gz) = 16897 +TIMESTAMP = 1729354506 +SHA256 (xavierleroy-camljava-0.5-camljava05_GH0.tar.gz) = a8c9ad6a0894d88dba705458da854026874d7bae31e29bda9e2ff4ae61bf02ee +SIZE (xavierleroy-camljava-0.5-camljava05_GH0.tar.gz) = 16661 diff --git a/devel/ocaml-camljava/files/patch-lib_jnistubs.c b/devel/ocaml-camljava/files/patch-lib_jnistubs.c deleted file mode 100644 index e7de861a1a6c..000000000000 --- a/devel/ocaml-camljava/files/patch-lib_jnistubs.c +++ /dev/null @@ -1,353 +0,0 @@ ---- lib/jnistubs.c.orig 2024-06-03 17:46:36 UTC -+++ lib/jnistubs.c -@@ -53,10 +53,10 @@ static value alloc_jobject(jobject obj) - - static value alloc_jobject(jobject obj) - { -- value v = alloc_custom(&jobject_ops, sizeof(jobject), 0, 1); -+ value v = caml_alloc_custom(&jobject_ops, sizeof(jobject), 0, 1); - if (obj != NULL) { - obj = (*jenv)->NewGlobalRef(jenv, obj); -- if (obj == NULL) raise_out_of_memory(); -+ if (obj == NULL) caml_raise_out_of_memory(); - } - JObject(v) = obj; - return v; -@@ -98,11 +98,11 @@ static void check_java_exception(void) - if (camljava_raise_exception == NULL) { - camljava_raise_exception = caml_named_value("camljava_raise_exception"); - if (camljava_raise_exception == NULL) -- invalid_argument("Java_lang not linked in"); -+ caml_invalid_argument("Java_lang not linked in"); - } - vobj = alloc_jobject(exn); - (*jenv)->DeleteLocalRef(jenv, exn); -- callback(*camljava_raise_exception, vobj); -+ caml_callback(*camljava_raise_exception, vobj); - } - } - -@@ -113,9 +113,9 @@ static void check_non_null(value jobj) - if (camljava_null_pointer == NULL) { - camljava_null_pointer = caml_named_value("camljava_null_pointer"); - if (camljava_null_pointer == NULL) -- invalid_argument("Java not linked in"); -+ caml_invalid_argument("Java not linked in"); - } -- raise_constant(*camljava_null_pointer); -+ caml_raise_constant(*camljava_null_pointer); - } - - /*********** Class operations ************/ -@@ -147,7 +147,7 @@ static value alloc_jfieldID(jfieldID id) - - static value alloc_jfieldID(jfieldID id) - { -- value v = alloc((sizeof(jfieldID) + sizeof(value) - 1) / sizeof(value), -+ value v = caml_alloc((sizeof(jfieldID) + sizeof(value) - 1) / sizeof(value), - Abstract_tag); - JField(v) = id; - return v; -@@ -185,10 +185,10 @@ GETFIELD(GetShortField, jshort, Val_int) - GETFIELD(GetByteField, jbyte, Val_int) - GETFIELD(GetCharField, jchar, Val_int) - GETFIELD(GetShortField, jshort, Val_int) --GETFIELD(GetIntField, jint, copy_int32) --GETFIELD(GetLongField, jlong, copy_int64) --GETFIELD(GetFloatField, jfloat, copy_double) --GETFIELD(GetDoubleField, jdouble, copy_double) -+GETFIELD(GetIntField, jint, caml_copy_int32) -+GETFIELD(GetLongField, jlong, caml_copy_int64) -+GETFIELD(GetFloatField, jfloat, caml_copy_double) -+GETFIELD(GetDoubleField, jdouble, caml_copy_double) - - value camljava_GetCamlintField(value vobj, value vfield) - { -@@ -237,10 +237,10 @@ GETSTATICFIELD(GetStaticShortField, jshort, Val_int) - GETSTATICFIELD(GetStaticByteField, jbyte, Val_int) - GETSTATICFIELD(GetStaticCharField, jchar, Val_int) - GETSTATICFIELD(GetStaticShortField, jshort, Val_int) --GETSTATICFIELD(GetStaticIntField, jint, copy_int32) --GETSTATICFIELD(GetStaticLongField, jlong, copy_int64) --GETSTATICFIELD(GetStaticFloatField, jfloat, copy_double) --GETSTATICFIELD(GetStaticDoubleField, jdouble, copy_double) -+GETSTATICFIELD(GetStaticIntField, jint, caml_copy_int32) -+GETSTATICFIELD(GetStaticLongField, jlong, caml_copy_int64) -+GETSTATICFIELD(GetStaticFloatField, jfloat, caml_copy_double) -+GETSTATICFIELD(GetStaticDoubleField, jdouble, caml_copy_double) - - value camljava_GetStaticCamlintField(value vclass, value vfield) - { -@@ -279,7 +279,7 @@ static value alloc_jmethodID(jmethodID id) - - static value alloc_jmethodID(jmethodID id) - { -- value v = alloc((sizeof(jmethodID) + sizeof(value) - 1) / sizeof(value), -+ value v = caml_alloc((sizeof(jmethodID) + sizeof(value) - 1) / sizeof(value), - Abstract_tag); - JMethod(v) = id; - return v; -@@ -344,7 +344,7 @@ static jvalue * convert_args(value vargs, jvalue defau - if (nargs <= NUM_DEFAULT_ARGS) - args = default_args; - else -- args = stat_alloc(nargs * sizeof(jvalue)); -+ args = caml_stat_alloc(nargs * sizeof(jvalue)); - for (i = 0; i < nargs; i++) jvalue_val(Field(vargs, i), &(args[i])); - return args; - } -@@ -360,7 +360,7 @@ value camljava_##callname(value vobj, value vmeth, val - check_non_null(vobj); \ - args = convert_args(vargs, default_args); \ - res = (*jenv)->callname##A(jenv, JObject(vobj), JMethod(vmeth), args); \ -- if (args != default_args) stat_free(args); \ -+ if (args != default_args) caml_stat_free(args); \ - check_java_exception(); \ - return resconv(res); \ - } -@@ -370,10 +370,10 @@ CALLMETHOD(CallShortMethod, jshort, Val_int) - CALLMETHOD(CallByteMethod, jbyte, Val_int) - CALLMETHOD(CallCharMethod, jchar, Val_int) - CALLMETHOD(CallShortMethod, jshort, Val_int) --CALLMETHOD(CallIntMethod, jint, copy_int32) --CALLMETHOD(CallLongMethod, jlong, copy_int64) --CALLMETHOD(CallFloatMethod, jfloat, copy_double) --CALLMETHOD(CallDoubleMethod, jdouble, copy_double) -+CALLMETHOD(CallIntMethod, jint, caml_copy_int32) -+CALLMETHOD(CallLongMethod, jlong, caml_copy_int64) -+CALLMETHOD(CallFloatMethod, jfloat, caml_copy_double) -+CALLMETHOD(CallDoubleMethod, jdouble, caml_copy_double) - - value camljava_CallCamlintMethod(value vobj, value vmeth, value vargs) - { -@@ -383,7 +383,7 @@ value camljava_CallCamlintMethod(value vobj, value vme - check_non_null(vobj); - args = convert_args(vargs, default_args); - res = (*jenv)->CallIntMethodA(jenv, JObject(vobj), JMethod(vmeth), args); -- if (args != default_args) stat_free(args); -+ if (args != default_args) caml_stat_free(args); - check_java_exception(); - return Val_int(res); - } -@@ -395,7 +395,7 @@ value camljava_CallVoidMethod(value vobj, value vmeth, - check_non_null(vobj); - args = convert_args(vargs, default_args); - (*jenv)->CallVoidMethodA(jenv, JObject(vobj), JMethod(vmeth), args); -- if (args != default_args) stat_free(args); -+ if (args != default_args) caml_stat_free(args); - check_java_exception(); - return Val_unit; - } -@@ -407,7 +407,7 @@ value camljava_##callname(value vclass, value vmeth, v - jvalue * args = convert_args(vargs, default_args); \ - restyp res = \ - (*jenv)->callname##A(jenv, JObject(vclass), JMethod(vmeth), args); \ -- if (args != default_args) stat_free(args); \ -+ if (args != default_args) caml_stat_free(args); \ - check_java_exception(); \ - return resconv(res); \ - } -@@ -417,10 +417,10 @@ CALLSTATICMETHOD(CallStaticShortMethod, jshort, Val_in - CALLSTATICMETHOD(CallStaticByteMethod, jbyte, Val_int) - CALLSTATICMETHOD(CallStaticCharMethod, jchar, Val_int) - CALLSTATICMETHOD(CallStaticShortMethod, jshort, Val_int) --CALLSTATICMETHOD(CallStaticIntMethod, jint, copy_int32) --CALLSTATICMETHOD(CallStaticLongMethod, jlong, copy_int64) --CALLSTATICMETHOD(CallStaticFloatMethod, jfloat, copy_double) --CALLSTATICMETHOD(CallStaticDoubleMethod, jdouble, copy_double) -+CALLSTATICMETHOD(CallStaticIntMethod, jint, caml_copy_int32) -+CALLSTATICMETHOD(CallStaticLongMethod, jlong, caml_copy_int64) -+CALLSTATICMETHOD(CallStaticFloatMethod, jfloat, caml_copy_double) -+CALLSTATICMETHOD(CallStaticDoubleMethod, jdouble, caml_copy_double) - - value camljava_CallStaticCamlintMethod(value vclass, value vmeth, value vargs) - { -@@ -428,7 +428,7 @@ value camljava_CallStaticCamlintMethod(value vclass, v - jvalue * args = convert_args(vargs, default_args); - jint res = - (*jenv)->CallStaticIntMethodA(jenv, JObject(vclass), JMethod(vmeth), args); -- if (args != default_args) stat_free(args); -+ if (args != default_args) caml_stat_free(args); - check_java_exception(); - return Val_int(res); - } -@@ -438,7 +438,7 @@ value camljava_CallStaticVoidMethod(value vclass, valu - jvalue default_args[NUM_DEFAULT_ARGS]; - jvalue * args = convert_args(vargs, default_args); - (*jenv)->CallStaticVoidMethodA(jenv, JObject(vclass), JMethod(vmeth), args); -- if (args != default_args) stat_free(args); -+ if (args != default_args) caml_stat_free(args); - check_java_exception(); - return Val_unit; - } -@@ -453,7 +453,7 @@ value camljava_##callname(value vobj, value vclass, va - args = convert_args(vargs, default_args); \ - res = (*jenv)->callname##A(jenv, JObject(vobj), JObject(vclass), \ - JMethod(vmeth), args); \ -- if (args != default_args) stat_free(args); \ -+ if (args != default_args) caml_stat_free(args); \ - check_java_exception(); \ - return resconv(res); \ - } -@@ -463,10 +463,10 @@ CALLNONVIRTUALMETHOD(CallNonvirtualShortMethod, jshort - CALLNONVIRTUALMETHOD(CallNonvirtualByteMethod, jbyte, Val_int) - CALLNONVIRTUALMETHOD(CallNonvirtualCharMethod, jchar, Val_int) - CALLNONVIRTUALMETHOD(CallNonvirtualShortMethod, jshort, Val_int) --CALLNONVIRTUALMETHOD(CallNonvirtualIntMethod, jint, copy_int32) --CALLNONVIRTUALMETHOD(CallNonvirtualLongMethod, jlong, copy_int64) --CALLNONVIRTUALMETHOD(CallNonvirtualFloatMethod, jfloat, copy_double) --CALLNONVIRTUALMETHOD(CallNonvirtualDoubleMethod, jdouble, copy_double) -+CALLNONVIRTUALMETHOD(CallNonvirtualIntMethod, jint, caml_copy_int32) -+CALLNONVIRTUALMETHOD(CallNonvirtualLongMethod, jlong, caml_copy_int64) -+CALLNONVIRTUALMETHOD(CallNonvirtualFloatMethod, jfloat, caml_copy_double) -+CALLNONVIRTUALMETHOD(CallNonvirtualDoubleMethod, jdouble, caml_copy_double) - - value camljava_CallNonvirtualCamlintMethod(value vobj, value vclass, - value vmeth, value vargs) -@@ -478,7 +478,7 @@ value camljava_CallNonvirtualCamlintMethod(value vobj, - args = convert_args(vargs, default_args); - res = (*jenv)->CallNonvirtualIntMethodA(jenv, JObject(vobj), JObject(vclass), - JMethod(vmeth), args); -- if (args != default_args) stat_free(args); -+ if (args != default_args) caml_stat_free(args); - check_java_exception(); - return Val_int(res); - } -@@ -492,7 +492,7 @@ value camljava_CallNonvirtualVoidMethod(value vobj, va - args = convert_args(vargs, default_args); - (*jenv)->CallNonvirtualVoidMethodA(jenv, JObject(vobj), JObject(vclass), - JMethod(vmeth), args); -- if (args != default_args) stat_free(args); -+ if (args != default_args) caml_stat_free(args); - check_java_exception(); - return Val_unit; - } -@@ -507,7 +507,7 @@ value camljava_RegisterNullString(value null_string) - value camljava_RegisterNullString(value null_string) - { - camljava_null_string = null_string; -- register_global_root(&camljava_null_string); -+ caml_register_global_root(&camljava_null_string); - return Val_unit; - } - -@@ -541,7 +541,7 @@ static value extract_java_string (JNIEnv * env, jstrin - - if (jstr == NULL) return camljava_null_string; - len = (*env)->GetStringUTFLength(env, jstr); -- res = alloc_string(len); -+ res = caml_alloc_string(len); - chrs = (*env)->GetStringUTFChars(env, jstr, &isCopy); - memcpy(String_val(res), chrs, len); - (*env)->ReleaseStringUTFChars(env, jstr, chrs); -@@ -630,10 +630,10 @@ ARRAYNEWGETSET(Short, jshortArray, jshort, Int_val, Va - ARRAYNEWGETSET(Byte, jbyteArray, jbyte, Int_val, Val_int) - ARRAYNEWGETSET(Char, jcharArray, jchar, Int_val, Val_int) - ARRAYNEWGETSET(Short, jshortArray, jshort, Int_val, Val_int) --ARRAYNEWGETSET(Int, jintArray, jint, Int32_val, copy_int32) --ARRAYNEWGETSET(Long, jlongArray, jlong, Int64_val, copy_int64) --ARRAYNEWGETSET(Float, jfloatArray, jfloat, Double_val, copy_double) --ARRAYNEWGETSET(Double, jdoubleArray, jdouble, Double_val, copy_double) -+ARRAYNEWGETSET(Int, jintArray, jint, Int32_val, caml_copy_int32) -+ARRAYNEWGETSET(Long, jlongArray, jlong, Int64_val, caml_copy_int64) -+ARRAYNEWGETSET(Float, jfloatArray, jfloat, Double_val, caml_copy_double) -+ARRAYNEWGETSET(Double, jdoubleArray, jdouble, Double_val, caml_copy_double) - - value camljava_GetCamlintArrayElement(value varray, value vidx) - { -@@ -665,8 +665,8 @@ value camljava_GetByteArrayRegion(value varray, value - long length = Long_val(vlength); - - check_non_null(varray); -- if (dstidx < 0 || length < 0 || dstidx + length > string_length(vstr)) -- invalid_argument("Jni.get_byte_array_region"); -+ if (dstidx < 0 || length < 0 || dstidx + length > caml_string_length(vstr)) -+ caml_invalid_argument("Jni.get_byte_array_region"); - (*jenv)->GetByteArrayRegion(jenv, (jbyteArray) JObject(varray), - srcidx, length, (jbyte *) &Byte(vstr, dstidx)); - check_java_exception(); -@@ -682,8 +682,8 @@ value camljava_SetByteArrayRegion(value vstr, value vs - long length = Long_val(vlength); - - check_non_null(varray); -- if (srcidx < 0 || length < 0 || srcidx + length > string_length(vstr)) -- invalid_argument("Jni.set_byte_array_region"); -+ if (srcidx < 0 || length < 0 || srcidx + length > caml_string_length(vstr)) -+ caml_invalid_argument("Jni.set_byte_array_region"); - (*jenv)->SetByteArrayRegion(jenv, (jbyteArray) JObject(varray), - dstidx, length, (jbyte *) &Byte(vstr, srcidx)); - check_java_exception(); -@@ -702,7 +702,7 @@ value camljava_Init(value vclasspath) - - /* Set the class path */ - classpath = -- stat_alloc(strlen(setclasspath) + string_length(vclasspath) + 1); -+ caml_stat_alloc(strlen(setclasspath) + caml_string_length(vclasspath) + 1); - strcpy(classpath, setclasspath); - strcat(classpath, String_val(vclasspath)); - options[0].optionString = classpath; -@@ -712,8 +712,8 @@ value camljava_Init(value vclasspath) - vm_args.ignoreUnrecognized = 1; - /* Load and initialize a Java VM, return a JNI interface pointer in env */ - retcode = JNI_CreateJavaVM(&jvm, (void **) &jenv, &vm_args); -- stat_free(classpath); -- if (retcode < 0) failwith("Java.init"); -+ caml_stat_free(classpath); -+ if (retcode < 0) caml_failwith("Java.init"); - init_threading(); // by O'Jacare - return Val_unit; - } -@@ -856,17 +856,17 @@ static value camljava_callback(JNIEnv * env, - else if ((*env)->IsInstanceOf(env, arg, caml_short)) - carg = Val_int((*env)->GetShortField(env, arg, caml_short_contents)); - else if ((*env)->IsInstanceOf(env, arg, caml_int)) -- carg = copy_int32((*env)->GetIntField(env, arg, caml_int_contents)); -+ carg = caml_copy_int32((*env)->GetIntField(env, arg, caml_int_contents)); - else if ((*env)->IsInstanceOf(env, arg, caml_camlint)) - carg = Val_int((*env)->GetIntField(env, arg, caml_camlint_contents)); - else if ((*env)->IsInstanceOf(env, arg, caml_long)) -- carg = copy_int64((*env)->GetLongField(env, arg, -+ carg = caml_copy_int64((*env)->GetLongField(env, arg, - caml_long_contents)); - else if ((*env)->IsInstanceOf(env, arg, caml_float)) -- carg = copy_double((*env)->GetFloatField(env, arg, -+ carg = caml_copy_double((*env)->GetFloatField(env, arg, - caml_float_contents)); - else if ((*env)->IsInstanceOf(env, arg, caml_double)) -- carg = copy_double((*env)->GetDoubleField(env, arg, -+ carg = caml_copy_double((*env)->GetDoubleField(env, arg, - caml_double_contents)); - else if (string_auto_conv - && (*env)->IsInstanceOf(env, arg, java_lang_string)) -@@ -877,7 +877,7 @@ static value camljava_callback(JNIEnv * env, - } - End_roots(); - clos = caml_get_public_method(cargs[0], (value) method_id); -- res = callbackN_exn(clos, n, cargs); -+ res = caml_callbackN_exn(clos, n, cargs); - free(cargs); - jenv = savedenv; - return res; -@@ -928,17 +928,17 @@ value camljava_WrapCamlObject(value vobj) - - value camljava_WrapCamlObject(value vobj) - { -- value * wrapper = stat_alloc(sizeof(value)); -+ value * wrapper = caml_stat_alloc(sizeof(value)); - *wrapper = vobj; -- register_global_root(wrapper); -- return copy_int64((jlong) (value) wrapper); -+ caml_register_global_root(wrapper); -+ return caml_copy_int64((jlong) (value) wrapper); - } - - void camljava_FreeWrapper(JNIEnv * env, jclass cls, jlong wrapper) - { - value * w = (value *) (value) wrapper; -- remove_global_root(w); -- stat_free(w); -+ caml_remove_global_root(w); -+ caml_stat_free(w); - } - - jlong camljava_GetCamlMethodID(JNIEnv * env, jclass cls, jstring jname)