From 4d4bdb21ae4132a3bbf62df48c4584cb689ad14e Mon Sep 17 00:00:00 2001 From: charlet Date: Fri, 24 Jan 2014 15:16:49 +0000 Subject: 2014-01-24 Pascal Obry * g-sercom-mingw.adb: Fix serial port name for port number > 10. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207044 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 4 ++++ gcc/ada/g-sercom-mingw.adb | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 084fb96c16b..ba0945f1f65 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2014-01-24 Pascal Obry + + * g-sercom-mingw.adb: Fix serial port name for port number > 10. + 2014-01-24 Gary Dismukes * exp_disp.adb (Expand_Dispatching_Call): Call Unqualify on Param when diff --git a/gcc/ada/g-sercom-mingw.adb b/gcc/ada/g-sercom-mingw.adb index afc4d4773be..0a868c7dc7b 100644 --- a/gcc/ada/g-sercom-mingw.adb +++ b/gcc/ada/g-sercom-mingw.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2007-2012, AdaCore -- +-- Copyright (C) 2007-2013, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,8 +31,8 @@ -- This is the Windows implementation of this package -with Ada.Unchecked_Deallocation; use Ada; with Ada.Streams; use Ada.Streams; +with Ada.Unchecked_Deallocation; use Ada; with System; use System; with System.Communication; use System.Communication; @@ -90,7 +90,12 @@ package body GNAT.Serial_Communications is function Name (Number : Positive) return Port_Name is N_Img : constant String := Positive'Image (Number); begin - return Port_Name ("COM" & N_Img (N_Img'First + 1 .. N_Img'Last) & ':'); + if Number > 9 then + return Port_Name ("\\.\COM" & N_Img (N_Img'First + 1 .. N_Img'Last)); + else + return Port_Name + ("COM" & N_Img (N_Img'First + 1 .. N_Img'Last) & ':'); + end if; end Name; ---------- -- cgit v1.2.1