summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfw <fw@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-31 18:08:23 +0000
committerfw <fw@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-31 18:08:23 +0000
commite633acdccf3bb692ff71893fbed007ad4bb1e50b (patch)
tree8d012631d1d115c229144aa1e14548aa4e54f077
parent100797c8d5647a69f8d4754a5336e14dad80f808 (diff)
downloadgcc-e633acdccf3bb692ff71893fbed007ad4bb1e50b.tar.gz
2002-05-31 Florian Weimer <fw@deneb.enyo.de>
* cstreams.c (max_path_len): Move from here ... * adaint.c (__gnat_max_path_len): ... to here. * adaint.c (__gnat_max_path_len): Declare. * g-dirope.adb (Max_Path): Adjust. * g-os_lib.adb (Normalize_Pathname.Max_Path): Adjust. * i-cstrea.ads (max_path_len): Adjust. * osint.adb (Get_RTS_Search_Dir.Max_Path): Adjust. * xr_tabls.adb (Dir_Name.Max_Path: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54112 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/adaint.c18
-rw-r--r--gcc/ada/adaint.h1
-rw-r--r--gcc/ada/cstreams.c27
-rw-r--r--gcc/ada/g-dirope.adb2
-rw-r--r--gcc/ada/g-os_lib.adb2
-rw-r--r--gcc/ada/i-cstrea.ads2
-rw-r--r--gcc/ada/osint.adb2
-rw-r--r--gcc/ada/xr_tabls.adb2
9 files changed, 39 insertions, 26 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index bc6c95d28ba..7c5f96095c5 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,14 @@
2002-05-31 Florian Weimer <fw@deneb.enyo.de>
+ * cstreams.c (max_path_len): Move from here ...
+ * adaint.c (__gnat_max_path_len): ... to here.
+ * adaint.c (__gnat_max_path_len): Declare.
+ * g-dirope.adb (Max_Path): Adjust.
+ * g-os_lib.adb (Normalize_Pathname.Max_Path): Adjust.
+ * i-cstrea.ads (max_path_len): Adjust.
+ * osint.adb (Get_RTS_Search_Dir.Max_Path): Adjust.
+ * xr_tabls.adb (Dir_Name.Max_Path: Adjust.
+
* Makefile.in, Make-lang.in: Documentation is now built in
Make-lang.in. Store Info and generated Texinfo files in the
source directory.
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 4bb97b7eab6..de733ff24f3 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -213,6 +213,24 @@ const int __gnat_vmsp = 1;
const int __gnat_vmsp = 0;
#endif
+/* This variable is used to export the maximum length of a path name to
+ Ada code. */
+
+#ifdef __EMX__
+int __gnat_max_path_len = _MAX_PATH;
+
+#elif defined (VMS)
+int __gnat_max_path_len = 4096; /* PATH_MAX */
+
+#elif defined (__vxworks) || defined (__OPENNT)
+int __gnat_max_path_len = PATH_MAX;
+
+#else
+#include <sys/param.h>
+int __gnat_max_path_len = MAXPATHLEN;
+
+#endif
+
/* The following macro HAVE_READDIR_R should be defined if the
system provides the routine readdir_r. */
#undef HAVE_READDIR_R
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index f8b1e827fcc..c7b6a4d90a0 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -33,6 +33,7 @@
#include <dirent.h>
+extern int __gnat_max_path_len;
extern void __gnat_to_gm_time PARAMS ((int *, int *,
int *, int *,
int *, int *,
diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
index ef066fc29c5..5061fd85209 100644
--- a/gcc/ada/cstreams.c
+++ b/gcc/ada/cstreams.c
@@ -48,20 +48,11 @@
#include "adaint.h"
-#ifdef __EMX__
-int max_path_len = _MAX_PATH;
-#elif defined (VMS)
+#ifdef VMS
#include <unixlib.h>
-int max_path_len = 4096; /* PATH_MAX */
-
-#elif defined (__vxworks) || defined (__OPENNT)
-
-int max_path_len = PATH_MAX;
-
-#else
+#endif
#ifdef linux
-
/* Don't use macros on GNU/Linux since they cause incompatible changes between
glibc 2.0 and 2.1 */
@@ -74,12 +65,6 @@ int max_path_len = PATH_MAX;
#ifdef stdout
# undef stdout
#endif
-
-#endif
-
-#include <sys/param.h>
-
-int max_path_len = MAXPATHLEN;
#endif
/* The _IONBF value in CYGNUS or MINGW32 stdio.h is wrong. */
@@ -185,7 +170,7 @@ __gnat_full_name (nam, buffer)
strcpy (buffer, nam);
else
{
- _fullpath (buffer, nam, max_path_len);
+ _fullpath (buffer, nam, __gnat_max_path_len);
for (p = buffer; *p; p++)
if (*p == '/')
@@ -210,10 +195,10 @@ __gnat_full_name (nam, buffer)
strcpy (buffer, __gnat_to_host_file_spec (buffer));
else
{
- char *nambuffer = alloca (max_path_len);
+ char *nambuffer = alloca (__gnat_max_path_len);
strcpy (nambuffer, buffer);
- strcpy (buffer, getcwd (buffer, max_path_len, 0));
+ strcpy (buffer, getcwd (buffer, __gnat_max_path_len, 0));
strcat (buffer, "/");
strcat (buffer, nambuffer);
strcpy (buffer, __gnat_to_host_file_spec (buffer));
@@ -224,7 +209,7 @@ __gnat_full_name (nam, buffer)
#else
if (nam[0] != '/')
{
- p = getcwd (buffer, max_path_len);
+ p = getcwd (buffer, __gnat_max_path_len);
if (p == 0)
{
buffer[0] = '\0';
diff --git a/gcc/ada/g-dirope.adb b/gcc/ada/g-dirope.adb
index f7dcf092ac5..892684357c5 100644
--- a/gcc/ada/g-dirope.adb
+++ b/gcc/ada/g-dirope.adb
@@ -502,7 +502,7 @@ package body GNAT.Directory_Operations is
---------------------
Max_Path : Integer;
- pragma Import (C, Max_Path, "max_path_len");
+ pragma Import (C, Max_Path, "__gnat_max_path_len");
function Get_Current_Dir return Dir_Name_Str is
Current_Dir : String (1 .. Max_Path + 1);
diff --git a/gcc/ada/g-os_lib.adb b/gcc/ada/g-os_lib.adb
index 590b061a8ad..524c3d42892 100644
--- a/gcc/ada/g-os_lib.adb
+++ b/gcc/ada/g-os_lib.adb
@@ -877,7 +877,7 @@ package body GNAT.OS_Lib is
return String
is
Max_Path : Integer;
- pragma Import (C, Max_Path, "max_path_len");
+ pragma Import (C, Max_Path, "__gnat_max_path_len");
-- Maximum length of a path name
procedure Get_Current_Dir
diff --git a/gcc/ada/i-cstrea.ads b/gcc/ada/i-cstrea.ads
index 75498b3037b..3c4af586628 100644
--- a/gcc/ada/i-cstrea.ads
+++ b/gcc/ada/i-cstrea.ads
@@ -283,7 +283,7 @@ private
pragma Import (C, set_binary_mode, "__gnat_set_binary_mode");
pragma Import (C, set_text_mode, "__gnat_set_text_mode");
- pragma Import (C, max_path_len, "max_path_len");
+ pragma Import (C, max_path_len, "__gnat_max_path_len");
pragma Import (C, full_name, "__gnat_full_name");
-- The following may be implemented as macros, and so are supported
diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb
index 2ae929006a8..5086d6c6670 100644
--- a/gcc/ada/osint.adb
+++ b/gcc/ada/osint.adb
@@ -941,7 +941,7 @@ package body Osint is
pragma Import (C, Get_Current_Dir, "__gnat_get_current_dir");
Max_Path : Integer;
- pragma Import (C, Max_Path, "max_path_len");
+ pragma Import (C, Max_Path, "__gnat_max_path_len");
-- Maximum length of a path name
Current_Dir : String_Ptr;
diff --git a/gcc/ada/xr_tabls.adb b/gcc/ada/xr_tabls.adb
index 057485295d0..8149d9416dd 100644
--- a/gcc/ada/xr_tabls.adb
+++ b/gcc/ada/xr_tabls.adb
@@ -629,7 +629,7 @@ package body Xr_Tabls is
else
declare
Max_Path : Integer;
- pragma Import (C, Max_Path, "max_path_len");
+ pragma Import (C, Max_Path, "__gnat_max_path_len");
Base2 : Dir_Name_Str (1 .. Max_Path);
Last : Natural;