[prev in list] [next in list] [prev in thread] [next in thread]
List: pecl-cvs
Subject: [PECL-CVS] com pecl/system/dio: Add more baudrates: php5/dio.c php7/dio.c
From: Remi Collet <remi () php ! net>
Date: 2016-12-12 20:24:57
Message-ID: php-mail-e477b2cff9fc7ae9c6edbab6d054aa951585548284 () git ! php ! net
[Download RAW message or body]
Commit: 4ee74691b7f66d8d20e2b31e6737b2fb9aba3585
Author: Michael Heimpold <mhei@heimpold.de> Mon, 12 Dec 2016 21:12:00 \
+0100
Parents: c3bd5365603202b57d7846a997f1ee782d0d17a2
Branches: master
Link: http://git.php.net/?p=pecl/system/dio.git;a=commitdiff;h=4ee74691b7f66d8d20e2b31e6737b2fb9aba3585
Log:
Add more baudrates
Since these constants are not available on every platform, we add
them conditionally.
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Changed paths:
M php5/dio.c
M php7/dio.c
Diff:
diff --git a/php5/dio.c b/php5/dio.c
index 1440f5a..0c7259d 100644
--- a/php5/dio.c
+++ b/php5/dio.c
@@ -501,6 +501,26 @@ PHP_FUNCTION(dio_tcsetattr)
/* assign to correct values... */
switch (Baud_Rate) {
+#ifdef B460800
+ case 460800:
+ BAUD = B460800;
+ break;
+#endif
+#ifdef B230400
+ case 230400:
+ BAUD = B230400;
+ break;
+#endif
+#ifdef B115200
+ case 115200:
+ BAUD = B115200;
+ break;
+#endif
+#ifdef B57600
+ case 57600:
+ BAUD = B57600;
+ break;
+#endif
case 38400:
BAUD = B38400;
break;
diff --git a/php7/dio.c b/php7/dio.c
index ac8e5fe..5a44514 100644
--- a/php7/dio.c
+++ b/php7/dio.c
@@ -518,6 +518,26 @@ PHP_FUNCTION(dio_tcsetattr)
/* assign to correct values... */
switch (Baud_Rate) {
+#ifdef B460800
+ case 460800:
+ BAUD = B460800;
+ break;
+#endif
+#ifdef B230400
+ case 230400:
+ BAUD = B230400;
+ break;
+#endif
+#ifdef B115200
+ case 115200:
+ BAUD = B115200;
+ break;
+#endif
+#ifdef B57600
+ case 57600:
+ BAUD = B57600;
+ break;
+#endif
case 38400:
BAUD = B38400;
break;
--
PECL CVS Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic