aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Obry <obry@adacore.com>2014-01-24 15:16:49 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-01-24 16:16:49 +0100
commitdd6ab508322d8e05e689777dec7be4d186107127 (patch)
tree1f1c15f693b87c930431c3ebdaf62234216bda28
parente6d5d9405e8eb8bf5dd093a30bc2b6f00085c9b2 (diff)
downloadgcc-dd6ab508322d8e05e689777dec7be4d186107127.zip
gcc-dd6ab508322d8e05e689777dec7be4d186107127.tar.gz
gcc-dd6ab508322d8e05e689777dec7be4d186107127.tar.bz2
g-sercom-mingw.adb: Fix serial port name for port number > 10.
2014-01-24 Pascal Obry <obry@adacore.com> * g-sercom-mingw.adb: Fix serial port name for port number > 10. From-SVN: r207044
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/g-sercom-mingw.adb11
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 084fb96..ba0945f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-24 Pascal Obry <obry@adacore.com>
+
+ * g-sercom-mingw.adb: Fix serial port name for port number > 10.
+
2014-01-24 Gary Dismukes <dismukes@adacore.com>
* 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 afc4d47..0a868c7 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;
----------