diff options
author | Silenio Quarti | 2002-03-20 22:53:36 +0000 |
---|---|---|
committer | Silenio Quarti | 2002-03-20 22:53:36 +0000 |
commit | dae663fa933f82d8b938bfe25580f40679e44d5e (patch) | |
tree | 2e62273918656b206bbacbd1241b32d42bccbb3a | |
parent | 5a60d809534929569f714364d659387f91f42ebe (diff) | |
download | eclipse.platform.swt-dae663fa933f82d8b938bfe25580f40679e44d5e.tar.gz eclipse.platform.swt-dae663fa933f82d8b938bfe25580f40679e44d5e.tar.xz eclipse.platform.swt-dae663fa933f82d8b938bfe25580f40679e44d5e.zip |
fd_set sizeof
3 files changed, 18 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/swt.c index 06417601cd..7adeb4cb6e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/swt.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/swt.c @@ -8195,6 +8195,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_write * Method: FD_SETSIZE * Signature: ()I */ +/* JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_FD_1SETSIZE (JNIEnv *env, jclass that) { @@ -8204,12 +8205,14 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_FD_1SETSIZE return FD_SETSIZE; } +*/ /* * Class: org_eclipse_swt_internal_motif_OS * Method: NFDBITS * Signature: ()I */ +/* JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_NFDBITS (JNIEnv *env, jclass that) { @@ -8219,6 +8222,17 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_NFDBITS return NFDBITS; } +*/ + +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_fd_1set_1sizeof + (JNIEnv *env, jclass that) +{ +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "NFDBITS\n"); +#endif + + return sizeof(fd_set); +} /* * Class: org_eclipse_swt_internal_motif_OS diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java index fcd6f2f3ea..03597b153a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java @@ -1359,8 +1359,9 @@ public static final native int select (int n, byte [] readfds, byte [] writefds, public static final native void FD_ZERO (byte [] fd_set);
public static final native void FD_SET (int fd, byte [] fd_set);
public static final native boolean FD_ISSET (int fd, byte [] fd_set);
-public static final native int FD_SETSIZE ();
-public static final native int NFDBITS ();
+//public static final native int FD_SETSIZE ();
+//public static final native int NFDBITS ();
+public static final native int fd_set_sizeof ();
public static final synchronized native int ConnectionNumber (int display);
public static final synchronized native int XtAppAddInput (int app_context, int source, int condition, int proc, int client_data);
public static final synchronized native void XtRemoveInput (int id);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java index f25b8047a3..fc7a4e879c 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java @@ -1090,7 +1090,7 @@ void initializeDisplay () { read_fd = filedes [0]; write_fd = filedes [1];
int xtContext = OS.XtDisplayToApplicationContext (xDisplay);
inputID = OS.XtAppAddInput (xtContext, read_fd, OS.XtInputReadMask, wakeProc, 0);
- fd_set = new byte [4 * OS.FD_SETSIZE() / OS.NFDBITS()];
+ fd_set = new byte [OS.fd_set_sizeof ()];
/*
* Use dynamic Drag and Drop Protocol styles.
|