Description: Generate the native headers with 'javac -h' instead of javah (removed from Java 10)
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/build.xml
+++ b/build.xml
@@ -297,6 +297,7 @@
 
 	<!-- Generates the native headers from source files -->
 	<target name="headers" description="invokes javah on java classes" depends="compile">
+<!--
 		<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux">
 			<class name="org.lwjgl.LinuxSysImplementation" />
 			<class name="org.lwjgl.opengl.LinuxEvent" />
@@ -373,6 +374,7 @@
 			<class name="org.lwjgl.opengles.GLContext"/>
 			<class name="org.lwjgl.opengles.CallbackUtil"/>
 		</javah>
+-->
 	</target>
 
 	<target name="touch-version">
@@ -403,21 +405,21 @@
 				</tokenfilter>
 			</filterchain>
 		</loadfile>
-		<loadfile srcfile="${lwjgl.src.native}/windows/org_lwjgl_WindowsSysImplementation.h" property="lwjgl.native.windows.version">
+		<loadfile srcfile="${lwjgl.src.native}/org_lwjgl_WindowsSysImplementation.h" property="lwjgl.native.windows.version">
 			<filterchain>
 				<tokenfilter>
 	    		<containsstring contains="#define org_lwjgl_WindowsSysImplementation_JNI_VERSION"/>
 				</tokenfilter>
 			</filterchain>
 		</loadfile>
-		<loadfile srcfile="${lwjgl.src.native}/linux/org_lwjgl_LinuxSysImplementation.h" property="lwjgl.native.linux.version">
+		<loadfile srcfile="${lwjgl.src.native}/org_lwjgl_LinuxSysImplementation.h" property="lwjgl.native.linux.version">
 			<filterchain>
 				<tokenfilter>
 	    		<containsstring contains="#define org_lwjgl_LinuxSysImplementation_JNI_VERSION"/>
 				</tokenfilter>
 			</filterchain>
 		</loadfile>
-		<loadfile srcfile="${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
+		<loadfile srcfile="${lwjgl.src.native}/org_lwjgl_MacOSXSysImplementation.h" property="lwjgl.native.macosx.version">
 			<filterchain>
 				<tokenfilter>
 	    		<containsstring contains="#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION"/>
@@ -464,7 +466,7 @@
 
 	<!-- Compiles the Java source code -->
 	<target name="compile" description="Compiles the java source code" depends="-initialize">
-		<javac debug="yes" destdir="${lwjgl.bin}" source="1.5" target="1.5" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-debug-all.jar" taskname="core">
+		<javac debug="yes" destdir="${lwjgl.bin}" source="1.5" target="1.5" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-debug-all.jar" taskname="core" nativeHeaderDir="${lwjgl.src.native}">
             <!--<compilerarg value="-Xlint:unchecked"/>-->
 			<src path="${lwjgl.src}/java/"/>
 			<src path="${lwjgl.src}/generated/"/>
--- a/src/java/org/lwjgl/LinuxSysImplementation.java
+++ b/src/java/org/lwjgl/LinuxSysImplementation.java
@@ -43,6 +43,7 @@
  * $Id$
  */
 final class LinuxSysImplementation extends J2SESysImplementation {
+	@java.lang.annotation.Native
 	private static final int JNI_VERSION = 19;
 
 	static {
--- a/platform_build/linux_ant/build.xml
+++ b/platform_build/linux_ant/build.xml
@@ -143,6 +143,7 @@
 			<arg value="-I${java.home}/../include/solaris"/>
 			<arg value="-I${native}/common"/>
 			<arg value="-I${native}/common/opengl"/>
+			<arg value="-I${native}"/>
 			<arg value="-I${native}/linux"/>
 			<arg value="-I${native}/linux/opengl"/>
 			<mapper type="glob" from="*.c" to="*.o"/>
--- a/src/java/org/lwjgl/input/Cursor.java
+++ b/src/java/org/lwjgl/input/Cursor.java
@@ -51,12 +51,15 @@
 
 public class Cursor {
 	/** 1 bit transparency for native cursor */
+	@java.lang.annotation.Native
 	public static final int		CURSOR_ONE_BIT_TRANSPARENCY	= 1;
 
 	/** 8 bit alhpa native cursor */
+	@java.lang.annotation.Native
 	public static final int		CURSOR_8_BIT_ALPHA					= 2;
 
 	/** animation native cursor */
+	@java.lang.annotation.Native
 	public static final int		CURSOR_ANIMATION						= 4;
 
 	/** First element to display */
--- a/src/native/common/org_lwjgl_BufferUtils.c
+++ b/src/native/common/org_lwjgl_BufferUtils.c
@@ -1,4 +1,3 @@
-#include "org_lwjgl_BufferUtils.h"
 #include "common_tools.h"
 
 JNIEXPORT void JNICALL Java_org_lwjgl_BufferUtils_zeroBuffer0(JNIEnv *env, jclass clazz, jobject buffer, jlong offset, jlong size) {
--- a/src/native/common/org_lwjgl_opencl_CallbackUtil.c
+++ b/src/native/common/org_lwjgl_opencl_CallbackUtil.c
@@ -39,7 +39,6 @@
 #include <jni.h>
 #include "common_tools.h"
 #include "extcl.h"
-#include "org_lwjgl_opencl_CallbackUtil.h"
 
 static jmethodID contextCallbackJ;
 static jmethodID memObjectDestructorCallbackJ;
--- a/src/java/org/lwjgl/MacOSXSysImplementation.java
+++ b/src/java/org/lwjgl/MacOSXSysImplementation.java
@@ -43,6 +43,7 @@
  * $Id$
  */
 final class MacOSXSysImplementation extends J2SESysImplementation {
+	@java.lang.annotation.Native
 	private static final int JNI_VERSION = 25;
 
 	static {
