Здравствуйте.
В Visual C++ можно при компиляции выкинуть rtl, можно ли такое сотворить во freepascal'е
			
		Модератор: Модераторы
Здравствуйте.
В Visual C++ можно при компиляции выкинуть rtl, можно ли такое сотворить во freepascal'е

Dim писал(а):Здравствуйте.
В Visual C++ можно при компиляции выкинуть rtl, можно ли такое сотворить во freepascal'е

 
Dim писал(а):Здравствуйте.
В Visual C++ можно при компиляции выкинуть rtl, можно ли такое сотворить во freepascal'е

Юра писал(а):Смысла особого я в этом не вижу, кроме написания своей ОС или еще чего-то низкоуровневого.

unit system;
interface
type
  { The compiler has all integer types defined internally. Here
    we define only aliases }
  DWord    = LongWord;
  Cardinal = LongWord;
  Integer  = SmallInt;
{$ifdef CPUI386}
  {$define CPU32}
  {$define DEFAULT_EXTENDED}
  {$define SUPPORT_SINGLE}
  {$define SUPPORT_DOUBLE}
  {$define SUPPORT_EXTENDED}
  {$define SUPPORT_COMP}
  ValReal = Extended;
{$endif CPUI386}
{$ifdef CPUX86_64}
{$ifndef WIN64}
  { win64 doesn't support the legacy fpu }
  {$define DEFAULT_EXTENDED}
  {$define SUPPORT_EXTENDED}
  {$define SUPPORT_COMP}
  ValReal = Extended;
{$else WIN64}
  {$define DEFAULT_DOUBLE}
  ValReal = Double;
  { map comp to int64, but this doesn't mean we compile the comp support in! }
  Comp = Int64;
  PComp = ^Comp;
{$endif WIN64}
  {$define SUPPORT_SINGLE}
  {$define SUPPORT_DOUBLE}
{$endif CPUX86_64}
{$ifdef CPUM68K}
  ValReal = Real;
  {$define SUPPORT_SINGLE}
  {$IFDEF Unix}
    { Linux FPU emulator will be used }
    {$define SUPPORT_DOUBLE}
  {$ENDIF}
  {$IFOPT E-}
    { If not compiling with emulation }
    { then support double type.       }
    {$define SUPPORT_DOUBLE}
  {$ENDIF}
  { Comp type does not exist on fpu }
  Comp    = int64;
  PComp = ^Comp;
  FarPointer = Pointer;
{$endif CPUM68K}
{$ifdef CPUPOWERPC}
  {$define DEFAULT_DOUBLE}
  {$define SUPPORT_SINGLE}
  {$define SUPPORT_DOUBLE}
  {$define FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
  ValReal = Double;
  { map comp to int64, but this doesn't mean we compile the comp support in! }
  Comp = Int64;
  PComp = ^Comp;
  FarPointer = Pointer;
{$endif CPUPOWERPC}
{$ifdef CPUSPARC}
  {$define DEFAULT_DOUBLE}
  {$define SUPPORT_SINGLE}
  {$define SUPPORT_DOUBLE}
  {$define FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
  ValReal = Double;
  { map comp to int64, but this doesn't mean we compile the comp support in! }
  Comp = Int64;
  PComp = ^Comp;
  FarPointer = Pointer;
{$endif CPUSPARC}
{$ifdef CPUARM}
  {$define DEFAULT_DOUBLE}
  {$define SUPPORT_SINGLE}
  {$define SUPPORT_DOUBLE}
  {$define FPC_INCLUDE_SOFTWARE_MOD_DIV}
  {$define FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
  {$define FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
  ValReal = Real;
  { map comp to int64, but this doesn't mean we compile the comp support in! }
  Comp = Int64;
  PComp = ^Comp;
  FarPointer = Pointer;
{$endif CPUARM}
{$ifdef CPU64}
  SizeInt = Int64;
  SizeUInt = QWord;
  PtrInt = Int64;
  PtrUInt = QWord;
  ValSInt = int64;
  ValUInt = qword;
{$endif CPU64}
{$ifdef CPU32}
  SizeInt = Longint;
  SizeUInt = DWord;
  PtrInt = Longint;
  PtrUInt = DWord;
  ValSInt = Longint;
  ValUInt = Cardinal;
{$endif CPU32}
{ Zero - terminated strings }
  PChar               = ^Char;
  PPChar              = ^PChar;
  { AnsiChar is equivalent of Char, so we need
    to use type renamings }
  TAnsiChar           = Char;
  AnsiChar            = Char;
  PAnsiChar           = PChar;
  PPAnsiChar          = PPChar;
  UCS4Char            = type LongWord;
  PUCS4Char           = ^UCS4Char;
  TUCS4CharArray      = array[0..$effffff] of UCS4Char;
  PUCS4CharArray      = ^TUCS4CharArray;
  UCS4String          = array of UCS4Char;
  UTF8String          = type ansistring;
  PUTF8String         = ^UTF8String;
  HRESULT             = type Longint;
  TDateTime           = type Double;
  TError               = type Longint;
  PSingle             = ^Single;
  PDouble             = ^Double;
  PCurrency           = ^Currency;
{$ifdef SUPPORT_COMP}
  PComp               = ^Comp;
{$endif SUPPORT_COMP}
  PExtended           = ^Extended;
  PSmallInt           = ^Smallint;
  PShortInt           = ^Shortint;
  PInteger            = ^Integer;
  PByte               = ^Byte;
  PWord               = ^word;
  PDWord              = ^DWord;
  PLongWord           = ^LongWord;
  PLongint            = ^Longint;
  PCardinal           = ^Cardinal;
  PQWord              = ^QWord;
  PInt64              = ^Int64;
  PPtrInt             = ^PtrInt;
  PSizeInt            = ^SizeInt;
  PPointer            = ^Pointer;
  PPPointer           = ^PPointer;
  PBoolean            = ^Boolean;
  PWordBool           = ^WordBool;
  PLongBool           = ^LongBool;
  PShortString        = ^ShortString;
  PAnsiString         = ^AnsiString;
  PDate               = ^TDateTime;
  PError              = ^TError;
  PVariant            = ^Variant;
  POleVariant         = ^OleVariant;
  PWideChar           = ^WideChar;
  PPWideChar          = ^PWideChar;
  WChar               = Widechar;
  UCS2Char            = WideChar;
  PUCS2Char           = PWideChar;
  PWideString         = ^WideString;
  { Needed for fpc_get_output }
  PText               = ^Text;
  TTextLineBreakStyle = (tlbsLF,tlbsCRLF,tlbsCR);
{ procedure type }
  TProcedure  = Procedure;
procedure FPC_INITIALIZEUNITS; compilerproc;
var
  DLLreason,DLLparam:DWord;
implementation
//----------
procedure fpc_InitializeUnits;[public,alias:'FPC_INITIALIZEUNITS']; compilerproc;
begin
end;
Procedure do_exit;[Public,Alias:'FPC_DO_EXIT'];
begin
end;
procedure PascalMain;stdcall;external name 'PASCALMAIN';
procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
begin
  PascalMain;
end;
Const
  { DllEntryPoint  }
     DLL_PROCESS_ATTACH = 1;
     DLL_THREAD_ATTACH = 2;
     DLL_PROCESS_DETACH = 0;
     DLL_THREAD_DETACH = 3;
     
function Dll_entry : longbool;[public, alias : '_FPC_DLL_Entry'];
var
  res : longbool;
begin
//   IsLibrary:=true;
   Dll_entry:=false;
   case DLLreason of
     DLL_PROCESS_ATTACH :
       begin
         PASCALMAIN;
         Dll_entry:=true;
       end;
     DLL_THREAD_ATTACH :
       begin
       end;
     DLL_THREAD_DETACH :
       begin
       end;
     DLL_PROCESS_DETACH :
       begin
         do_exit;
       end;
   end;
end;
procedure _FPC_DLLWinMainCRTStartup(_hinstance,_dllreason,_dllparam:longint);stdcall;public name '_DLLWinMainCRTStartup';
begin
  dllreason:=_dllreason;
  dllparam:=_dllparam;
  DLL_Entry;
end;
procedure _FPC_DLLMainCRTStartup(_hinstance,_dllreason,_dllparam:longint);stdcall;public name '_DLLMainCRTStartup';
begin
  dllreason:=_dllreason;
  dllparam:=_dllparam;
  DLL_Entry;
end;
procedure _FPC_mainCRTStartup;stdcall;public name '_mainCRTStartup';
begin
  Exe_entry;
end;
procedure _FPC_WinMainCRTStartup;stdcall;public name '_WinMainCRTStartup';
begin
  Exe_entry;
end;
begin
end.
Вернуться в Free Pascal Compiler
Сейчас этот форум просматривают: Yandex [Bot] и гости: 1