On Linux, s-oscons-tmplt.c needs to define _BSD_SOURCE in order for
CRTSCTS to be visible. Otherwise the macro is undefined, and defaulted
to -1.

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-07-29  Thomas Quinot  <qui...@adacore.com>

        PR ada/60652
        * s-oscons-tmplt.c: For Linux, define _BSD_SOURCE in order for
        CRTSCTS to be visible.

Index: s-oscons-tmplt.c
===================================================================
--- s-oscons-tmplt.c    (revision 213156)
+++ s-oscons-tmplt.c    (working copy)
@@ -86,11 +86,18 @@
  ** a number of non-POSIX but useful/required features.
  **/
 
-#if defined (__linux__) && !defined (_XOPEN_SOURCE)
-/* For Linux, define _XOPEN_SOURCE to get IOV_MAX */
-#define _XOPEN_SOURCE 500
-#endif
+#if defined (__linux__)
 
+/* Define _XOPEN_SOURCE to get IOV_MAX */
+# if !defined (_XOPEN_SOURCE)
+#  define _XOPEN_SOURCE 500
+# endif
+
+/* Define _BSD_SOURCE to get CRTSCTS */
+# define _BSD_SOURCE
+
+#endif /* defined (__linux__) */
+
 /* Include gsocket.h before any system header so it can redefine FD_SETSIZE */
 
 #include "gsocket.h"

Reply via email to