aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-oscons-tmplt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/s-oscons-tmplt.c')
-rw-r--r--gcc/ada/s-oscons-tmplt.c152
1 files changed, 111 insertions, 41 deletions
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
index ad3d06520d8..3d70ceb4857 100644
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -97,6 +97,7 @@ pragma Style_Checks ("M32766");
#include <string.h>
#include <limits.h>
#include <fcntl.h>
+#include <time.h>
#if defined (__alpha__) && defined (__osf__)
/** Tru64 is unable to do vector IO operations with default value of IOV_MAX,
@@ -145,7 +146,7 @@ pragma Style_Checks ("M32766");
# define NATIVE
-#endif
+#endif /* DUMMY */
#ifndef TARGET
# error Please define TARGET
@@ -212,7 +213,7 @@ int counter = 0;
: : "i" (__LINE__));
/* Freeform text */
-#endif
+#endif /* NATIVE */
#define CST(name,comment) C(#name,String,name,comment)
@@ -925,6 +926,21 @@ CND(VEOL2, "Alternative EOL")
#endif /* HAVE_TERMIOS */
+/*
+
+ -----------------------------
+ -- Pseudo terminal library --
+ -----------------------------
+
+*/
+
+#if defined (__FreeBSD__) || defined (linux)
+# define PTY_Library "-lutil"
+#else
+# define PTY_Library ""
+#endif
+CST(PTY_Library, "for g-exptty")
+
/**
** Sockets constants
**/
@@ -1317,58 +1333,71 @@ CST(Inet_Pton_Linkname, "")
#endif /* HAVE_SOCKETS */
-/**
- ** System-specific constants follow
- ** Each section should be activated if compiling for the corresponding
- ** platform *or* generating the dummy version for runtime test compilation.
- **/
-
-#if defined (__vxworks) || defined (DUMMY)
-
/*
- --------------------------------
- -- VxWorks-specific constants --
- --------------------------------
+ ---------------------
+ -- Threads support --
+ ---------------------
+
+ -- Clock identifier definitions
- -- These constants may be used only within the VxWorks version of
- -- GNAT.Sockets.Thin.
*/
-CND(OK, "VxWorks generic success")
-CND(ERROR, "VxWorks generic error")
+#ifdef CLOCK_REALTIME
+CND(CLOCK_REALTIME, "System realtime clock")
+#endif
+#ifdef CLOCK_MONOTONIC
+CND(CLOCK_MONOTONIC, "System monotonic clock")
#endif
-#if defined (__MINGW32__) || defined (DUMMY)
-/*
+#ifdef CLOCK_FASTEST
+CND(CLOCK_FASTEST, "Fastest clock")
+#endif
- ------------------------------
- -- MinGW-specific constants --
- ------------------------------
+#if defined (__sgi)
+CND(CLOCK_SGI_FAST, "SGI fast clock")
+CND(CLOCK_SGI_CYCLE, "SGI CPU clock")
+#endif
- -- These constants may be used only within the MinGW version of
- -- GNAT.Sockets.Thin.
-*/
+#ifndef CLOCK_THREAD_CPUTIME_ID
+# define CLOCK_THREAD_CPUTIME_ID -1
+#endif
+CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock")
-CND(WSASYSNOTREADY, "System not ready")
-CND(WSAVERNOTSUPPORTED, "Version not supported")
-CND(WSANOTINITIALISED, "Winsock not initialized")
-CND(WSAEDISCON, "Disconnected")
+#if defined(__APPLE__)
+/* There's no clock_gettime or clock_id's on Darwin, generate a dummy value */
+# define CLOCK_RT_Ada "-1"
+#elif defined(FreeBSD) || (defined(_AIX) && defined(_AIXVERSION_530))
+/** On these platforms use system provided monotonic clock instead of
+ ** the default CLOCK_REALTIME. We then need to set up cond var attributes
+ ** appropriately (see thread.c).
+ **/
+# define CLOCK_RT_Ada "CLOCK_MONOTONIC"
+# define NEED_PTHREAD_CONDATTR_SETCLOCK
+
+#elif defined(CLOCK_REALTIME)
+/* By default use CLOCK_REALTIME */
+# define CLOCK_RT_Ada "CLOCK_REALTIME"
#endif
-#ifdef NATIVE
- putchar ('\n');
+#ifdef CLOCK_RT_Ada
+CNS(CLOCK_RT_Ada, "")
#endif
#if defined (__APPLE__) || defined (__linux__) || defined (DUMMY)
/*
- -- Sizes of pthread data types (on Darwin these are padding)
+ -- Sizes of pthread data types
+
*/
#if defined (__APPLE__) || defined (DUMMY)
+/*
+ -- (on Darwin, these are just placeholders)
+
+*/
#define PTHREAD_SIZE __PTHREAD_SIZE__
#define PTHREAD_ATTR_SIZE __PTHREAD_ATTR_SIZE__
#define PTHREAD_MUTEXATTR_SIZE __PTHREAD_MUTEXATTR_SIZE__
@@ -1390,24 +1419,65 @@ CND(WSAEDISCON, "Disconnected")
#define PTHREAD_ONCE_SIZE (sizeof (pthread_once_t))
#endif
-CND(PTHREAD_SIZE, "pthread_t")
+CND(PTHREAD_SIZE, "pthread_t")
+CND(PTHREAD_ATTR_SIZE, "pthread_attr_t")
+CND(PTHREAD_MUTEXATTR_SIZE, "pthread_mutexattr_t")
+CND(PTHREAD_MUTEX_SIZE, "pthread_mutex_t")
+CND(PTHREAD_CONDATTR_SIZE, "pthread_condattr_t")
+CND(PTHREAD_COND_SIZE, "pthread_cond_t")
+CND(PTHREAD_RWLOCKATTR_SIZE, "pthread_rwlockattr_t")
+CND(PTHREAD_RWLOCK_SIZE, "pthread_rwlock_t")
+CND(PTHREAD_ONCE_SIZE, "pthread_once_t")
-CND(PTHREAD_ATTR_SIZE, "pthread_attr_t")
+#endif /* __APPLE__ || __linux__ */
-CND(PTHREAD_MUTEXATTR_SIZE, "pthread_mutexattr_t")
+/**
+ ** System-specific constants follow
+ ** Each section should be activated if compiling for the corresponding
+ ** platform *or* generating the dummy version for runtime test compilation.
+ **/
-CND(PTHREAD_MUTEX_SIZE, "pthread_mutex_t")
+#if defined (__vxworks) || defined (DUMMY)
-CND(PTHREAD_CONDATTR_SIZE, "pthread_condattr_t")
+/*
-CND(PTHREAD_COND_SIZE, "pthread_cond_t")
+ --------------------------------
+ -- VxWorks-specific constants --
+ --------------------------------
-CND(PTHREAD_RWLOCKATTR_SIZE, "pthread_rwlockattr_t")
+ -- These constants may be used only within the VxWorks version of
+ -- GNAT.Sockets.Thin.
+*/
+
+CND(OK, "VxWorks generic success")
+CND(ERROR, "VxWorks generic error")
+
+#endif /* __vxworks */
+
+#if defined (__MINGW32__) || defined (DUMMY)
+/*
-CND(PTHREAD_RWLOCK_SIZE, "pthread_rwlock_t")
+ ------------------------------
+ -- MinGW-specific constants --
+ ------------------------------
-CND(PTHREAD_ONCE_SIZE, "pthread_once_t")
+ -- These constants may be used only within the MinGW version of
+ -- GNAT.Sockets.Thin.
+*/
+CND(WSASYSNOTREADY, "System not ready")
+CND(WSAVERNOTSUPPORTED, "Version not supported")
+CND(WSANOTINITIALISED, "Winsock not initialized")
+CND(WSAEDISCON, "Disconnected")
+
+#endif /* __MINGW32__ */
+
+/**
+ ** End of constants definitions
+ **/
+
+#ifdef NATIVE
+ putchar ('\n');
#endif
/*