summaryrefslogtreecommitdiff
path: root/gcc/ada/adaint.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-02-20 12:48:57 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2015-02-20 12:48:57 +0100
commit5ae7c3cf2e21534dda6af57c5c34318d30d0c98a (patch)
treeb3519027eb878c4eb6330ce33a284ccc86f264f5 /gcc/ada/adaint.c
parent5865a63df4a19147d7a5ae804e97aa79371dfd7b (diff)
downloadgcc-5ae7c3cf2e21534dda6af57c5c34318d30d0c98a.tar.gz
[multiple changes]
2015-02-20 Arnaud Charlet <charlet@adacore.com> * sysdep.c, expect.c, s-oscons-tmplt.c, gsocket.h, adaint.c: Remove obsolete references to RTX, nucleus, VMS. 2015-02-20 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Fix_Error): For an illegal Type_Invariant'Class aspect, use name that mentions Class explicitly, rather than compiler-internal name. 2015-02-20 Robert Dewar <dewar@adacore.com> * debug.adb: Add documentation for -gnatd.2 (allow statements in decl sequences). * par-ch3.adb (P_Identifier_Declarations): Handle statement appearing where declaration expected more cleanly. (Statement_When_Declaration_Expected): Implement debug flag -gnatd.2. 2015-02-20 Jose Ruiz <ruiz@adacore.com> * a-dinopr.ads: Add spec for this package (Unimplemented_Unit). * a-dispat.ads (Yield): Include procedure added in Ada 2012. * a-dispat.adb (Yield): Implement procedure added in Ada 2012. * impunit.adb (Non_Imp_File_Names_05): Mark unit a-dinopr.ads as defined by Ada 2005. * snames.ads-tmpl (Name_Non_Preemptive_FIFO_Within_Priorities): This is the correct name for the dispatching policy (FIFO was missing). 2015-02-20 Javier Miranda <miranda@adacore.com> * sem_res.adb (Resolve_Type_Conversion): If the type of the operand is the limited-view of a class-wide type then recover the class-wide type of the non-limited view. From-SVN: r220852
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r--gcc/ada/adaint.c147
1 files changed, 38 insertions, 109 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index d9bccfe2fc1..05c805509eb 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -108,16 +108,11 @@ extern "C" {
#if defined (__MINGW32__) || defined (__CYGWIN__)
-#if defined (RTX)
-#include <windows.h>
-#include <Rtapi.h>
-#else
#include "mingw32.h"
/* Current code page and CCS encoding to use, set in initialize.c. */
UINT CurrentCodePage;
UINT CurrentCCSEncoding;
-#endif
#include <sys/utime.h>
@@ -157,7 +152,7 @@ UINT CurrentCCSEncoding;
preventing the inclusion of the GCC header from doing anything. */
# define GCC_RESOURCE_H
# include <sys/wait.h>
-#elif defined (__nucleus__) || defined (__PikeOS__)
+#elif defined (__PikeOS__)
/* No wait() or waitpid() calls available. */
#else
/* Default case. */
@@ -253,7 +248,7 @@ char __gnat_path_separator = PATH_SEPARATOR;
const char *__gnat_library_template = GNAT_LIBRARY_TEMPLATE;
-#if defined (__vxworks) || defined (__OPENNT) || defined(__nucleus__)
+#if defined (__vxworks)
#define GNAT_MAX_PATH_LEN PATH_MAX
#else
@@ -418,7 +413,7 @@ __gnat_readlink (char *path ATTRIBUTE_UNUSED,
size_t bufsiz ATTRIBUTE_UNUSED)
{
#if defined (_WIN32) \
- || defined(__vxworks) || defined (__nucleus__) || defined (__PikeOS__)
+ || defined(__vxworks) || defined (__PikeOS__)
return -1;
#else
return readlink (path, buf, bufsiz);
@@ -434,7 +429,7 @@ __gnat_symlink (char *oldpath ATTRIBUTE_UNUSED,
char *newpath ATTRIBUTE_UNUSED)
{
#if defined (_WIN32) \
- || defined(__vxworks) || defined (__nucleus__) || defined (__PikeOS__)
+ || defined(__vxworks) || defined (__PikeOS__)
return -1;
#else
return symlink (oldpath, newpath);
@@ -443,7 +438,7 @@ __gnat_symlink (char *oldpath ATTRIBUTE_UNUSED,
/* Try to lock a file, return 1 if success. */
-#if defined (__vxworks) || defined (__nucleus__) \
+#if defined (__vxworks) \
|| defined (_WIN32) || defined (__PikeOS__)
/* Version that does not use link. */
@@ -985,8 +980,6 @@ __gnat_open_new_temp (char *path, int fmode)
return mkstemp (path);
#elif defined (__Lynx__)
mktemp (path);
-#elif defined (__nucleus__)
- return -1;
#else
if (mktemp (path) == NULL)
return -1;
@@ -1063,7 +1056,7 @@ __gnat_stat_to_attr (int fd, char* name, struct file_attributes* attr)
attr->exists = !ret;
-#if !defined (_WIN32) || defined (RTX)
+#if !defined (_WIN32)
/* on Windows requires extra system call, see __gnat_is_readable_file_attr */
attr->readable = (!ret && (statbuf.st_mode & S_IRUSR));
attr->writable = (!ret && (statbuf.st_mode & S_IWUSR));
@@ -1121,15 +1114,7 @@ __gnat_named_file_length (char *name)
void
__gnat_tmp_name (char *tmp_filename)
{
-#ifdef RTX
- /* Variable used to create a series of unique names */
- static int counter = 0;
-
- /* RTX in RTSS mode does not support tempnam nor tmpnam so we emulate it */
- strcpy (tmp_filename, "c:\\WINDOWS\\Temp\\gnat-");
- sprintf (&tmp_filename[strlen (tmp_filename)], "%d\0", counter++);
-
-#elif defined (__MINGW32__)
+#if defined (__MINGW32__)
{
char *pname;
char prefix[25];
@@ -1205,12 +1190,7 @@ __gnat_tmp_name (char *tmp_filename)
DIR* __gnat_opendir (char *name)
{
-#if defined (RTX)
- /* Not supported in RTX */
-
- return NULL;
-
-#elif defined (__MINGW32__)
+#if defined (__MINGW32__)
TCHAR wname[GNAT_MAX_PATH_LEN];
S2WSC (wname, name, GNAT_MAX_PATH_LEN);
@@ -1234,12 +1214,7 @@ DIR* __gnat_opendir (char *name)
char *
__gnat_readdir (DIR *dirp, char *buffer, int *len)
{
-#if defined (RTX)
- /* Not supported in RTX */
-
- return NULL;
-
-#elif defined (__MINGW32__)
+#if defined (__MINGW32__)
struct _tdirent *dirent = _treaddir ((_TDIR*)dirp);
if (dirent != NULL)
@@ -1281,12 +1256,7 @@ __gnat_readdir (DIR *dirp, char *buffer, int *len)
int __gnat_closedir (DIR *dirp)
{
-#if defined (RTX)
- /* Not supported in RTX */
-
- return 0;
-
-#elif defined (__MINGW32__)
+#if defined (__MINGW32__)
return _tclosedir ((_TDIR*)dirp);
#else
@@ -1306,7 +1276,7 @@ __gnat_readdir_is_thread_safe (void)
#endif
}
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
/* Number of seconds between <Jan 1st 1601> and <Jan 1st 1970>. */
static const unsigned long long w32_epoch_offset = 11644473600ULL;
@@ -1354,7 +1324,7 @@ OS_Time
__gnat_file_time_name_attr (char* name, struct file_attributes* attr)
{
if (attr->timestamp == (OS_Time)-2) {
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
BOOL res;
WIN32_FILE_ATTRIBUTE_DATA fad;
__time64_t ret = -1;
@@ -1385,7 +1355,7 @@ OS_Time
__gnat_file_time_fd_attr (int fd, struct file_attributes* attr)
{
if (attr->timestamp == (OS_Time)-2) {
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
HANDLE h = (HANDLE) _get_osfhandle (fd);
time_t ret = win32_filetime (h);
attr->timestamp = (OS_Time) ret;
@@ -1415,7 +1385,7 @@ __gnat_set_file_time_name (char *name, time_t time_stamp)
/* Code to implement __gnat_set_file_time_name for these systems. */
-#elif defined (_WIN32) && !defined (RTX)
+#elif defined (_WIN32)
union
{
FILETIME ft_time;
@@ -1466,8 +1436,7 @@ __gnat_get_libraries_from_registry (void)
result[0] = '\0';
-#if defined (_WIN32) && ! defined (__vxworks) && ! defined (IS_CROSS) \
- && ! defined (RTX)
+#if defined (_WIN32) && ! defined (__vxworks) && ! defined (IS_CROSS)
HKEY reg_key;
DWORD name_size, value_size;
@@ -1699,7 +1668,7 @@ __gnat_is_directory (char *name)
return __gnat_is_directory_attr (name, &attr);
}
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
/* Returns the same constant as GetDriveType but takes a pathname as
argument. */
@@ -1887,14 +1856,14 @@ __gnat_can_use_acl (TCHAR *wname)
return __gnat_use_acl && GetDriveTypeFromPath (wname) != DRIVE_REMOTE;
}
-#endif /* defined (_WIN32) && !defined (RTX) */
+#endif /* defined (_WIN32) */
int
__gnat_is_readable_file_attr (char* name, struct file_attributes* attr)
{
if (attr->readable == ATTR_UNSET)
{
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
TCHAR wname [GNAT_MAX_PATH_LEN + 2];
GENERIC_MAPPING GenericMapping;
@@ -1931,7 +1900,7 @@ __gnat_is_writable_file_attr (char* name, struct file_attributes* attr)
{
if (attr->writable == ATTR_UNSET)
{
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
TCHAR wname [GNAT_MAX_PATH_LEN + 2];
GENERIC_MAPPING GenericMapping;
@@ -1972,7 +1941,7 @@ __gnat_is_executable_file_attr (char* name, struct file_attributes* attr)
{
if (attr->executable == ATTR_UNSET)
{
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
TCHAR wname [GNAT_MAX_PATH_LEN + 2];
GENERIC_MAPPING GenericMapping;
@@ -2019,7 +1988,7 @@ __gnat_is_executable_file (char *name)
void
__gnat_set_writable (char *name)
{
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
TCHAR wname [GNAT_MAX_PATH_LEN + 2];
S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
@@ -2029,8 +1998,7 @@ __gnat_set_writable (char *name)
SetFileAttributes
(wname, GetFileAttributes (wname) & ~FILE_ATTRIBUTE_READONLY);
-#elif ! (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6) && \
- ! defined(__nucleus__)
+#elif ! (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6)
GNAT_STRUCT_STAT statbuf;
if (GNAT_STAT (name, &statbuf) == 0)
@@ -2049,7 +2017,7 @@ __gnat_set_writable (char *name)
void
__gnat_set_executable (char *name, int mode ATTRIBUTE_UNUSED)
{
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
TCHAR wname [GNAT_MAX_PATH_LEN + 2];
S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
@@ -2057,8 +2025,7 @@ __gnat_set_executable (char *name, int mode ATTRIBUTE_UNUSED)
if (__gnat_can_use_acl (wname))
__gnat_set_OWNER_ACL (wname, GRANT_ACCESS, FILE_GENERIC_EXECUTE);
-#elif ! (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6) && \
- ! defined(__nucleus__)
+#elif ! (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6)
GNAT_STRUCT_STAT statbuf;
if (GNAT_STAT (name, &statbuf) == 0)
@@ -2077,7 +2044,7 @@ __gnat_set_executable (char *name, int mode ATTRIBUTE_UNUSED)
void
__gnat_set_non_writable (char *name)
{
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
TCHAR wname [GNAT_MAX_PATH_LEN + 2];
S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
@@ -2090,8 +2057,7 @@ __gnat_set_non_writable (char *name)
SetFileAttributes
(wname, GetFileAttributes (wname) | FILE_ATTRIBUTE_READONLY);
-#elif ! (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6) && \
- ! defined(__nucleus__)
+#elif ! (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6)
GNAT_STRUCT_STAT statbuf;
if (GNAT_STAT (name, &statbuf) == 0)
@@ -2105,7 +2071,7 @@ __gnat_set_non_writable (char *name)
void
__gnat_set_readable (char *name)
{
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
TCHAR wname [GNAT_MAX_PATH_LEN + 2];
S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
@@ -2113,8 +2079,7 @@ __gnat_set_readable (char *name)
if (__gnat_can_use_acl (wname))
__gnat_set_OWNER_ACL (wname, GRANT_ACCESS, FILE_GENERIC_READ);
-#elif ! (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6) && \
- ! defined(__nucleus__)
+#elif ! (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6)
GNAT_STRUCT_STAT statbuf;
if (GNAT_STAT (name, &statbuf) == 0)
@@ -2127,7 +2092,7 @@ __gnat_set_readable (char *name)
void
__gnat_set_non_readable (char *name)
{
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
TCHAR wname [GNAT_MAX_PATH_LEN + 2];
S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
@@ -2135,8 +2100,7 @@ __gnat_set_non_readable (char *name)
if (__gnat_can_use_acl (wname))
__gnat_set_OWNER_ACL (wname, DENY_ACCESS, FILE_GENERIC_READ);
-#elif ! (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6) && \
- ! defined(__nucleus__)
+#elif ! (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6)
GNAT_STRUCT_STAT statbuf;
if (GNAT_STAT (name, &statbuf) == 0)
@@ -2152,7 +2116,7 @@ __gnat_is_symbolic_link_attr (char* name ATTRIBUTE_UNUSED,
{
if (attr->symbolic_link == ATTR_UNSET)
{
-#if defined (__vxworks) || defined (__nucleus__)
+#if defined (__vxworks)
attr->symbolic_link = 0;
#elif defined (_AIX) || defined (__APPLE__) || defined (__unix__)
@@ -2190,8 +2154,7 @@ __gnat_portable_spawn (char *args[] ATTRIBUTE_UNUSED)
int finished ATTRIBUTE_UNUSED;
int pid ATTRIBUTE_UNUSED;
-#if defined (__vxworks) || defined(__nucleus__) || defined(RTX) \
- || defined(__PikeOS__)
+#if defined (__vxworks) || defined(__PikeOS__)
return -1;
#elif defined (_WIN32)
@@ -2309,7 +2272,7 @@ __gnat_number_of_cpus (void)
/* WIN32 code to implement a wait call that wait for any child process. */
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
/* Synchronization code, to be thread safe. */
@@ -2560,8 +2523,7 @@ int
__gnat_portable_no_block_spawn (char *args[] ATTRIBUTE_UNUSED)
{
-#if defined (__vxworks) || defined (__nucleus__) || defined (RTX) \
- || defined (__PikeOS__)
+#if defined (__vxworks) || defined (__PikeOS__)
/* Not supported. */
return -1;
@@ -2601,8 +2563,7 @@ __gnat_portable_wait (int *process_status)
int status = 0;
int pid = 0;
-#if defined (__vxworks) || defined (__nucleus__) || defined (RTX) \
- || defined (__PikeOS__)
+#if defined (__vxworks) || defined (__PikeOS__)
/* Not sure what to do here, so do nothing but return zero. */
#elif defined (_WIN32)
@@ -2779,7 +2740,7 @@ __gnat_locate_exec_on_path (char *exec_name)
{
char *apath_val;
-#if defined (_WIN32) && !defined (RTX)
+#if defined (_WIN32)
TCHAR *wpath_val = _tgetenv (_T("PATH"));
TCHAR *wapath_val;
/* In Win32 systems we expand the PATH as for XP environment
@@ -2918,11 +2879,10 @@ int
__gnat_copy_attribs (char *from ATTRIBUTE_UNUSED, char *to ATTRIBUTE_UNUSED,
int mode ATTRIBUTE_UNUSED)
{
-#if (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6) || \
- defined (__nucleus__)
+#if (defined (__vxworks) && _WRS_VXWORKS_MAJOR < 6)
return -1;
-#elif defined (_WIN32) && !defined (RTX)
+#elif defined (_WIN32)
TCHAR wfrom [GNAT_MAX_PATH_LEN + 2];
TCHAR wto [GNAT_MAX_PATH_LEN + 2];
BOOL res;
@@ -3076,37 +3036,6 @@ __gnat_sals_init_using_constructors (void)
#endif
}
-#ifdef RTX
-
-/* In RTX mode, the procedure to get the time (as file time) is different
- in RTSS mode and Win32 mode. In order to avoid duplicating an Ada file,
- we introduce an intermediate procedure to link against the corresponding
- one in each situation. */
-
-extern void GetTimeAsFileTime (LPFILETIME pTime);
-
-void GetTimeAsFileTime (LPFILETIME pTime)
-{
-#ifdef RTSS
- RtGetRtssTimeAsFileTime (pTime); /* RTSS interface */
-#else
- GetSystemTimeAsFileTime (pTime); /* w32 interface */
-#endif
-}
-
-#ifdef RTSS
-/* Add symbol that is required to link. It would otherwise be taken from
- libgcc.a and it would try to use the gcc constructors that are not
- supported by Microsoft linker. */
-
-extern void __main (void);
-
-void __main (void)
-{
-}
-#endif /* RTSS */
-#endif /* RTX */
-
#if defined (__ANDROID__)
#include <pthread.h>