[multiple changes]

2014-07-17  Pascal Obry  <obry@adacore.com>

	* s-os_lib.ads: Minor comment update.

2014-07-17  Tristan Gingold  <gingold@adacore.com>

	* sysdep.c: Add ATTRIBUTE_UNUSED to avoid warnings.  Fix some
	indentation.
	* socket.c: Remove #warning to avoid warning.
	* expect.c: Indent some preprocessor directives to clarify
	nested if.  Do not use wait.h on PikeOS.  Add ATTRIBUTE_UNUSED
	to remove warnings.
	* env.c: Fix indentation.  Port to PikeOS.
	* gsocket.h: Port to PikeOS.  Remove #warning.
	* terminals.c: Port to PikeOS.	Fix indentation of the stubs.
	Add ATTRIBUTE_UNUSED to stubs arguments.  Fix return statement
	of stubbed __gnat_setup_parent_communication.
	* adaint.c: Port to PikeOS.  Reindent some preprocessor
	directives to clarify nested if.  Fix indentation.  Add missing
	ATTRIBUTE_UNUSED.

2014-07-17  Robert Dewar  <dewar@adacore.com>

	* sem_attr.adb: Minor reformatting.

From-SVN: r212717
This commit is contained in:
Arnaud Charlet 2014-07-17 08:14:35 +02:00
parent d2d8b2a70d
commit a1d3851bcd
10 changed files with 209 additions and 76 deletions

View File

@ -1,3 +1,28 @@
2014-07-17 Pascal Obry <obry@adacore.com>
* s-os_lib.ads: Minor comment update.
2014-07-17 Tristan Gingold <gingold@adacore.com>
* sysdep.c: Add ATTRIBUTE_UNUSED to avoid warnings. Fix some
indentation.
* socket.c: Remove #warning to avoid warning.
* expect.c: Indent some preprocessor directives to clarify
nested if. Do not use wait.h on PikeOS. Add ATTRIBUTE_UNUSED
to remove warnings.
* env.c: Fix indentation. Port to PikeOS.
* gsocket.h: Port to PikeOS. Remove #warning.
* terminals.c: Port to PikeOS. Fix indentation of the stubs.
Add ATTRIBUTE_UNUSED to stubs arguments. Fix return statement
of stubbed __gnat_setup_parent_communication.
* adaint.c: Port to PikeOS. Reindent some preprocessor
directives to clarify nested if. Fix indentation. Add missing
ATTRIBUTE_UNUSED.
2014-07-17 Robert Dewar <dewar@adacore.com>
* sem_attr.adb: Minor reformatting.
2014-07-17 Robert Dewar <dewar@adacore.com> 2014-07-17 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb, exp_ch7.ads, sinfo.ads: Minor reformatting. * exp_ch7.adb, exp_ch7.ads, sinfo.ads: Minor reformatting.

View File

@ -73,6 +73,10 @@
#define HOST_OBJECT_SUFFIX ".obj" #define HOST_OBJECT_SUFFIX ".obj"
#endif #endif
#ifdef __PikeOS__
#define __BSD_VISIBLE 1
#endif
#ifdef IN_RTS #ifdef IN_RTS
#include "tconfig.h" #include "tconfig.h"
#include "tsystem.h" #include "tsystem.h"
@ -144,20 +148,20 @@ UINT CurrentCodePage;
/* wait.h processing */ /* wait.h processing */
#ifdef __MINGW32__ #ifdef __MINGW32__
#if OLD_MINGW # if OLD_MINGW
#include <sys/wait.h> # include <sys/wait.h>
#endif # endif
#elif defined (__vxworks) && defined (__RTP__) #elif defined (__vxworks) && defined (__RTP__)
#include <wait.h> # include <wait.h>
#elif defined (__Lynx__) #elif defined (__Lynx__)
/* ??? We really need wait.h and it includes resource.h on Lynx. GCC /* ??? We really need wait.h and it includes resource.h on Lynx. GCC
has a resource.h header as well, included instead of the lynx has a resource.h header as well, included instead of the lynx
version in our setup, causing lots of errors. We don't really need version in our setup, causing lots of errors. We don't really need
the lynx contents of this file, so just workaround the issue by the lynx contents of this file, so just workaround the issue by
preventing the inclusion of the GCC header from doing anything. */ preventing the inclusion of the GCC header from doing anything. */
#define GCC_RESOURCE_H # define GCC_RESOURCE_H
#include <sys/wait.h> # include <sys/wait.h>
#elif defined (__nucleus__) #elif defined (__nucleus__) || defined (__PikeOS__)
/* No wait() or waitpid() calls available. */ /* No wait() or waitpid() calls available. */
#else #else
/* Default case. */ /* Default case. */
@ -506,7 +510,7 @@ __gnat_readlink (char *path ATTRIBUTE_UNUSED,
size_t bufsiz ATTRIBUTE_UNUSED) size_t bufsiz ATTRIBUTE_UNUSED)
{ {
#if defined (_WIN32) || defined (VMS) \ #if defined (_WIN32) || defined (VMS) \
|| defined(__vxworks) || defined (__nucleus__) || defined(__vxworks) || defined (__nucleus__) || defined (__PikeOS__)
return -1; return -1;
#else #else
return readlink (path, buf, bufsiz); return readlink (path, buf, bufsiz);
@ -522,7 +526,7 @@ __gnat_symlink (char *oldpath ATTRIBUTE_UNUSED,
char *newpath ATTRIBUTE_UNUSED) char *newpath ATTRIBUTE_UNUSED)
{ {
#if defined (_WIN32) || defined (VMS) \ #if defined (_WIN32) || defined (VMS) \
|| defined(__vxworks) || defined (__nucleus__) || defined(__vxworks) || defined (__nucleus__) || defined (__PikeOS__)
return -1; return -1;
#else #else
return symlink (oldpath, newpath); return symlink (oldpath, newpath);
@ -532,7 +536,7 @@ __gnat_symlink (char *oldpath ATTRIBUTE_UNUSED,
/* Try to lock a file, return 1 if success. */ /* Try to lock a file, return 1 if success. */
#if defined (__vxworks) || defined (__nucleus__) \ #if defined (__vxworks) || defined (__nucleus__) \
|| defined (_WIN32) || defined (VMS) || defined (_WIN32) || defined (VMS) || defined (__PikeOS__)
/* Version that does not use link. */ /* Version that does not use link. */
@ -2475,13 +2479,14 @@ __gnat_is_symbolic_link (char *name ATTRIBUTE_UNUSED)
#endif #endif
int int
__gnat_portable_spawn (char *args[]) __gnat_portable_spawn (char *args[] ATTRIBUTE_UNUSED)
{ {
int status = 0; int status ATTRIBUTE_UNUSED = 0;
int finished ATTRIBUTE_UNUSED; int finished ATTRIBUTE_UNUSED;
int pid ATTRIBUTE_UNUSED; int pid ATTRIBUTE_UNUSED;
#if defined (__vxworks) || defined(__nucleus__) || defined(RTX) #if defined (__vxworks) || defined(__nucleus__) || defined(RTX) \
|| defined(__PikeOS__)
return -1; return -1;
#elif defined (_WIN32) #elif defined (_WIN32)
@ -2551,12 +2556,15 @@ __gnat_dup (int oldfd)
Return -1 if an error occurred. */ Return -1 if an error occurred. */
int int
__gnat_dup2 (int oldfd, int newfd) __gnat_dup2 (int oldfd ATTRIBUTE_UNUSED, int newfd ATTRIBUTE_UNUSED)
{ {
#if defined (__vxworks) && !defined (__RTP__) #if defined (__vxworks) && !defined (__RTP__)
/* Not supported on VxWorks 5.x, but supported on VxWorks 6.0 when using /* Not supported on VxWorks 5.x, but supported on VxWorks 6.0 when using
RTPs. */ RTPs. */
return -1; return -1;
#elif defined (__PikeOS__)
/* Not supported. */
return -1;
#elif defined (_WIN32) #elif defined (_WIN32)
/* Special case when oldfd and newfd are identical and are the standard /* Special case when oldfd and newfd are identical and are the standard
input, output or error as this makes Windows XP hangs. Note that we input, output or error as this makes Windows XP hangs. Note that we
@ -2809,10 +2817,12 @@ win32_wait (int *status)
#endif #endif
int int
__gnat_portable_no_block_spawn (char *args[]) __gnat_portable_no_block_spawn (char *args[] ATTRIBUTE_UNUSED)
{ {
#if defined (__vxworks) || defined (__nucleus__) || defined (RTX) #if defined (__vxworks) || defined (__nucleus__) || defined (RTX) \
|| defined (__PikeOS__)
/* Not supported. */
return -1; return -1;
#elif defined (_WIN32) #elif defined (_WIN32)
@ -2855,7 +2865,8 @@ __gnat_portable_wait (int *process_status)
int status = 0; int status = 0;
int pid = 0; int pid = 0;
#if defined (__vxworks) || defined (__nucleus__) || defined (RTX) #if defined (__vxworks) || defined (__nucleus__) || defined (RTX) \
|| defined (__PikeOS__)
/* Not sure what to do here, so do nothing but return zero. */ /* Not sure what to do here, so do nothing but return zero. */
#elif defined (_WIN32) #elif defined (_WIN32)

View File

@ -6,7 +6,7 @@
* * * *
* C Implementation File * * C Implementation File *
* * * *
* Copyright (C) 2005-2012, Free Software Foundation, Inc. * * Copyright (C) 2005-2014, Free Software Foundation, Inc. *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- * * terms of the GNU General Public License as published by the Free Soft- *
@ -224,7 +224,8 @@ __gnat_environ (void)
#endif #endif
} }
void __gnat_unsetenv (char *name) { void __gnat_unsetenv (char *name)
{
#if defined (VMS) #if defined (VMS)
/* Not implemented */ /* Not implemented */
return; return;
@ -282,12 +283,14 @@ void __gnat_unsetenv (char *name) {
#endif #endif
} }
void __gnat_clearenv (void) { void __gnat_clearenv (void)
{
#if defined (VMS) #if defined (VMS)
/* not implemented */ /* not implemented */
return; return;
#elif defined (sun) \ #elif defined (sun) \
|| (defined (__vxworks) && ! defined (__RTP__)) || defined (__Lynx__) || (defined (__vxworks) && ! defined (__RTP__)) || defined (__Lynx__) \
|| defined (__PikeOS__)
/* On Solaris, VxWorks (not RTPs), and Lynx there is no system /* On Solaris, VxWorks (not RTPs), and Lynx there is no system
call to unset a variable or to clear the environment so set all call to unset a variable or to clear the environment so set all
the entries in the environ table to NULL (see comment in the entries in the environ table to NULL (see comment in

View File

@ -6,7 +6,7 @@
* * * *
* C Implementation File * * C Implementation File *
* * * *
* Copyright (C) 2001-2011, AdaCore * * Copyright (C) 2001-2014, AdaCore *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- * * terms of the GNU General Public License as published by the Free Soft- *
@ -45,17 +45,17 @@
#include <sys/types.h> #include <sys/types.h>
#ifdef __MINGW32__ #ifdef __MINGW32__
#if OLD_MINGW # if OLD_MINGW
#include <sys/wait.h> # include <sys/wait.h>
#endif # endif
#elif defined (__vxworks) && defined (__RTP__) #elif defined (__vxworks) && defined (__RTP__)
#include <wait.h> # include <wait.h>
#elif defined (__Lynx__) #elif defined (__Lynx__)
/* ??? See comment in adaint.c. */ /* ??? See comment in adaint.c. */
#define GCC_RESOURCE_H # define GCC_RESOURCE_H
#include <sys/wait.h> # include <sys/wait.h>
#elif defined (__nucleus__) #elif defined (__nucleus__) || defined (__PikeOS__)
/* No wait.h available on Nucleus */ /* No wait.h available on Nucleus */
#else #else
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
@ -476,18 +476,20 @@ __gnat_expect_poll (int *fd, int num_fd, int timeout, int *is_set)
#else #else
void void
__gnat_kill (int pid, int sig, int close) __gnat_kill (int pid ATTRIBUTE_UNUSED,
int sig ATTRIBUTE_UNUSED,
int close ATTRIBUTE_UNUSED)
{ {
} }
int int
__gnat_waitpid (int pid, int sig) __gnat_waitpid (int pid ATTRIBUTE_UNUSED, int sig ATTRIBUTE_UNUSED)
{ {
return 0; return 0;
} }
int int
__gnat_pipe (int *fd) __gnat_pipe (int *fd ATTRIBUTE_UNUSED)
{ {
return -1; return -1;
} }
@ -499,13 +501,18 @@ __gnat_expect_fork (void)
} }
void void
__gnat_expect_portable_execvp (int *pid, char *cmd, char *argv[]) __gnat_expect_portable_execvp (int *pid ATTRIBUTE_UNUSED,
char *cmd ATTRIBUTE_UNUSED,
char *argv[] ATTRIBUTE_UNUSED)
{ {
*pid = 0; *pid = 0;
} }
int int
__gnat_expect_poll (int *fd, int num_fd, int timeout, int *is_set) __gnat_expect_poll (int *fd ATTRIBUTE_UNUSED,
int num_fd ATTRIBUTE_UNUSED,
int timeout ATTRIBUTE_UNUSED,
int *is_set ATTRIBUTE_UNUSED)
{ {
return -1; return -1;
} }

View File

@ -6,7 +6,7 @@
* * * *
* C Header File * * C Header File *
* * * *
* Copyright (C) 2004-2012, Free Software Foundation, Inc. * * Copyright (C) 2004-2014, Free Software Foundation, Inc. *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- * * terms of the GNU General Public License as published by the Free Soft- *
@ -29,9 +29,10 @@
* * * *
****************************************************************************/ ****************************************************************************/
#if defined(__nucleus__) || defined(VTHREADS) || defined(__ANDROID__) #if defined(__nucleus__) || defined(VTHREADS) || defined(__ANDROID__) \
|| defined(__PikeOS__)
#warning Sockets not supported on these platforms /* Sockets not supported on these platforms. */
#undef HAVE_SOCKETS #undef HAVE_SOCKETS
#else #else

View File

@ -522,10 +522,6 @@ package System.OS_Lib is
-- contains the name of the file to which it is linked. Symbolic links may -- contains the name of the file to which it is linked. Symbolic links may
-- span file systems and may refer to directories. -- span file systems and may refer to directories.
S_Owner : constant := 1;
S_Group : constant := 2;
S_Others : constant := 4;
procedure Set_Writable (Name : String); procedure Set_Writable (Name : String);
-- Change permissions on the named file to make it writable for its owner -- Change permissions on the named file to make it writable for its owner
@ -537,8 +533,15 @@ package System.OS_Lib is
-- This renaming is provided for backwards compatibility with previous -- This renaming is provided for backwards compatibility with previous
-- versions. The use of Set_Non_Writable is preferred (clearer name). -- versions. The use of Set_Non_Writable is preferred (clearer name).
S_Owner : constant := 1;
S_Group : constant := 2;
S_Others : constant := 4;
-- Constants for use in Mode parameter to Set_Executable
procedure Set_Executable (Name : String; Mode : Positive := S_Owner); procedure Set_Executable (Name : String; Mode : Positive := S_Owner);
-- Change permissions on the named file to make it executable for its owner -- Change permissions on the file given by Name to make it executable
-- for its owner, group or others, according to the setting of Mode.
-- As indicated, the default if no Mode parameter is given is owner.
procedure Set_Readable (Name : String); procedure Set_Readable (Name : String);
-- Change permissions on the named file to make it readable for its -- Change permissions on the named file to make it readable for its

View File

@ -10687,8 +10687,7 @@ package body Sem_Attr is
HB := HB :=
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Prefix => Prefix => Duplicate_Subexpr (P, Name_Req => True),
Duplicate_Subexpr (P, Name_Req => True),
Attribute_Name => Name_Last, Attribute_Name => Name_Last,
Expressions => Dims); Expressions => Dims);

View File

@ -6,7 +6,7 @@
* * * *
* C Implementation File * * C Implementation File *
* * * *
* Copyright (C) 2003-2012, Free Software Foundation, Inc. * * Copyright (C) 2003-2014, Free Software Foundation, Inc. *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- * * terms of the GNU General Public License as published by the Free Soft- *
@ -689,6 +689,4 @@ __gnat_servent_s_proto (struct servent * s)
return s->s_proto; return s->s_proto;
} }
#else
# warning Sockets are not supported on this platform
#endif /* defined(HAVE_SOCKETS) */ #endif /* defined(HAVE_SOCKETS) */

View File

@ -6,7 +6,7 @@
* * * *
* C Implementation File * * C Implementation File *
* * * *
* Copyright (C) 1992-2013, Free Software Foundation, Inc. * * Copyright (C) 1992-2014, Free Software Foundation, Inc. *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- * * terms of the GNU General Public License as published by the Free Soft- *
@ -314,7 +314,7 @@ getc_immediate_common (FILE *stream,
int *ch, int *ch,
int *end_of_file, int *end_of_file,
int *avail, int *avail,
int waiting) int waiting ATTRIBUTE_UNUSED)
{ {
#if defined (linux) || defined (sun) \ #if defined (linux) || defined (sun) \
|| defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \ || defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (__hpux__) \
@ -785,9 +785,11 @@ extern void
__gnat_localtime_tzoff (const time_t *, const int *, long *); __gnat_localtime_tzoff (const time_t *, const int *, long *);
void void
__gnat_localtime_tzoff (const time_t *timer, const int *is_historic, long *off) __gnat_localtime_tzoff (const time_t *timer ATTRIBUTE_UNUSED,
const int *is_historic ATTRIBUTE_UNUSED,
long *off ATTRIBUTE_UNUSED)
{ {
struct tm tp; struct tm tp ATTRIBUTE_UNUSED;
/* AIX, HPUX, Sun Solaris */ /* AIX, HPUX, Sun Solaris */
#if defined (_AIX) || defined (__hpux__) || defined (sun) #if defined (_AIX) || defined (__hpux__) || defined (sun)
@ -853,8 +855,8 @@ __gnat_localtime_tzoff (const time_t *timer, const int *is_historic, long *off)
/* Darwin, Free BSD, Linux, where component tm_gmtoff is present in /* Darwin, Free BSD, Linux, where component tm_gmtoff is present in
struct tm */ struct tm */
#elif defined (__APPLE__) || defined (__FreeBSD__) || defined (linux) ||\ #elif defined (__APPLE__) || defined (__FreeBSD__) || defined (linux) \
defined (__GLIBC__) || defined (__GLIBC__)
{ {
localtime_r (timer, &tp); localtime_r (timer, &tp);
*off = tp.tm_gmtoff; *off = tp.tm_gmtoff;

View File

@ -6,7 +6,7 @@
* * * *
* C Implementation File * * C Implementation File *
* * * *
* Copyright (C) 2008-2013, AdaCore * * Copyright (C) 2008-2014, AdaCore *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- * * terms of the GNU General Public License as published by the Free Soft- *
@ -31,27 +31,111 @@
/* First all usupported platforms. Add stubs for exported routines. */ /* First all usupported platforms. Add stubs for exported routines. */
#if defined (VMS) || defined (__vxworks) || defined (__Lynx__) || \ #if defined (VMS) || defined (__vxworks) || defined (__Lynx__) \
defined (__ANDROID__) || defined (__ANDROID__) || defined (__PikeOS__)
void * __gnat_new_tty (void) { return (void*)0; } #define ATTRIBUTE_UNUSED __attribute__((unused))
char * __gnat_tty_name (void* t) { return (char*)0; }
int __gnat_interrupt_pid (int pid) { return -1; } void *
int __gnat_interrupt_process (void* desc) { return -1; } __gnat_new_tty (void)
int __gnat_setup_communication (void** desc) { return -1; } {
void __gnat_setup_parent_communication return (void*)0;
(void* d, int* i, int* o, int*e, int*p) { return -1; } }
int __gnat_setup_child_communication
(void* d, char **n, int u) { return -1; } char *
int __gnat_terminate_process (void *desc) { return -1; } __gnat_tty_name (void* t ATTRIBUTE_UNUSED)
int __gnat_tty_fd (void* t) { return -1; } {
int __gnat_tty_supported (void) { return 0; } return (char*)0;
int __gnat_tty_waitpid (void *desc) { return 1; } }
void __gnat_close_tty (void* t) {}
void __gnat_free_process (void** process) {} int
void __gnat_reset_tty (void* t) {} __gnat_interrupt_pid (int pid ATTRIBUTE_UNUSED)
void __gnat_send_header (void* d, char h[5], int s, int *r) {} {
void __gnat_setup_winsize (void *desc, int rows, int columns) {} return -1;
}
int
__gnat_interrupt_process (void* desc ATTRIBUTE_UNUSED)
{
return -1;
}
int
__gnat_setup_communication (void** desc ATTRIBUTE_UNUSED)
{
return -1;
}
void
__gnat_setup_parent_communication (void *d ATTRIBUTE_UNUSED,
int *i ATTRIBUTE_UNUSED,
int *o ATTRIBUTE_UNUSED,
int *e ATTRIBUTE_UNUSED,
int *p ATTRIBUTE_UNUSED)
{
}
int
__gnat_setup_child_communication (void *d ATTRIBUTE_UNUSED,
char **n ATTRIBUTE_UNUSED,
int u ATTRIBUTE_UNUSED)
{
return -1;
}
int
__gnat_terminate_process (void *desc ATTRIBUTE_UNUSED)
{
return -1;
}
int
__gnat_tty_fd (void* t ATTRIBUTE_UNUSED)
{
return -1;
}
int
__gnat_tty_supported (void)
{
return 0;
}
int
__gnat_tty_waitpid (void *desc ATTRIBUTE_UNUSED)
{
return 1;
}
void
__gnat_close_tty (void* t ATTRIBUTE_UNUSED)
{
}
void
__gnat_free_process (void** process ATTRIBUTE_UNUSED)
{
}
void
__gnat_reset_tty (void* t ATTRIBUTE_UNUSED)
{
}
void
__gnat_send_header (void* d ATTRIBUTE_UNUSED,
char h[5] ATTRIBUTE_UNUSED,
int s ATTRIBUTE_UNUSED,
int *r ATTRIBUTE_UNUSED)
{
}
void
__gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED,
int rows ATTRIBUTE_UNUSED,
int columns ATTRIBUTE_UNUSED)
{
}
/* For Windows platforms. */ /* For Windows platforms. */