Message ID | CAMe9rOoPj441p7Zt4=XhQx72FG6vSf=pv3Zu39PYBTVE-k+==g@mail.gmail.com |
---|---|
State | New |
Headers | show |
> >> I am not familiar with Ada. Can you recommend how to fix it? > > > > Can you send a diff between the *-linux files and your new files? This > > should help giving some options. > > > > This is the total diff. OK so I would declare a new type in System.Linux (e.g. time_t), have a new variant of s-linux for x32, and use this new type everywhere in your patch where we're using long and where you've used Long_Long_Integer This way you only have to introduce an extra s-linux-x32.ads and keep everything else shared. Arno
On Thu, Nov 14, 2013 at 2:30 AM, Arnaud Charlet <charlet@adacore.com> wrote: >> >> I am not familiar with Ada. Can you recommend how to fix it? >> > >> > Can you send a diff between the *-linux files and your new files? This >> > should help giving some options. >> > >> >> This is the total diff. > > OK so I would declare a new type in System.Linux (e.g. time_t), > have a new variant of s-linux for x32, and use this new type everywhere in > your patch where we're using long and where you've used Long_Long_Integer I also changed s-osinte-posix.adb and s-osprim-posix.adb for x32. They aren't Linux specific. What should I do with them? > This way you only have to introduce an extra s-linux-x32.ads and keep > everything else shared. > > Arno
> I also changed s-osinte-posix.adb and s-osprim-posix.adb > for x32. They aren't Linux specific. What should I do with > them? I would use the time_t type defined in s-osinte* (all POSIX implementations of s-osinte* have such definition, or if they don't, it's easy to add), and in the s-osinte-linux version we can have a renaming: subtype time_t is System.Linux.time_t and in System.Linux have either: type time_t is new Long_Integer; or type time_t is new Long_Long_Integer; depending on the variant. Arno
On Thu, Nov 14, 2013 at 6:16 AM, Arnaud Charlet <charlet@adacore.com> wrote: >> I also changed s-osinte-posix.adb and s-osprim-posix.adb >> for x32. They aren't Linux specific. What should I do with >> them? > > I would use the time_t type defined in s-osinte* (all POSIX implementations > of s-osinte* have such definition, or if they don't, it's easy to add), and > in the s-osinte-linux version we can have a renaming: > > subtype time_t is System.Linux.time_t > > and in System.Linux have either: > > type time_t is new Long_Integer; > > or > > type time_t is new Long_Long_Integer; > > depending on the variant. > > Arno Another problem. s-osprim-posix.adb has -- ??? These definitions are duplicated from System.OS_Interface -- because we don't want to depend on any package. Consider removing -- these declarations in System.OS_Interface and move these ones in -- the spec. I can't use time_t from s-osinte-linux.ads since System.OS_Interface isn't available. What should I do?
--- s-osinte-linux.ads 2013-11-13 09:34:14.214149918 -0800 +++ s-osinte-linux-x32.ads 2013-11-13 15:23:14.710394049 -0800 @@ -596,11 +596,11 @@ private type pid_t is new int; - type time_t is new long; + type time_t is new Long_Long_Integer; type timespec is record tv_sec : time_t; - tv_nsec : long; + tv_nsec : Long_Long_Integer; end record; pragma Convention (C, timespec); --- s-osinte-posix.adb 2011-10-14 10:59:25.705507873 -0700 +++ s-osinte-linux-x32.adb 2013-11-13 15:23:14.709394072 -0800 @@ -104,7 +104,7 @@ package body System.OS_Interface is end if; return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); + tv_nsec => Long_Long_Integer (F * 10#1#E9)); end To_Timespec; end System.OS_Interface; --- s-osprim-posix.adb 2010-02-22 14:11:20.000000000 -0800 +++ s-osprim-linux-x32.adb 2013-11-13 15:23:14.710394049 -0800 @@ -38,11 +38,11 @@ package body System.OS_Primitives is -- these declarations in System.OS_Interface and move these ones in -- the spec. - type time_t is new Long_Integer; + type time_t is new Long_Long_Integer; type timespec is record tv_sec : time_t; - tv_nsec : Long_Integer; + tv_nsec : Long_Long_Integer; end record; pragma Convention (C, timespec); @@ -54,7 +54,7 @@ package body System.OS_Primitives is ----------- function Clock return Duration is - type timeval is array (1 .. 2) of Long_Integer; + type timeval is array (1 .. 2) of Long_Long_Integer; procedure timeval_to_duration (T : not null access timeval; @@ -118,7 +118,7 @@ package body System.OS_Primitives is return timespec'(tv_sec => S, - tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9))); + tv_nsec => Long_Long_Integer (F * 10#1#E9)); end To_Timespec; ----------------- --- s-taprop-linux.adb 2013-11-13 09:34:14.220149775 -0800 +++ s-taprop-linux-x32.adb 2013-11-13 15:23:14.710394049 -0800 @@ -627,7 +627,7 @@ package body System.Task_Primitives.Oper function Monotonic_Clock return Duration is use Interfaces; - type timeval is array (1 .. 2) of C.long; + type timeval is array (1 .. 2) of Long_Long_Integer; procedure timeval_to_duration (T : not null access timeval;