Commit 7437c8d4 by Aurelien Jarno Committed by Matthias Klose

sysdep.c: add __GLIBC__ to the #ifdef preprocessor macros to detect systems using GNU libc.

2008-04-07  Aurelien Jarno  <aurelien@aurel32.net>

        * sysdep.c: add __GLIBC__ to the #ifdef preprocessor macros to
        detect systems using GNU libc.
        * gsocket.h: ditto.
        * socket.c: ditto.
        * adaint.c: ditto.
        * link.c: ditto.

From-SVN: r133979
parent 1dab7b35
2008-04-07 Aurelien Jarno <aurelien@aurel32.net> 2008-04-07 Aurelien Jarno <aurelien@aurel32.net>
* sysdep.c: add __GLIBC__ to the #ifdef preprocessor macros to
detect systems using GNU libc.
* gsocket.h: ditto.
* socket.c: ditto.
* adaint.c: ditto.
* link.c: ditto.
2008-04-07 Aurelien Jarno <aurelien@aurel32.net>
* s-osinte-linux-kfreebsd.ads (SC_NPROCESSORS_ONLN): New * s-osinte-linux-kfreebsd.ads (SC_NPROCESSORS_ONLN): New
constant constant for sysconf call. constant constant for sysconf call.
(bit_field): New packed boolean type used by cpu_set_t. (bit_field): New packed boolean type used by cpu_set_t.
...@@ -888,7 +888,7 @@ __gnat_open_new_temp (char *path, int fmode) ...@@ -888,7 +888,7 @@ __gnat_open_new_temp (char *path, int fmode)
strcpy (path, "GNAT-XXXXXX"); strcpy (path, "GNAT-XXXXXX");
#if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \ #if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) \
|| defined (linux)) && !defined (__vxworks) || defined (linux) || defined(__GLIBC__)) && !defined (__vxworks)
return mkstemp (path); return mkstemp (path);
#elif defined (__Lynx__) #elif defined (__Lynx__)
mktemp (path); mktemp (path);
...@@ -981,7 +981,7 @@ __gnat_tmp_name (char *tmp_filename) ...@@ -981,7 +981,7 @@ __gnat_tmp_name (char *tmp_filename)
} }
#elif defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) \ #elif defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) \
|| defined (__OpenBSD__) || defined (__OpenBSD__) || defined(__GLIBC__)
#define MAX_SAFE_PATH 1000 #define MAX_SAFE_PATH 1000
char *tmpdir = getenv ("TMPDIR"); char *tmpdir = getenv ("TMPDIR");
...@@ -3030,7 +3030,7 @@ void GetTimeAsFileTime(LPFILETIME pTime) ...@@ -3030,7 +3030,7 @@ void GetTimeAsFileTime(LPFILETIME pTime)
} }
#endif #endif
#if defined (linux) #if defined (linux) || defined(__GLIBC__)
/* pthread affinity support */ /* pthread affinity support */
int __gnat_pthread_setaffinity_np (pthread_t th, int __gnat_pthread_setaffinity_np (pthread_t th,
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
#if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || defined (__osf__) || defined (_WIN32) || defined (__APPLE__) #if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || defined (__osf__) || defined (_WIN32) || defined (__APPLE__)
# define HAVE_THREAD_SAFE_GETxxxBYyyy 1 # define HAVE_THREAD_SAFE_GETxxxBYyyy 1
#elif defined (sgi) || defined (linux) || (defined (sun) && defined (__SVR4) && !defined (__vxworks)) #elif defined (sgi) || defined (linux) || defined (__GLIBC__) || (defined (sun) && defined (__SVR4) && !defined (__vxworks))
# define HAVE_GETxxxBYyyy_R 1 # define HAVE_GETxxxBYyyy_R 1
#endif #endif
......
...@@ -153,7 +153,7 @@ unsigned char __gnat_objlist_file_supported = 1; ...@@ -153,7 +153,7 @@ unsigned char __gnat_objlist_file_supported = 1;
unsigned char __gnat_using_gnu_linker = 1; unsigned char __gnat_using_gnu_linker = 1;
const char *__gnat_object_library_extension = ".a"; const char *__gnat_object_library_extension = ".a";
#elif defined (linux) #elif defined (linux) || defined(__GLIBC__)
const char *__gnat_object_file_option = ""; const char *__gnat_object_file_option = "";
const char *__gnat_run_path_option = "-Wl,-rpath,"; const char *__gnat_run_path_option = "-Wl,-rpath,";
char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgnat_default = STATIC;
......
...@@ -206,7 +206,7 @@ __gnat_safe_gethostbyname (const char *name, ...@@ -206,7 +206,7 @@ __gnat_safe_gethostbyname (const char *name,
struct hostent *rh; struct hostent *rh;
int ri; int ri;
#ifdef __linux__ #if defined(__linux__) || defined(__GLIBC__)
(void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop); (void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop);
#else #else
rh = gethostbyname_r (name, ret, buf, buflen, h_errnop); rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);
...@@ -223,7 +223,7 @@ __gnat_safe_gethostbyaddr (const char *addr, int len, int type, ...@@ -223,7 +223,7 @@ __gnat_safe_gethostbyaddr (const char *addr, int len, int type,
struct hostent *rh; struct hostent *rh;
int ri; int ri;
#ifdef __linux__ #if defined(__linux__) || defined(__GLIBC__)
(void) gethostbyaddr_r (addr, len, type, ret, buf, buflen, &rh, h_errnop); (void) gethostbyaddr_r (addr, len, type, ret, buf, buflen, &rh, h_errnop);
#else #else
rh = gethostbyaddr_r (addr, len, type, ret, buf, buflen, h_errnop); rh = gethostbyaddr_r (addr, len, type, ret, buf, buflen, h_errnop);
...@@ -239,7 +239,7 @@ __gnat_safe_getservbyname (const char *name, const char *proto, ...@@ -239,7 +239,7 @@ __gnat_safe_getservbyname (const char *name, const char *proto,
struct servent *rh; struct servent *rh;
int ri; int ri;
#ifdef __linux__ #if defined(__linux__) || defined(__GLIBC__)
(void) getservbyname_r (name, proto, ret, buf, buflen, &rh); (void) getservbyname_r (name, proto, ret, buf, buflen, &rh);
#else #else
rh = getservbyname_r (name, proto, ret, buf, buflen); rh = getservbyname_r (name, proto, ret, buf, buflen);
...@@ -255,7 +255,7 @@ __gnat_safe_getservbyport (int port, const char *proto, ...@@ -255,7 +255,7 @@ __gnat_safe_getservbyport (int port, const char *proto,
struct servent *rh; struct servent *rh;
int ri; int ri;
#ifdef __linux__ #if defined(__linux__) || defined(__GLIBC__)
(void) getservbyport_r (port, proto, ret, buf, buflen, &rh); (void) getservbyport_r (port, proto, ret, buf, buflen, &rh);
#else #else
rh = getservbyport_r (port, proto, ret, buf, buflen); rh = getservbyport_r (port, proto, ret, buf, buflen);
......
...@@ -342,7 +342,8 @@ __gnat_ttyname (int filedes) ...@@ -342,7 +342,8 @@ __gnat_ttyname (int filedes)
|| (defined (__osf__) && ! defined (__alpha_vxworks)) || defined (WINNT) \ || (defined (__osf__) && ! defined (__alpha_vxworks)) || defined (WINNT) \
|| defined (__MACHTEN__) || defined (__hpux__) || defined (_AIX) \ || defined (__MACHTEN__) || defined (__hpux__) || defined (_AIX) \
|| (defined (__svr4__) && defined (i386)) || defined (__Lynx__) \ || (defined (__svr4__) && defined (i386)) || defined (__Lynx__) \
|| defined (__CYGWIN__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__CYGWIN__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
|| defined (__GLIBC__)
#ifdef __MINGW32__ #ifdef __MINGW32__
#if OLD_MINGW #if OLD_MINGW
...@@ -399,7 +400,8 @@ getc_immediate_common (FILE *stream, ...@@ -399,7 +400,8 @@ getc_immediate_common (FILE *stream,
|| (defined (__osf__) && ! defined (__alpha_vxworks)) \ || (defined (__osf__) && ! defined (__alpha_vxworks)) \
|| defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \ || defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \
|| defined (_AIX) || (defined (__svr4__) && defined (i386)) \ || defined (_AIX) || (defined (__svr4__) && defined (i386)) \
|| defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
|| defined (__GLIBC__)
char c; char c;
int nread; int nread;
int good_one = 0; int good_one = 0;
...@@ -418,7 +420,8 @@ getc_immediate_common (FILE *stream, ...@@ -418,7 +420,8 @@ getc_immediate_common (FILE *stream,
#if defined(linux) || defined (sun) || defined (sgi) || defined (__EMX__) \ #if defined(linux) || defined (sun) || defined (sgi) || defined (__EMX__) \
|| defined (__osf__) || defined (__MACHTEN__) || defined (__hpux__) \ || defined (__osf__) || defined (__MACHTEN__) || defined (__hpux__) \
|| defined (_AIX) || (defined (__svr4__) && defined (i386)) \ || defined (_AIX) || (defined (__svr4__) && defined (i386)) \
|| defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__Lynx__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
|| defined (__GLIBC__)
eof_ch = termios_rec.c_cc[VEOF]; eof_ch = termios_rec.c_cc[VEOF];
/* If waiting (i.e. Get_Immediate (Char)), set MIN = 1 and wait for /* If waiting (i.e. Get_Immediate (Char)), set MIN = 1 and wait for
...@@ -845,7 +848,7 @@ __gnat_localtime_tzoff (const time_t *timer, struct tm *tp, long *off) ...@@ -845,7 +848,7 @@ __gnat_localtime_tzoff (const time_t *timer, struct tm *tp, long *off)
/* Darwin, Free BSD, Linux, Tru64, where there exists a component tm_gmtoff /* Darwin, Free BSD, Linux, Tru64, where there exists a component tm_gmtoff
in struct tm */ in struct tm */
#elif defined (__APPLE__) || defined (__FreeBSD__) || defined (linux) ||\ #elif defined (__APPLE__) || defined (__FreeBSD__) || defined (linux) ||\
(defined (__alpha__) && defined (__osf__)) (defined (__alpha__) && defined (__osf__)) || defined (__GLIBC__)
*off = tp->tm_gmtoff; *off = tp->tm_gmtoff;
/* All other platforms: Treat all time values in GMT */ /* All other platforms: Treat all time values in GMT */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment