public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [java] [mingw] Fix (typos) compile errors.
@ 2010-08-12  0:25 Dmitrijs Ledkovs
  2010-08-12  8:59 ` Andrew Haley
  2010-08-12 16:22 ` Tom Tromey
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitrijs Ledkovs @ 2010-08-12  0:25 UTC (permalink / raw)
  To: java-patches; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 849 bytes --]


fix natVMSecureRandomWin32.cc for *-*-mingw32 targets.

When compiling build/host=i686-gnu-linux, target=i686-w64-mingw32. Libjava fails like so:

gnu/java/security/jce/prng/natVMSecureRandom.cc: In static member function 'static jint gnu::java::security::jce::prng::VMSecureRandom::natGenerateSeed(jbyteArray, jint, jint)':
gnu/java/security/jce/prng/natVMSecureRandom.cc:29:15: error: expected type-specifier
gnu/java/security/jce/prng/natVMSecureRandom.cc:29:15: error: expected ';'
gnu/java/security/jce/prng/natVMSecureRandom.cc: At global scope:
gnu/java/security/jce/prng/natVMSecureRandom.cc:26:1: warning: unused parameter 'byte_array' [-Wunused-parameter]
gnu/java/security/jce/prng/natVMSecureRandom.cc:26:1: warning: unused parameter 'offset' [-Wunused-parameter]
make[4]: *** [gnu/java/security/jce/prng/natVMSecureRandom.lo] Error 1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: java-typos.patch --]
[-- Type: text/x-diff, Size: 1436 bytes --]

From 5ddf060889cd985f2c9373ebd5941bc942bb5cfc Mon Sep 17 00:00:00 2001
From: Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com>
Date: Sun, 25 Jul 2010 17:01:49 +0100
Subject: [PATCH 1/2] 2010-07-25  Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com>

        * gnu/java/security/jce/prng/natVMSecureRandomWin32.cc: Fix compile
        errors.
---
 .../security/jce/prng/natVMSecureRandomWin32.cc    |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
 mode change 100755 => 100644 libjava/gnu/java/security/jce/prng/natVMSecureRandomWin32.cc

diff --git a/libjava/gnu/java/security/jce/prng/natVMSecureRandomWin32.cc b/libjava/gnu/java/security/jce/prng/natVMSecureRandomWin32.cc
old mode 100755
new mode 100644
index 1a9d0d3..f557315
--- a/libjava/gnu/java/security/jce/prng/natVMSecureRandomWin32.cc
+++ b/libjava/gnu/java/security/jce/prng/natVMSecureRandomWin32.cc
@@ -26,8 +26,11 @@ jint
 gnu::java::security::jce::prng::VMSecureRandom::natGenerateSeed(jbyteArray byte_array, jint offset, jint length)
 {
   if (length != 0)
-    throw new java::lang::UnsupportedOperationException (
-      JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target."));
+  {
+      jstring oserr = JvNewStringLatin1 (strerror (errno));
+      throw new ::java::lang::UnsupportedOperationException
+         (JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target.")->concat(oserr));
+  }
   return 0;
 }
 
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [java] [mingw] Fix (typos) compile errors.
  2010-08-12  0:25 [java] [mingw] Fix (typos) compile errors Dmitrijs Ledkovs
@ 2010-08-12  8:59 ` Andrew Haley
  2010-08-12 16:22 ` Tom Tromey
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Haley @ 2010-08-12  8:59 UTC (permalink / raw)
  To: Dmitrijs Ledkovs; +Cc: java-patches, gcc-patches

On 08/12/2010 01:15 AM, Dmitrijs Ledkovs wrote:
>         * gnu/java/security/jce/prng/natVMSecureRandomWin32.cc: Fix compile
>         errors.

OK.

Andrew.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [java] [mingw] Fix (typos) compile errors.
  2010-08-12  0:25 [java] [mingw] Fix (typos) compile errors Dmitrijs Ledkovs
  2010-08-12  8:59 ` Andrew Haley
@ 2010-08-12 16:22 ` Tom Tromey
  2010-08-12 17:20   ` Dmitrijs Ledkovs
  1 sibling, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2010-08-12 16:22 UTC (permalink / raw)
  To: Dmitrijs Ledkovs; +Cc: gcc-patches, java-patches

>>>>> "Dmitrijs" == Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> writes:

Dmitrijs> +  {
Dmitrijs> +      jstring oserr = JvNewStringLatin1 (strerror (errno));
Dmitrijs> +      throw new ::java::lang::UnsupportedOperationException
Dmitrijs> +         (JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target.")->concat(oserr));
Dmitrijs> +  }


Andrew> OK.

Actually, I don't think this is ok.

Nothing sets errno here, so using it is incorrect.
And, even if it were correct, the error message would be formatted
strangely.

Based on the error messages, I think all that is needed here is the
addition of a "::" before "java".

Dmitrijs, could you test the appended?

Tom

Index: natVMSecureRandomWin32.cc
===================================================================
--- natVMSecureRandomWin32.cc	(revision 162345)
+++ natVMSecureRandomWin32.cc	(working copy)
@@ -1,6 +1,6 @@
 // natVMSecureRandomWin32.cc - Native part of VMSecureRandom class for Win32.
 
-/* Copyright (C) 2009 Free Software Foundation
+/* Copyright (C) 2009, 2010 Free Software Foundation
 
    This file is part of libgcj.
 
@@ -26,7 +26,7 @@
 gnu::java::security::jce::prng::VMSecureRandom::natGenerateSeed(jbyteArray byte_array, jint offset, jint length)
 {
   if (length != 0)
-    throw new java::lang::UnsupportedOperationException (
+    throw new ::java::lang::UnsupportedOperationException (
       JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target."));
   return 0;
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [java] [mingw] Fix (typos) compile errors.
  2010-08-12 16:22 ` Tom Tromey
@ 2010-08-12 17:20   ` Dmitrijs Ledkovs
  2010-08-12 18:22     ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitrijs Ledkovs @ 2010-08-12 17:20 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gcc-patches, java-patches

Tom Tromey <tromey@redhat.com> writes:

>>>>>> "Dmitrijs" == Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> writes:
>
> Dmitrijs> +  {
> Dmitrijs> +      jstring oserr = JvNewStringLatin1 (strerror (errno));
> Dmitrijs> +      throw new ::java::lang::UnsupportedOperationException
> Dmitrijs> +         (JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target.")->concat(oserr));
> Dmitrijs> +  }
>
>
> Andrew> OK.
>
> Actually, I don't think this is ok.
>

I was just copying from the natVMSecureRandomPosix.cc

> Nothing sets errno here, so using it is incorrect.
> And, even if it were correct, the error message would be formatted
> strangely.
>
> Based on the error messages, I think all that is needed here is the
> addition of a "::" before "java".
>
> Dmitrijs, could you test the appended?
>

Works fine with target i686-w64-mingw32. Please apply.

> Tom
>
> Index: natVMSecureRandomWin32.cc
> ===================================================================
> --- natVMSecureRandomWin32.cc	(revision 162345)
> +++ natVMSecureRandomWin32.cc	(working copy)
> @@ -1,6 +1,6 @@
>  // natVMSecureRandomWin32.cc - Native part of VMSecureRandom class for Win32.
>  
> -/* Copyright (C) 2009 Free Software Foundation
> +/* Copyright (C) 2009, 2010 Free Software Foundation
>  
>     This file is part of libgcj.
>  
> @@ -26,7 +26,7 @@
>  gnu::java::security::jce::prng::VMSecureRandom::natGenerateSeed(jbyteArray byte_array, jint offset, jint length)
>  {
>    if (length != 0)
> -    throw new java::lang::UnsupportedOperationException (
> +    throw new ::java::lang::UnsupportedOperationException (
>        JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target."));
>    return 0;
>  }

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [java] [mingw] Fix (typos) compile errors.
  2010-08-12 17:20   ` Dmitrijs Ledkovs
@ 2010-08-12 18:22     ` Tom Tromey
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2010-08-12 18:22 UTC (permalink / raw)
  To: Dmitrijs Ledkovs; +Cc: gcc-patches, java-patches

>>>>> "Dmitrijs" == Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> writes:

Dmitrijs> Works fine with target i686-w64-mingw32. Please apply.

Here is what I am checking in.

Tom

2010-08-12  Tom Tromey  <tromey@redhat.com>

	* gnu/java/security/jce/prng/natVMSecureRandomWin32.cc
	(natGenerateSeed): Add missing "::".

Index: gnu/java/security/jce/prng/natVMSecureRandomWin32.cc
===================================================================
--- gnu/java/security/jce/prng/natVMSecureRandomWin32.cc	(revision 163197)
+++ gnu/java/security/jce/prng/natVMSecureRandomWin32.cc	(working copy)
@@ -1,6 +1,6 @@
 // natVMSecureRandomWin32.cc - Native part of VMSecureRandom class for Win32.
 
-/* Copyright (C) 2009 Free Software Foundation
+/* Copyright (C) 2009, 2010 Free Software Foundation
 
    This file is part of libgcj.
 
@@ -26,7 +26,7 @@
 gnu::java::security::jce::prng::VMSecureRandom::natGenerateSeed(jbyteArray byte_array, jint offset, jint length)
 {
   if (length != 0)
-    throw new java::lang::UnsupportedOperationException (
+    throw new ::java::lang::UnsupportedOperationException (
       JvNewStringLatin1 ("natGenerateSeed is not available for Win32 target."));
   return 0;
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-12 18:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-12  0:25 [java] [mingw] Fix (typos) compile errors Dmitrijs Ledkovs
2010-08-12  8:59 ` Andrew Haley
2010-08-12 16:22 ` Tom Tromey
2010-08-12 17:20   ` Dmitrijs Ledkovs
2010-08-12 18:22     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).