Mercurial > hg > CbC > CbC_gcc
diff gcc/ada/osint.ads @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/ada/osint.ads Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/ada/osint.ads Thu Oct 25 07:37:49 2018 +0900 @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2017, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2018, 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- -- @@ -255,10 +255,26 @@ -- from the disk and then cached in the File_Attributes parameter (possibly -- along with other values). - type File_Attributes is private; - Unknown_Attributes : constant File_Attributes; + File_Attributes_Size : constant Natural := 32; + -- This should be big enough to fit a "struct file_attributes" on any + -- system. It doesn't cause any malfunction if it is too big (which avoids + -- the need for either mapping the struct exactly or importing the sizeof + -- from C, which would result in dynamic code). However, it does waste + -- space (e.g. when a component of this type appears in a record, if it is + -- unnecessarily large). Note: for runtime units, use System.OS_Constants. + -- SIZEOF_struct_file_attributes instead, which has the exact value. + + type File_Attributes is + array (1 .. File_Attributes_Size) + of System.Storage_Elements.Storage_Element; + for File_Attributes'Alignment use Standard'Maximum_Alignment; + + Unknown_Attributes : File_Attributes; -- A cache for various attributes for a file (length, accessibility,...) - -- This must be initialized to Unknown_Attributes prior to the first call. + -- Will be initialized properly at elaboration (for efficiency later on, + -- avoid function calls every time we want to reset the attributes) prior + -- to the first usage. We cannot make it constant since the compiler may + -- put it in a read-only section. function Is_Directory (Name : C_File_Name; @@ -754,22 +770,4 @@ -- detected, the file being written is deleted, and a fatal error is -- signalled. - File_Attributes_Size : constant Natural := 32; - -- This should be big enough to fit a "struct file_attributes" on any - -- system. It doesn't cause any malfunction if it is too big (which avoids - -- the need for either mapping the struct exactly or importing the sizeof - -- from C, which would result in dynamic code). However, it does waste - -- space (e.g. when a component of this type appears in a record, if it is - -- unnecessarily large). Note: for runtime units, use System.OS_Constants. - -- SIZEOF_struct_file_attributes instead, which has the exact value. - - type File_Attributes is - array (1 .. File_Attributes_Size) - of System.Storage_Elements.Storage_Element; - for File_Attributes'Alignment use Standard'Maximum_Alignment; - - Unknown_Attributes : constant File_Attributes := (others => 0); - -- Will be initialized properly at elaboration (for efficiency later on, - -- avoid function calls every time we want to reset the attributes). - end Osint;