public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD
@ 2019-07-03 22:38 James Clarke
  2019-07-04  7:01 ` Arnaud Charlet
  0 siblings, 1 reply; 6+ messages in thread
From: James Clarke @ 2019-07-03 22:38 UTC (permalink / raw)
  To: gcc-patches; +Cc: James Clarke

From: James Clarke <jrtc27@jrtc27.com>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD
  2019-07-03 22:38 [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD James Clarke
@ 2019-07-04  7:01 ` Arnaud Charlet
  2019-07-04 11:44   ` James Clarke
  2019-07-04 13:25   ` Matthias Klose
  0 siblings, 2 replies; 6+ messages in thread
From: Arnaud Charlet @ 2019-07-04  7:01 UTC (permalink / raw)
  To: James Clarke; +Cc: gcc-patches, James Clarke

OK, thanks.

> From: James Clarke <jrtc27@jrtc27.com>
> 
> 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
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD
  2019-07-04  7:01 ` Arnaud Charlet
@ 2019-07-04 11:44   ` James Clarke
  2019-07-04 12:46     ` Arnaud Charlet
  2019-07-04 13:25   ` Matthias Klose
  1 sibling, 1 reply; 6+ messages in thread
From: James Clarke @ 2019-07-04 11:44 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: GCC Patches

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 <charlet@adacore.com> wrote:
> 
> OK, thanks.
> 
>> From: James Clarke <jrtc27@jrtc27.com>
>> 
>> 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
>> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD
  2019-07-04 11:44   ` James Clarke
@ 2019-07-04 12:46     ` Arnaud Charlet
  0 siblings, 0 replies; 6+ messages in thread
From: Arnaud Charlet @ 2019-07-04 12:46 UTC (permalink / raw)
  To: James Clarke; +Cc: GCC Patches

> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD
  2019-07-04  7:01 ` Arnaud Charlet
  2019-07-04 11:44   ` James Clarke
@ 2019-07-04 13:25   ` Matthias Klose
  2019-07-04 14:18     ` Arnaud Charlet
  1 sibling, 1 reply; 6+ messages in thread
From: Matthias Klose @ 2019-07-04 13:25 UTC (permalink / raw)
  To: Arnaud Charlet, James Clarke; +Cc: gcc-patches, James Clarke

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 <jrtc27@jrtc27.com>
>>
>> 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
>>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD
  2019-07-04 13:25   ` Matthias Klose
@ 2019-07-04 14:18     ` Arnaud Charlet
  0 siblings, 0 replies; 6+ messages in thread
From: Arnaud Charlet @ 2019-07-04 14:18 UTC (permalink / raw)
  To: Matthias Klose; +Cc: James Clarke, gcc-patches, James Clarke

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

Yes.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-04 13:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-03 22:38 [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD James Clarke
2019-07-04  7:01 ` Arnaud Charlet
2019-07-04 11:44   ` James Clarke
2019-07-04 12:46     ` Arnaud Charlet
2019-07-04 13:25   ` Matthias Klose
2019-07-04 14:18     ` Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).