On 07 Nov 2011, at 13:46, michael.vancann...@wisa.be wrote:

On Mon, 7 Nov 2011, Jonas Maebe wrote:

Yes (once THandle is added to the JVM RTL and it is defined to Pointer or JLObject, at least :). It's generally a PrintStream: http://download.oracle.com/javase/1,5.0/docs/api/java/lang/System.html#out

Do you have a preference for either of them ?

No, it doesn't matter. Pointer is probably more in line with the rest of the source code. As far as the compiler is concerned, they're the same thing.

There is however some functionality (e.g. writestr with ansistring) that uses the UserData byte array to store a pointer, which won't work on the JVM target. Some extra classes will also have to be moved from the jdk15 unit to the system unit to implement the functionality.

That brings me to my second question/remark: (which I had already prepared before sending my first mail ;) ):

It would be easier if the system unit could depend on jdk15 in the
implementation section.

However, this is something that FPC never has been able to do, while Delphi can. It would be good if FPC could do the same, it would make some system units easier to manage. (in casu: the Java one)

Well, in that case we could just get rid of the jdk15 unit altogether and put everything directly in the system unit. The main reason I didn't do that is because it makes loading the system unit slower due to the tons of definitions (otoh, most "real" programs will probably use the jdk15 unit one way or another anyway). It's true that the downside is that occasionally definitions have to be moved from the jdk15 unit to the system unit.


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to