fpc/rtl/java/system.pp
Jonas Maebe 8a95a04e16 * extracted dynarray helpers from system unit into jdynarr.inc (were
in the system unit for easier debugging)
  * disabled a bunch more feature flags by default for the JVM target
  * incorporate modified version of inc/systemh.inc (split into two parts:
    jsystemh_types.inc and jsystemh.inc, because some of the types are
    required for the declaration of the shortstring/ansistring/set/...
    classes, which in turn are required for the routine declarations) and
    inc/system.inc (as jsystem.inc)
   o moved some routines around from old to new locations based on where
     they appear in the common files
   o added a number of defines that allow skipping more common implementations
     in case a platform-specific one is already available
  * all base classes (AnsistringClass etc) are now descendants of
    JLObject rather than TObject, because their declaration is now parsed
    before TObject is known (and there's no need for them to inherit from
    TObject)
  * incorporate modified version of inc/system.inc
  * use the common version of generic.inc, currh.inc, gencurr.inc and
    genmath.inc (with small modification to those files)
  + addition of quite a bit of system unit functionality (halt, runerror,
    random, round, str() for integer types, abs, odd, endian swapping helpers,
    bit scanning, trigonometric functions, ln, exp, ...)
   o round()/trunc() for comp-types has been renamed trunc_comp() on the
     JVM target because their JVM signature conflicts with trunc(currency)
   o the unsigned versions of swapendian() and other endian helpers are not
     available on the JVM target because of JVM signature conflicts

git-svn-id: branches/jvmbackend@18746 -
2011-08-20 08:32:13 +00:00

120 lines
3.1 KiB
ObjectPascal

{
This file is part of the Free Pascal run time library.
Copyright (c) 2006 by Florian Klaempfl
member of the Free Pascal development team.
System unit for embedded systems
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
Unit system;
{$namespace org.freepascal.rtl}
{*****************************************************************************}
interface
{*****************************************************************************}
{$define FPC_IS_SYSTEM}
{$I-,Q-,H-,R-,V-,P+,T+}
{$implicitexceptions off}
{$mode objfpc}
Type
{ Java primitive types }
jboolean = boolean;
jbyte = shortint;
jshort = smallint;
jint = longint;
jlong = int64;
jchar = widechar;
jfloat = single;
jdouble = double;
Arr1jboolean = array of jboolean;
Arr1jbyte = array of jbyte;
Arr1jshort = array of jshort;
Arr1jint = array of jint;
Arr1jlong = array of jlong;
Arr1jchar = array of jchar;
Arr1jfloat = array of jfloat;
Arr1jdouble = array of jdouble;
Arr2jboolean = array of Arr1jboolean;
Arr2jbyte = array of Arr1jbyte;
Arr2jshort = array of Arr1jshort;
Arr2jint = array of Arr1jint;
Arr2jlong = array of Arr1jlong;
Arr2jchar = array of Arr1jchar;
Arr2jfloat = array of Arr1jfloat;
Arr2jdouble = array of Arr1jdouble;
Arr3jboolean = array of Arr2jboolean;
Arr3jbyte = array of Arr2jbyte;
Arr3jshort = array of Arr2jshort;
Arr3jint = array of Arr2jint;
Arr3jlong = array of Arr2jlong;
Arr3jchar = array of Arr2jchar;
Arr3jfloat = array of Arr2jfloat;
Arr3jdouble = array of Arr2jdouble;
const
maxExitCode = 255;
{ Java base class type }
{$i java_sysh.inc}
{$i java_sys.inc}
FpcEnumValueObtainable = interface
function fpcOrdinal: jint;
function fpcGenericValueOf(__fpc_int: longint): JLEnum;
end;
{$i jrech.inc}
{$i jseth.inc}
{$i jpvarh.inc}
{$i jsystemh_types.inc}
{$i sstringh.inc}
{$i jdynarrh.inc}
{$i astringh.inc}
{$i jsystemh.inc}
{$i compproc.inc}
{*****************************************************************************}
implementation
{*****************************************************************************}
{$i jdynarr.inc}
{*****************************************************************************
Misc. System Dependent Functions
*****************************************************************************}
procedure System_exit;
begin
JLRuntime.getRuntime.exit(ExitCode);
end;
procedure randomize;
begin
randseed:=JUCalendar.getInstance.getTimeInMillis;
end;
{*****************************************************************************
SystemUnit Initialization
*****************************************************************************}
end.