Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD

2019-07-04 Thread Arnaud Charlet
> checked in. Ok for the gcc-9 branch as well?

Yes.


Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD

2019-07-04 Thread Matthias Klose
On 04.07.19 08:50, Arnaud Charlet wrote:
> OK, thanks.

checked in. Ok for the gcc-9 branch as well?

Matthias

>> From: James Clarke 
>>
>> Monotonic_Clock and RT_Resolution in the recently-added s-tpopmo.adb
>> call clock_gettime/clock_getres with the integral constants from OSC and
>> thus rely on clockid_t being an integral type, so we cannot hide it on
>> GNU/kFreeBSD. Instead, make the definition public to match all the other
>> implementations.
>>
>> gcc/ada
>>  * libgnarl/s-osinte__kfreebsd-gnu.ads (clockid_t): Make type
>>  definition public.
>>  (CLOCK_REALTIME): Make value public.
>> ---
>>  gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads | 8 ++--
>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads 
>> b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
>> index 408187314..b60ffd2c0 100644
>> --- a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
>> +++ b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
>> @@ -206,9 +206,8 @@ package System.OS_Interface is
>> function nanosleep (rqtp, rmtp : access timespec) return int;
>> pragma Import (C, nanosleep, "nanosleep");
>>
>> -   type clockid_t is private;
>> -
>> -   CLOCK_REALTIME : constant clockid_t;
>> +   type clockid_t is new int;
>> +   CLOCK_REALTIME : constant clockid_t := 0;
>>
>> function clock_gettime
>>   (clock_id : clockid_t;
>> @@ -607,9 +606,6 @@ private
>> end record;
>> pragma Convention (C, timespec);
>>
>> -   type clockid_t is new int;
>> -   CLOCK_REALTIME : constant clockid_t := 0;
>> -
>> type pthread_attr_t is record
>>detachstate   : int;
>>schedpolicy   : int;
>> --
>> 2.17.1
>>



Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD

2019-07-04 Thread Arnaud Charlet
> I don't have commit access so could you please do so on my behalf?

No, I won't be able to do that unfortunately.

By the way do you have a copyright assignment in place?

Arno


Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD

2019-07-04 Thread James Clarke
I don't have commit access so could you please do so on my behalf?

This bug applies to the 9 branch too, so please consider backporting it.

Thanks,
James

> On 4 Jul 2019, at 07:50, Arnaud Charlet  wrote:
> 
> OK, thanks.
> 
>> From: James Clarke 
>> 
>> Monotonic_Clock and RT_Resolution in the recently-added s-tpopmo.adb
>> call clock_gettime/clock_getres with the integral constants from OSC and
>> thus rely on clockid_t being an integral type, so we cannot hide it on
>> GNU/kFreeBSD. Instead, make the definition public to match all the other
>> implementations.
>> 
>> gcc/ada
>>  * libgnarl/s-osinte__kfreebsd-gnu.ads (clockid_t): Make type
>>  definition public.
>>  (CLOCK_REALTIME): Make value public.
>> ---
>> gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads | 8 ++--
>> 1 file changed, 2 insertions(+), 6 deletions(-)
>> 
>> diff --git a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads 
>> b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
>> index 408187314..b60ffd2c0 100644
>> --- a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
>> +++ b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
>> @@ -206,9 +206,8 @@ package System.OS_Interface is
>>function nanosleep (rqtp, rmtp : access timespec) return int;
>>pragma Import (C, nanosleep, "nanosleep");
>> 
>> -   type clockid_t is private;
>> -
>> -   CLOCK_REALTIME : constant clockid_t;
>> +   type clockid_t is new int;
>> +   CLOCK_REALTIME : constant clockid_t := 0;
>> 
>>function clock_gettime
>>  (clock_id : clockid_t;
>> @@ -607,9 +606,6 @@ private
>>end record;
>>pragma Convention (C, timespec);
>> 
>> -   type clockid_t is new int;
>> -   CLOCK_REALTIME : constant clockid_t := 0;
>> -
>>type pthread_attr_t is record
>>   detachstate   : int;
>>   schedpolicy   : int;
>> --
>> 2.17.1
>> 



Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD

2019-07-04 Thread Arnaud Charlet
OK, thanks.

> From: James Clarke 
> 
> Monotonic_Clock and RT_Resolution in the recently-added s-tpopmo.adb
> call clock_gettime/clock_getres with the integral constants from OSC and
> thus rely on clockid_t being an integral type, so we cannot hide it on
> GNU/kFreeBSD. Instead, make the definition public to match all the other
> implementations.
> 
> gcc/ada
>   * libgnarl/s-osinte__kfreebsd-gnu.ads (clockid_t): Make type
>   definition public.
>   (CLOCK_REALTIME): Make value public.
> ---
>  gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads | 8 ++--
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads 
> b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
> index 408187314..b60ffd2c0 100644
> --- a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
> +++ b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
> @@ -206,9 +206,8 @@ package System.OS_Interface is
> function nanosleep (rqtp, rmtp : access timespec) return int;
> pragma Import (C, nanosleep, "nanosleep");
> 
> -   type clockid_t is private;
> -
> -   CLOCK_REALTIME : constant clockid_t;
> +   type clockid_t is new int;
> +   CLOCK_REALTIME : constant clockid_t := 0;
> 
> function clock_gettime
>   (clock_id : clockid_t;
> @@ -607,9 +606,6 @@ private
> end record;
> pragma Convention (C, timespec);
> 
> -   type clockid_t is new int;
> -   CLOCK_REALTIME : constant clockid_t := 0;
> -
> type pthread_attr_t is record
>detachstate   : int;
>schedpolicy   : int;
> --
> 2.17.1
> 


[PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD

2019-07-03 Thread James Clarke
From: James Clarke 

Monotonic_Clock and RT_Resolution in the recently-added s-tpopmo.adb
call clock_gettime/clock_getres with the integral constants from OSC and
thus rely on clockid_t being an integral type, so we cannot hide it on
GNU/kFreeBSD. Instead, make the definition public to match all the other
implementations.

gcc/ada
* libgnarl/s-osinte__kfreebsd-gnu.ads (clockid_t): Make type
definition public.
(CLOCK_REALTIME): Make value public.
---
 gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads 
b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
index 408187314..b60ffd2c0 100644
--- a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
+++ b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
@@ -206,9 +206,8 @@ package System.OS_Interface is
function nanosleep (rqtp, rmtp : access timespec) return int;
pragma Import (C, nanosleep, "nanosleep");

-   type clockid_t is private;
-
-   CLOCK_REALTIME : constant clockid_t;
+   type clockid_t is new int;
+   CLOCK_REALTIME : constant clockid_t := 0;

function clock_gettime
  (clock_id : clockid_t;
@@ -607,9 +606,6 @@ private
end record;
pragma Convention (C, timespec);

-   type clockid_t is new int;
-   CLOCK_REALTIME : constant clockid_t := 0;
-
type pthread_attr_t is record
   detachstate   : int;
   schedpolicy   : int;
--
2.17.1