aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/adaint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r--gcc/ada/adaint.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 9d4f051..f1e7b36 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -743,7 +743,7 @@ __gnat_rmdir (char *path)
#endif
}
-#if defined (_WIN32) || defined (linux) || defined (sun) \
+#if defined (_WIN32) || defined (__linux__) || defined (__sun__) \
|| defined (__FreeBSD__)
#define HAS_TARGET_WCHAR_T
#endif
@@ -982,7 +982,7 @@ __gnat_open_new_temp (char *path, int fmode)
strcpy (path, "GNAT-XXXXXX");
#if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \
- || defined (linux) || defined(__GLIBC__)) && !defined (__vxworks)
+ || defined (__linux__) || defined (__GLIBC__)) && !defined (__vxworks)
return mkstemp (path);
#elif defined (__Lynx__)
mktemp (path);
@@ -1153,8 +1153,8 @@ __gnat_tmp_name (char *tmp_filename)
free (pname);
}
-#elif defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) \
- || defined (__OpenBSD__) || defined(__GLIBC__) || defined (__ANDROID__)
+#elif defined (__linux__) || defined (__FreeBSD__) || defined (__NetBSD__) \
+ || defined (__OpenBSD__) || defined (__GLIBC__) || defined (__ANDROID__)
#define MAX_SAFE_PATH 1000
char *tmpdir = getenv ("TMPDIR");
@@ -1224,7 +1224,7 @@ DIR* __gnat_opendir (char *name)
/* Read the next entry in a directory. The returned string points somewhere
in the buffer. */
-#if defined (sun) && defined (__SVR4)
+#if defined (__sun__)
/* For Solaris, be sure to use the 64-bit version, otherwise NFS reads may
fail with EOVERFLOW if the server uses 64-bit cookies. */
#define dirent dirent64
@@ -2160,7 +2160,7 @@ __gnat_is_symbolic_link (char *name ATTRIBUTE_UNUSED)
return __gnat_is_symbolic_link_attr (name, &attr);
}
-#if defined (sun) && defined (__SVR4)
+#if defined (__sun__)
/* Using fork on Solaris will duplicate all the threads. fork1, which
duplicates only the active thread, must be used instead, or spawning
subprocess from a program with tasking will lead into numerous problems. */
@@ -2267,7 +2267,8 @@ __gnat_number_of_cpus (void)
{
int cores = 1;
-#if defined (linux) || defined (sun) || defined (AIX) || defined (__APPLE__)
+#if defined (__linux__) || defined (__sun__) || defined (_AIX) \
+ || defined (__APPLE__)
cores = (int) sysconf (_SC_NPROCESSORS_ONLN);
#elif defined (__hpux__)
@@ -3066,7 +3067,7 @@ __gnat_lwp_self (void)
return (void *) pthread_self ();
}
-#elif defined (linux)
+#elif defined (__linux__)
/* There is no function in the glibc to retrieve the LWP of the current
thread. We need to do a system call in order to retrieve this
information. */
@@ -3155,7 +3156,7 @@ __gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
CPU_SET (cpu - 1, set);
}
#endif /* !CPU_ALLOC */
-#endif /* linux */
+#endif /* __linux__ */
/* Return the load address of the executable, or 0 if not known. In the
specific case of error, (void *)-1 can be returned. Beware: this unit may
@@ -3164,8 +3165,6 @@ __gnat_cpu_set (int cpu, size_t count ATTRIBUTE_UNUSED, cpu_set_t *set)
#if defined (__APPLE__)
#include <mach-o/dyld.h>
-#elif 0 && defined (__linux__)
-#include <link.h>
#endif
const void *