-- --
-- B o d y --
-- --
--- $Revision: 1.14 $
--- --
--- Copyright (C) 1992-1999, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System;
+with System.CRTL;
with System.File_Control_Block;
with System.File_IO;
with System.Storage_Elements;
function To_FCB is new Unchecked_Conversion (File_Mode, FCB.File_Mode);
function To_SIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode);
+ use type System.CRTL.size_t;
+
-----------
-- Close --
-----------
RsizS : constant SSE.Storage_Offset :=
SSE.Storage_Offset (Rsiz - 1);
- subtype SA is SSE.Storage_Array (0 .. RsizS);
+ type SA is new SSE.Storage_Array (0 .. RsizS);
+
+ for SA'Alignment use Standard'Maximum_Alignment;
+ -- We will perform an unchecked conversion of a pointer-to-SA
+ -- into pointer-to-Element_Type. We need to ensure that the
+ -- source is always at least as strictly aligned as the target.
+
type SAP is access all SA;
type ItemP is access all Element_Type;
pragma Warnings (Off);
- -- We have to turn warnings off for this function, because
- -- it gets analyzed for all types, including ones which
- -- can't possibly come this way, and for which the size
- -- of the access types differs.
+ -- We have to turn warnings off for function To_ItemP,
+ -- because it gets analyzed for all types, including ones
+ -- which can't possibly come this way, and for which the
+ -- size of the access types differs.
function To_ItemP is new Unchecked_Conversion (SAP, ItemP);