+2019-09-17 Dmitriy Anisimkov <anisimko@adacore.com>
+
+ * make_util.ads (On_Windows): Move...
+ * osint.ads (On_Windows): There.
+ * osint.adb (OS_Time_To_GNAT_Time): If odd incremented on
+ Windows before conversion to Time_Stamp_Type.
+
2019-09-17 Yannick Moy <moy@adacore.com>
* sem_spark.adb (Check_Declaration): Do not check the assignment
-- Name of the configuration file used by gprbuild and generated by
-- gprconfig by default.
- On_Windows : constant Boolean := Directory_Separator = '\';
+ On_Windows : Boolean renames Osint.On_Windows;
-- True when on Windows
Source_Info_Option : constant String := "--source-info=";
function OS_Time_To_GNAT_Time (T : OS_Time) return Time_Stamp_Type;
-- Convert OS format time to GNAT format time stamp. If T is Invalid_Time,
-- then returns Empty_Time_Stamp.
+ -- Round to even seconds on Windows before conversion.
+ -- Windows ALI files had timestamps rounded to even seconds historically.
+ -- The rounding was originally done in GM_Split. Now that GM_Split no
+ -- longer does it, we are rounding it here only for ALI files.
function Executable_Prefix return String_Ptr;
-- Returns the name of the root directory where the executable is stored.
function OS_Time_To_GNAT_Time (T : OS_Time) return Time_Stamp_Type is
GNAT_Time : Time_Stamp_Type;
+ TI : Long_Integer := To_C (T);
Y : Year_Type;
Mo : Month_Type;
D : Day_Type;
return Empty_Time_Stamp;
end if;
- GM_Split (T, Y, Mo, D, H, Mn, S);
+ if On_Windows and then TI mod 2 > 0 then
+ -- Windows ALI files had timestamps rounded to even seconds
+ -- historically. The rounding was originally done in GM_Split.
+ -- Now that GM_Split no longer does it, we are rounding it here
+ -- only for ALI files.
+
+ TI := TI + 1;
+ end if;
+
+ GM_Split (To_Ada (TI), Y, Mo, D, H, Mn, S);
+
Make_Time_Stamp
(Year => Nat (Y),
Month => Nat (Mo),
-- File descriptor for current library info, list, tree, C, H, or binder
-- output. Only one of these is open at a time, so we need only one FD.
+ On_Windows : constant Boolean := Directory_Separator = '\';
+ -- True when on Windows
+
procedure Initialize;
-- Initialize internal tables