Revisit the name mangling rule usage for the '$' character (method and filenames named differently) #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@jodersky also mentioned that it works here without extra rules for
$
.This PR is made to check what's going on with the header functions generation.
Closes #36 (eventually)
Context
JDK8 javah preserves a specific file naming when dealing with generating methods for Scala objects. It generates filenames for objects that contain
$
(all Scala objects) aspackage_ObjectName__.h
(mangles$
into__
). However, methods mangling is a bit different and for all methods it converts$
into_00024
.Right now in the master branch, for the following
Adder.scala
:The following
multiclasses_Adder__.h
would be generated:With this PR the following
multiclasses_Adder__.h
would be generated:cc @jodersky do we need to preserve the original jdk8 javah filename?
The alternative can be just to remove a special case around
$
and use the new namings generated by gjavah:multiclasses_Adder_00024.h
which can be a bit more obvious (i.e. I would expectmulticlasses_Adder_00024
methods to be stored in amulticlasses_Adder_00024.h
file).TLDR; the whole difference in behavior is in this diff: pomadchin@ea4ecc8