+2009-07-16 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR bootstrap/40578
+ * adaint.h (FOPEN, STAT, FSTAT, LSTAT, STRUCT_STAT): Rename from these
+ (GNAT_FOPEN, GNAT_STAT, GNAT_FSTAT, GNAT_LSTAT, GNAT_STRUCT_STAT): ...
+ to these.
+ (__gnat_stat): Adjust reference to STAT in prototype.
+ * adaint.c (__gnat_try_lock, __gnat_fopen, __gnat_file_length,
+ __gnat_named_file_length, __gnat_file_time_name, __gnat_file_time_fd,
+ __gnat_get_libraries_from_registry, __gnat_stat, __gnat_file_exists,
+ __gnat_is_regular_file, __gnat_is_directory, __gnat_is_readable_file,
+ __gnat_is_writable_file, __gnat_is_executable_file,
+ __gnat_set_writable, __gnat_set_executable, __gnat_set_non_writable,
+ __gnat_set_readable, __gnat_set_non_readable, __gnat_is_symbolic_link,
+ __gnat_copy_attribs): Adjust all references to the above.
+ * cstreams.c (__gnat_is_regular_file_fd): Likewise.
+
2009-07-23 Ed Schonberg <schonberg@adacore.com>
* sem.adb (Do_Unit_And_Dependents): Now that specs and bodies are not
{
char full_path[256];
char temp_file[256];
- STRUCT_STAT stat_result;
+ GNAT_STRUCT_STAT stat_result;
int fd;
sprintf (full_path, "%s%c%s", dir, DIR_SEPARATOR, file);
#elif defined (VMS)
return decc$fopen (path, mode);
#else
- return FOPEN (path, mode);
+ return GNAT_FOPEN (path, mode);
#endif
}
__gnat_file_length (int fd)
{
int ret;
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- ret = FSTAT (fd, &statbuf);
+ ret = GNAT_FSTAT (fd, &statbuf);
if (ret || !S_ISREG (statbuf.st_mode))
return 0;
__gnat_named_file_length (char *name)
{
int ret;
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
ret = __gnat_stat (name, &statbuf);
if (ret || !S_ISREG (statbuf.st_mode))
}
return (OS_Time) ret;
#else
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
if (__gnat_stat (name, &statbuf) != 0) {
return (OS_Time)-1;
} else {
return (OS_Time) ret;
#else
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- if (FSTAT (fd, &statbuf) != 0) {
+ if (GNAT_FSTAT (fd, &statbuf) != 0) {
return (OS_Time) -1;
} else {
#ifdef VMS
}
int
-__gnat_stat (char *name, STRUCT_STAT *statbuf)
+__gnat_stat (char *name, GNAT_STRUCT_STAT *statbuf)
{
#ifdef __MINGW32__
/* Under Windows the directory name for the stat function must not be
return _tstat (wname, (struct _stat *)statbuf);
#else
- return STAT (name, statbuf);
+ return GNAT_STAT (name, statbuf);
#endif
}
S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
return GetFileAttributes (wname) != INVALID_FILE_ATTRIBUTES;
#else
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
return !__gnat_stat (name, &statbuf);
#endif
__gnat_is_regular_file (char *name)
{
int ret;
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
ret = __gnat_stat (name, &statbuf);
return (!ret && S_ISREG (statbuf.st_mode));
__gnat_is_directory (char *name)
{
int ret;
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
ret = __gnat_stat (name, &statbuf);
return (!ret && S_ISDIR (statbuf.st_mode));
#else
int ret;
int mode;
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- ret = STAT (name, &statbuf);
+ ret = GNAT_STAT (name, &statbuf);
mode = statbuf.st_mode & S_IRUSR;
return (!ret && mode);
#endif
#else
int ret;
int mode;
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- ret = STAT (name, &statbuf);
+ ret = GNAT_STAT (name, &statbuf);
mode = statbuf.st_mode & S_IWUSR;
return (!ret && mode);
#endif
#else
int ret;
int mode;
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- ret = STAT (name, &statbuf);
+ ret = GNAT_STAT (name, &statbuf);
mode = statbuf.st_mode & S_IXUSR;
return (!ret && mode);
#endif
SetFileAttributes
(wname, GetFileAttributes (wname) & ~FILE_ATTRIBUTE_READONLY);
#elif ! defined (__vxworks) && ! defined(__nucleus__)
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- if (STAT (name, &statbuf) == 0)
+ if (GNAT_STAT (name, &statbuf) == 0)
{
statbuf.st_mode = statbuf.st_mode | S_IWUSR;
chmod (name, statbuf.st_mode);
__gnat_set_OWNER_ACL (wname, GRANT_ACCESS, FILE_GENERIC_EXECUTE);
#elif ! defined (__vxworks) && ! defined(__nucleus__)
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- if (STAT (name, &statbuf) == 0)
+ if (GNAT_STAT (name, &statbuf) == 0)
{
statbuf.st_mode = statbuf.st_mode | S_IXUSR;
chmod (name, statbuf.st_mode);
SetFileAttributes
(wname, GetFileAttributes (wname) | FILE_ATTRIBUTE_READONLY);
#elif ! defined (__vxworks) && ! defined(__nucleus__)
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- if (STAT (name, &statbuf) == 0)
+ if (GNAT_STAT (name, &statbuf) == 0)
{
statbuf.st_mode = statbuf.st_mode & 07577;
chmod (name, statbuf.st_mode);
__gnat_set_OWNER_ACL (wname, GRANT_ACCESS, FILE_GENERIC_READ);
#elif ! defined (__vxworks) && ! defined(__nucleus__)
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- if (STAT (name, &statbuf) == 0)
+ if (GNAT_STAT (name, &statbuf) == 0)
{
chmod (name, statbuf.st_mode | S_IREAD);
}
__gnat_set_OWNER_ACL (wname, DENY_ACCESS, FILE_GENERIC_READ);
#elif ! defined (__vxworks) && ! defined(__nucleus__)
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- if (STAT (name, &statbuf) == 0)
+ if (GNAT_STAT (name, &statbuf) == 0)
{
chmod (name, statbuf.st_mode & (~S_IREAD));
}
#elif defined (_AIX) || defined (__APPLE__) || defined (__unix__)
int ret;
- STRUCT_STAT statbuf;
+ GNAT_STRUCT_STAT statbuf;
- ret = LSTAT (name, &statbuf);
+ ret = GNAT_LSTAT (name, &statbuf);
return (!ret && S_ISLNK (statbuf.st_mode));
#else
return 0;
#else
- STRUCT_STAT fbuf;
+ GNAT_STRUCT_STAT fbuf;
struct utimbuf tbuf;
- if (STAT (from, &fbuf) == -1)
+ if (GNAT_STAT (from, &fbuf) == -1)
{
return -1;
}