Re: [patch libjava]: Add missing file for Win32

Kai Tietz <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <OF823939BF.857E1D3B-ONC12575FD.003DCAE5-C12575FD.003DFA1F@onevision.de>
Andrew Haley <[email protected]> wrote on 24.07.2009 13:03:28:

> On 07/24/2009 11:19 AM, Kai Tietz wrote:
> 
> > This patch adds dummy implementation for 
> > gnu/java/security/jce/prng/natVMSecureRandomWin32.cc file for Win32 
build. 
> > It throws just an exception for not supporting this method.
> 
> This should be an UnsupportedOperationException.
> 
> Andrew.
> 

Ok, adjusted.

Kai

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
w32_java.diff (application/octet-stream, 1.2 KB)
Index: gcc/libjava/gnu/java/security/jce/prng/natVMSecureRandomWin32.cc
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ gcc/libjava/gnu/java/security/jce/prng/natVMSecureRandomWin32.cc	2009-07-24 13:14:44.000916000 +0200
@@ -0,0 +1,32 @@
+// natVMSecureRandomWin32.cc - Native part of VMSecureRandom class for Win32.
+
+/* Copyright (C) 2009 Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+#include <gcj/cni.h>
+#include <java/lang/InternalError.h>
+#include <gnu/java/security/jce/prng/VMSecureRandom.h>
+
+jint
+gnu::java::security::jce::prng::VMSecureRandom::natGenerateSeed(jbyteArray byte_array, jint offset, jint length)
+{
+  if (length != 0)
+    throw new UnsupportedOperationException (
+      JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target."));
+  return 0;
+}
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.