diff options
Diffstat (limited to 'gcc/ada/s-oscons-tmplt.c')
-rw-r--r-- | gcc/ada/s-oscons-tmplt.c | 40 |
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 */ |