diff options
Diffstat (limited to 'gcc/ada/s-oscons-tmplt.c')
-rw-r--r-- | gcc/ada/s-oscons-tmplt.c | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c index deb1855..5a034d5 100644 --- a/gcc/ada/s-oscons-tmplt.c +++ b/gcc/ada/s-oscons-tmplt.c @@ -89,7 +89,6 @@ pragma Style_Checks ("M32766"); /* Include gsocket.h before any system header so it can redefine FD_SETSIZE */ #include "gsocket.h" -#include "adaint.h" #include <stdlib.h> #include <string.h> @@ -114,12 +113,15 @@ pragma Style_Checks ("M32766"); /** ** For VxWorks, always include vxWorks.h (gsocket.h provides it only for - ** the case of runtime libraries that support sockets). + ** the case of runtime libraries that support sockets). Note: this must + ** be done before including adaint.h. **/ # include <vxWorks.h> #endif +#include "adaint.h" + #ifdef DUMMY # if defined (TARGET) @@ -1344,30 +1346,6 @@ CND(SIZEOF_struct_servent, "struct servent") CND(SIZEOF_sigset, "sigset") #endif -/** - ** Note: this constant can be used in the GNAT runtime library. In compiler - ** units on the other hand, System.OS_Constants is not available, so we - ** declare an Ada constant (Osint.File_Attributes_Size) independently, which - ** is at least as large as sizeof (struct file_attributes), and we have an - ** assertion at initialization of Osint checking that the size is indeed at - ** least sufficient. - **/ -#define SIZEOF_struct_file_attributes (sizeof (struct file_attributes)) -CND(SIZEOF_struct_file_attributes, "struct file_attributes") - -/** - ** Maximal size of buffer for struct dirent. Note: Since POSIX.1 does not - ** specify the size of the d_name field, and other nonstandard fields may - ** precede that field within the dirent structure, we must make a conservative - ** computation. - **/ -{ - struct dirent dent; -#define SIZEOF_struct_dirent_alloc \ - ((char*) &dent.d_name - (char*) &dent) + NAME_MAX + 1 -CND(SIZEOF_struct_dirent_alloc, "struct dirent allocation") -} - /* -- Fields of struct msghdr @@ -1508,6 +1486,38 @@ CND(PTHREAD_ONCE_SIZE, "pthread_once_t") #endif /* __APPLE__ || __linux__ */ +/* + + -------------------------------- + -- File and directory support -- + -------------------------------- + +*/ + +/** + ** Note: this constant can be used in the GNAT runtime library. In compiler + ** units on the other hand, System.OS_Constants is not available, so we + ** declare an Ada constant (Osint.File_Attributes_Size) independently, which + ** is at least as large as sizeof (struct file_attributes), and we have an + ** assertion at initialization of Osint checking that the size is indeed at + ** least sufficient. + **/ +#define SIZEOF_struct_file_attributes (sizeof (struct file_attributes)) +CND(SIZEOF_struct_file_attributes, "struct file_attributes") + +/** + ** Maximal size of buffer for struct dirent. Note: Since POSIX.1 does not + ** specify the size of the d_name field, and other nonstandard fields may + ** precede that field within the dirent structure, we must make a conservative + ** computation. + **/ +{ + struct dirent dent; +#define SIZEOF_struct_dirent_alloc \ + ((char*) &dent.d_name - (char*) &dent) + NAME_MAX + 1 +CND(SIZEOF_struct_dirent_alloc, "struct dirent allocation") +} + /** ** System-specific constants follow ** Each section should be activated if compiling for the corresponding |