This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[ada] Provide CLOCK_REALTIME on Tru64 UNIX
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Arnaud Charlet <charlet at adacore dot com>, Eric Botcazou <ebotcazou at adacore dot com>
- Date: Tue, 20 Dec 2011 17:52:34 +0100
- Subject: [ada] Provide CLOCK_REALTIME on Tru64 UNIX
Some patch within the last week has broken Tru64 UNIX Ada bootstrap:
s-taprop.adb:46:12: warning: no entities of "Os_Constants" are referenced
s-taprop.adb:58:04: warning: no entities of "OSC" are referenced
s-taprop.adb:594:35: "CLOCK_RT_Ada" not declared in "OS_Constants"
make[6]: *** [s-taprop.o] Error 1
The definition of CLOCK_REALTIME in <time.h> is only visible if
_POSIX_C_SOURCE >= 199309L, which isn't the case by default, but implied
by _XOPEN_SOURCE = 500.
The following patch does this and allowed the build to complete. make
check is still running.
Ok for mainline if it passes?
Rainer
2011-12-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/ada:
* s-oscons-tmplt.c [__alpha__ && __osf__] (_XOPEN_SOURCE): Define.
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -85,6 +85,12 @@ pragma Style_Checks ("M32766");
**/
#define _XOPEN_SOURCE 500
+#elif defined (__alpha__) && defined (__osf__)
+/** For Tru64 UNIX, _XOPEN_SOURCE must be defined, otherwise CLOCK_REALTIME
+ ** is not defined.
+ **/
+#define _XOPEN_SOURCE 500
+
#elif defined (__mips) && defined (__sgi)
/** For IRIX 6, _XOPEN5 must be defined and _XOPEN_IOV_MAX must be used as
** IOV_MAX, otherwise IOV_MAX is not defined. IRIX 5 has neither.
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University