You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/10/14 14:38:05 UTC

(maven-mvnd) branch mvnd-1.x updated: Drop the Jansi leftovers from the native header

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch mvnd-1.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git


The following commit(s) were added to refs/heads/mvnd-1.x by this push:
     new 1f439f4c Drop the Jansi leftovers from the native header
1f439f4c is described below

commit 1f439f4c8c5a717dc08be9a9e562611d43cec6a5
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Wed Oct 14 08:39:28 2026 +0200

    Drop the Jansi leftovers from the native header
    
    The header was copied from Jansi and included ncurses' term.h, libutil.h, util.h and pty.h,
    which mvndnative.c never uses and which toolchains without ncurses lack; on macOS it also got
    stdlib.h only through them. It now includes what the code calls: stdlib.h, unistd.h or windows.h,
    and jni.h.
---
 native/src/main/native/mvndnative.h | 138 ++----------------------------------
 1 file changed, 6 insertions(+), 132 deletions(-)

diff --git a/native/src/main/native/mvndnative.h b/native/src/main/native/mvndnative.h
index 70230482..4edf4e1e 100644
--- a/native/src/main/native/mvndnative.h
+++ b/native/src/main/native/mvndnative.h
@@ -13,144 +13,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *******************************************************************************/
-#ifndef JANSI_H
-#define JANSI_H
 
-#ifdef __linux__
+#ifndef MVNDNATIVE_H
+#define MVNDNATIVE_H
 
-    #include <termios.h>
-    #include <sys/ioctl.h>
-    #include <pty.h>
-    #include <unistd.h>
-    #include <stdlib.h>
-
-    #include "jni.h"
-#endif
-
-#ifdef __FreeBSD__
-
-    #include <unistd.h>
-    #include <stdlib.h>
-    #include <string.h>
-
-    #include <term.h>
-    #include <libutil.h>
-    #include <termios.h>
-    #include <sys/ioctl.h>
-
-    #include "jni.h"
-#endif
+#include <stdlib.h>
 
-/* Windows based build */
 #if defined(_WIN32) || defined(_WIN64)
-
-    #include <stdlib.h>
-    #include <string.h>
     #include <windows.h>
-    #include <conio.h>
-    #include <io.h>
-
-    #include "jni.h"
-#endif
-
-#if defined(__APPLE__) && defined(__MACH__)
-
-    #include <term.h>
-    #include <util.h>
-    #include <termios.h>
-    #include <sys/ioctl.h>
-    #include <unistd.h>
-
-    #include "jni.h"
-#endif
-
-#include <stdint.h>
-
-
-#ifndef JNI64
-#if defined(_LP64)
-#define JNI64
-#endif
-#endif
-
-/* 64 bit support */
-#ifndef JNI64
-
-/* int/long defines */
-#define GetIntLongField GetIntField
-#define SetIntLongField SetIntField
-#define GetIntLongArrayElements GetIntArrayElements
-#define ReleaseIntLongArrayElements ReleaseIntArrayElements
-#define GetIntLongArrayRegion GetIntArrayRegion
-#define SetIntLongArrayRegion SetIntArrayRegion
-#define NewIntLongArray NewIntArray
-#define CallStaticIntLongMethod CallStaticIntMethod
-#define CallIntLongMethod CallIntMethod
-#define CallStaticIntLongMethodV CallStaticIntMethodV
-#define CallIntLongMethodV CallIntMethodV
-#define jintLongArray jintArray
-#define jintLong jint
-#define I_J "I"
-#define I_JArray "[I"
-
-/* float/double defines */
-#define GetFloatDoubleField GetFloatField
-#define SetFloatDoubleField SetFloatField
-#define GetFloatDoubleArrayElements GetFloatArrayElements
-#define ReleaseFloatDoubleArrayElements ReleaseFloatArrayElements
-#define GetFloatDoubleArrayRegion GetFloatArrayRegion
-#define jfloatDoubleArray jfloatArray
-#define jfloatDouble jfloat
-#define F_D "F"
-#define F_DArray "[F"
-
 #else
-
-/* int/long defines */
-#define GetIntLongField GetLongField
-#define SetIntLongField SetLongField
-#define GetIntLongArrayElements GetLongArrayElements
-#define ReleaseIntLongArrayElements ReleaseLongArrayElements
-#define GetIntLongArrayRegion GetLongArrayRegion
-#define SetIntLongArrayRegion SetLongArrayRegion
-#define NewIntLongArray NewLongArray
-#define CallStaticIntLongMethod CallStaticLongMethod
-#define CallIntLongMethod CallLongMethod
-#define CallStaticIntLongMethodV CallStaticLongMethodV
-#define CallIntLongMethodV CallLongMethodV
-#define jintLongArray jlongArray
-#define jintLong jlong
-#define I_J "J"
-#define I_JArray "[J"
-
-/* float/double defines */
-#define GetFloatDoubleField GetDoubleField
-#define SetFloatDoubleField SetDoubleField
-#define GetFloatDoubleArrayElements GetDoubleArrayElements
-#define ReleaseFloatDoubleArrayElements ReleaseDoubleArrayElements
-#define GetFloatDoubleArrayRegion GetDoubleArrayRegion
-#define jfloatDoubleArray jdoubleArray
-#define jfloatDouble jdouble
-#define F_D "D"
-#define F_DArray "[D"
-
+    #include <unistd.h>
 #endif
 
+#include "jni.h"
 
-#ifdef __GNUC__
-  #define hawtjni_w_barrier() __sync_synchronize()
-#elif defined(SOLARIS2) && SOLARIS2 >= 10
-  #include <mbarrier.h>
-  #define hawtjni_w_barrier() __machine_w_barrier()
-#elif defined(__APPLE__)
-  #include <libkern/OSAtomic.h>
-  #define hawtjni_w_barrier() OSMemoryBarrier()
-#elif defined(_WIN32) || defined(_WIN64)
-  #include <intrin.h>
-  #define hawtjni_w_barrier() _mm_sfence(); _WriteBarrier()
-#else
-  #pragma message ( "Don't know how to do a memory barrier on this platform" )
-  #define hawtjni_w_barrier()
-#endif
-
-    #endif /* JANSI_H */
+#endif /* MVNDNATIVE_H */