diff options
author | Dmitriy Anisimkov <anisimko@adacore.com> | 2019-07-08 08:14:59 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-07-08 08:14:59 +0000 |
commit | 55d4e2ba076049f88c24011f2f63aa226e6c87a0 (patch) | |
tree | 0ed5dc35f9377fb40de37a2f33036fd11b808648 /gcc/ada/s-oscons-tmplt.c | |
parent | aec80f204f01c8c8ccd78a6cc4cfa07ba99ecb9f (diff) | |
download | gcc-55d4e2ba076049f88c24011f2f63aa226e6c87a0.zip gcc-55d4e2ba076049f88c24011f2f63aa226e6c87a0.tar.gz gcc-55d4e2ba076049f88c24011f2f63aa226e6c87a0.tar.bz2 |
[Ada] GNAT.Serial_Communications: simplify the Serial_Port structure
2019-07-08 Dmitriy Anisimkov <anisimko@adacore.com>
gcc/ada/
* libgnat/g-sercom.ads
(Serial_Port_Descriptor): New type.
(Serial_Port): Add a comment, make it hold a
Serial_Port_Descriptor.
(To_Ada, To_C): New procedures.
(Port_Data, Port_Data_Access): Remove types.
* libgnat/g-sercom.adb (To_Ada): New stub.
* libgnat/g-sercom__linux.adb, libgnat/g-sercom__mingw.adb:
Update implementations accordingly.
* s-oscons-tmplt.c: Bind Serial_Port_Descriptor to
System.Win32.HANDLE on Windows, and to Interfaces.C.int on
Linux. Add "Interfaces.C." prefix for other basic integer type
bindings.
* xoscons.adb (Output_Info): Remove the "Interfaces.C." prefix
for subtypes generation.
From-SVN: r273225
Diffstat (limited to 'gcc/ada/s-oscons-tmplt.c')
-rw-r--r-- | gcc/ada/s-oscons-tmplt.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c index f63ea52..1e883b9 100644 --- a/gcc/ada/s-oscons-tmplt.c +++ b/gcc/ada/s-oscons-tmplt.c @@ -261,6 +261,14 @@ main (void) { TXT("-- This is the version for " TARGET) TXT("") TXT("with Interfaces.C;") +#if defined (__MINGW32__) +# define TARGET_OS "Windows" +# define Serial_Port_Descriptor "System.Win32.HANDLE" +TXT("with System.Win32;") +#else +# define TARGET_OS "Other_OS" +# define Serial_Port_Descriptor "Interfaces.C.int" +#endif /* package System.OS_Constants is @@ -280,11 +288,6 @@ package System.OS_Constants is type OS_Type is (Windows, Other_OS); */ -#if defined (__MINGW32__) -# define TARGET_OS "Windows" -#else -# define TARGET_OS "Other_OS" -#endif C("Target_OS", OS_Type, TARGET_OS, "") /* pragma Warnings (Off, Target_OS); @@ -303,6 +306,8 @@ CST(Target_Name, "") #define SIZEOF_unsigned_int sizeof (unsigned int) CND(SIZEOF_unsigned_int, "Size of unsigned int") +SUB(Serial_Port_Descriptor) + /* ------------------- @@ -405,10 +410,10 @@ CND(FNDELAY, "Nonblocking") #if defined (__FreeBSD__) || defined (__DragonFly__) # define CNI CNU -# define IOCTL_Req_T "unsigned" +# define IOCTL_Req_T "Interfaces.C.unsigned" #else # define CNI CND -# define IOCTL_Req_T "int" +# define IOCTL_Req_T "Interfaces.C.int" #endif SUB(IOCTL_Req_T) @@ -1628,9 +1633,9 @@ CND(IF_NAMESIZE, "Max size of interface name with 0 terminator"); */ #if defined (__sun__) || defined (__hpux__) -# define Msg_Iovlen_T "int" +# define Msg_Iovlen_T "Interfaces.C.int" #else -# define Msg_Iovlen_T "size_t" +# define Msg_Iovlen_T "Interfaces.C.size_t" #endif SUB(Msg_Iovlen_T) |