Added Sys.NULL constant

This commit is contained in:
Elias Naur 2003-04-03 20:20:29 +00:00
parent d7ff86a7d3
commit 3018edde4c
4 changed files with 43 additions and 1 deletions

View File

@ -82,10 +82,16 @@ public final class Sys {
* the library, and whether assertions are enabled or not.
*/
public static final boolean DEBUG;
/**
* The integer equivalent of the native NULL constant
*/
public static final int NULL;
private static boolean _debug;
static {
NULL = nGetNULLValue();
try {
assert false;
LIBRARY_NAME = "lwjgl";
@ -123,6 +129,11 @@ public final class Sys {
setTime(0);
}
/**
* Gets the native NULL constant value
*/
private static native int nGetNULLValue();
/**
* Gets the address of a buffer. If the address cannot be obtained for any reason
* then this method returns 0.

View File

@ -18,8 +18,17 @@ extern "C" {
#define org_lwjgl_Sys_REALTIME_PRIORITY 2L
/* Inaccessible static: LIBRARY_NAME */
/* Inaccessible static: DEBUG */
/* Inaccessible static: NULL */
/* Inaccessible static: _debug */
/* Inaccessible static: class_000240 */
/* Inaccessible static: class_00024org_00024lwjgl_00024Sys */
/*
* Class: org_lwjgl_Sys
* Method: nGetNULLValue
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_Sys_nGetNULLValue
(JNIEnv *, jclass);
/*
* Class: org_lwjgl_Sys
* Method: getDirectBufferAddress

View File

@ -48,6 +48,17 @@ long int hires_timer_freq; // Hires timer frequency
long int hires_timer_start; // Hires timer start
long int hires_timer; // Hires timer current time
/*
* Class: org_lwjgl_Sys
* Method: nGetNULLValue
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_Sys_nGetNULLValue
(JNIEnv *, jclass)
{
return (jint)NULL;
}
/*
* Class: org_lwjgl_Sys
* Method: getDirectBufferAddress

View File

@ -49,6 +49,17 @@ __int64 hires_timer_freq; // Hires timer frequency
__int64 hires_timer_start; // Hires timer start
__int64 hires_timer; // Hires timer current time
/*
* Class: org_lwjgl_Sys
* Method: nGetNULLValue
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_lwjgl_Sys_nGetNULLValue
(JNIEnv *, jclass)
{
return (jint)NULL;
}
/*
* Class: org_lwjgl_Sys
* Method: getDirectBufferAddress