summaryrefslogtreecommitdiff
path: root/gcc/ada/s-oscons-tmplt.c
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-09 18:30:59 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-09 18:30:59 +0000
commit1e23cdf1e0f4a2f1fb70ca2a0ee0d8c7b7674b7b (patch)
treefeb5078a18eb455193dd1046cb3751b5e455de7c /gcc/ada/s-oscons-tmplt.c
parent6f82734839c35968efea5902f40dc89d1741a63c (diff)
downloadgcc-1e23cdf1e0f4a2f1fb70ca2a0ee0d8c7b7674b7b.tar.gz
Merged with trunk at 155111.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ifunc@155112 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-oscons-tmplt.c')
-rw-r--r--gcc/ada/s-oscons-tmplt.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
index 48938d9d9d1..1e8bd520ceb 100644
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -84,12 +84,14 @@ pragma Style_Checks ("M32766");
#define _XOPEN_SOURCE 500
#elif defined (__mips) && defined (__sgi)
-/** For IRIX _XOPEN5 must be defined and _XOPEN_IOV_MAX must be used as IOV_MAX,
- ** otherwise IOV_MAX is not defined.
+/** For IRIX 6, _XOPEN5 must be defined and _XOPEN_IOV_MAX must be used as
+ ** IOV_MAX, otherwise IOV_MAX is not defined. IRIX 5 has neither.
**/
+#ifdef _XOPEN_IOV_MAX
#define _XOPEN5
#define IOV_MAX _XOPEN_IOV_MAX
#endif
+#endif
#include <stdlib.h>
#include <string.h>
@@ -161,6 +163,9 @@ int counter = 0;
#define CNS(name,comment) \
printf ("\n->CNS:$%d:" #name ":" name ":" comment, __LINE__);
+#define C(sname,type,value,comment)\
+ printf ("\n->C:$%d:" sname ":" #type ":" value ":" comment, __LINE__);
+
#define TXT(text) \
printf ("\n->TXT:$%d:" text, __LINE__);
@@ -174,7 +179,12 @@ int counter = 0;
#define CNS(name, comment) \
asm volatile("\n->CNS:%0:" #name ":" name ":" comment \
: : "i" (__LINE__));
-/* General expression constant */
+/* General expression named number */
+
+#define C(sname, type, value, comment) \
+ asm volatile("\n->C:%0:" sname ":" #type ":" value ":" comment \
+ : : "i" (__LINE__));
+/* Typed constant */
#define TXT(text) \
asm volatile("\n->TXT:%0:" text \
@@ -183,6 +193,8 @@ int counter = 0;
#endif
+#define CST(name,comment) C(#name,String,name,comment)
+
#define STR(x) STR1(x)
#define STR1(x) #x
@@ -233,10 +245,7 @@ package System.OS_Constants is
-- Platform identification --
-----------------------------
-*/
-TXT(" Target_Name : constant String := " STR(TARGET) ";")
-/*
- type Target_OS_Type is (Windows, VMS, Other_OS);
+ type OS_Type is (Windows, VMS, Other_OS);
*/
#if defined (__MINGW32__)
# define TARGET_OS "Windows"
@@ -245,7 +254,9 @@ TXT(" Target_Name : constant String := " STR(TARGET) ";")
#else
# define TARGET_OS "Other_OS"
#endif
-TXT(" Target_OS : constant Target_OS_Type := " TARGET_OS ";")
+C("Target_OS", OS_Type, TARGET_OS, "")
+#define Target_Name TARGET
+CST(Target_Name, "")
/*
-------------------
@@ -1189,7 +1200,7 @@ CND(SIZEOF_tv_usec, "tv_usec")
}
/*
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
+ -- Sizes of various data types
*/
#define SIZEOF_sockaddr_in (sizeof (struct sockaddr_in))
@@ -1201,12 +1212,11 @@ CND(SIZEOF_sockaddr_in, "struct sockaddr_in")
#endif
CND(SIZEOF_sockaddr_in6, "struct sockaddr_in6")
-/*
-
- -- Size of file descriptor sets
-*/
#define SIZEOF_fd_set (sizeof (fd_set))
CND(SIZEOF_fd_set, "fd_set");
+
+#define SIZEOF_struct_servent (sizeof (struct servent))
+CND(SIZEOF_struct_servent, "struct servent");
/*
-- Fields of struct hostent
@@ -1251,7 +1261,7 @@ CND(Has_Sockaddr_Len, "Sockaddr has sa_len field")
** Do not change the format of the line below without also updating the
** MaRTE Makefile.
**/
-TXT(" Thread_Blocking_IO : constant Boolean := True;")
+C("Thread_Blocking_IO", Boolean, "True", "")
/*
-- Set False for contexts where socket i/o are process blocking
@@ -1262,7 +1272,7 @@ TXT(" Thread_Blocking_IO : constant Boolean := True;")
#else
# define Inet_Pton_Linkname "__gnat_inet_pton"
#endif
-TXT(" Inet_Pton_Linkname : constant String := \"" Inet_Pton_Linkname "\";")
+CST(Inet_Pton_Linkname, "")
#endif /* HAVE_SOCKETS */