Commit 3217b0f3 by Per Bothner

gjavah.c (generate_access): Translate Java package private or protected access to C++ public...

0
	* gjavah.c (generate_access):  Translate Java package private or
	protected access to C++ public, but with a comment.

From-SVN: r24695
parent 19e1d311
...@@ -250,19 +250,15 @@ generate_access (stream, flags) ...@@ -250,19 +250,15 @@ generate_access (stream, flags)
FILE *stream; FILE *stream;
JCF_u2 flags; JCF_u2 flags;
{ {
/* FIXME: Java's "protected" and "no access specifier" modes don't
actually map to C++ "protected". That's how we map them for now,
though. */
if (! (flags & ACC_VISIBILITY))
flags = ACC_PROTECTED;
if ((flags & ACC_VISIBILITY) == last_access) if ((flags & ACC_VISIBILITY) == last_access)
return; return;
last_access = (flags & ACC_VISIBILITY); last_access = (flags & ACC_VISIBILITY);
switch (last_access) switch (last_access)
{ {
case 0:
fputs ("public: // actually package-private\n", stream);
break;
case ACC_PUBLIC: case ACC_PUBLIC:
fputs ("public:\n", stream); fputs ("public:\n", stream);
break; break;
...@@ -270,7 +266,7 @@ generate_access (stream, flags) ...@@ -270,7 +266,7 @@ generate_access (stream, flags)
fputs ("private:\n", stream); fputs ("private:\n", stream);
break; break;
case ACC_PROTECTED: case ACC_PROTECTED:
fputs ("protected:\n", stream); fputs ("public: // actually protected\n", stream);
break; break;
default: default:
found_error = 1; found_error = 1;
...@@ -840,7 +836,7 @@ DEFUN(process_file, (jcf, out), ...@@ -840,7 +836,7 @@ DEFUN(process_file, (jcf, out),
current_jcf = main_jcf = jcf; current_jcf = main_jcf = jcf;
last_access = 0; last_access = -1;
if (jcf_parse_preamble (jcf) != 0) if (jcf_parse_preamble (jcf) != 0)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment