Use libiberty's lrealpath to avoid portability problems.
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 12 Mar 2019 16:31:48 +0000 (16:31 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Tue, 12 Mar 2019 16:31:48 +0000 (16:31 +0000)
The dmd front-end function FileName::canonicalName could be called
during the semantic pass of import("file") expressions, so still
requires that realpath() be redefined.

Initial patch by Rainer Orth.

gcc/d/ChangeLog:

2019-03-12  Iain Buclaw  <ibuclaw@gdcproject.org>

PR d/87866
* d-system.h (realpath): Redefine as lrealpath.

From-SVN: r269619

gcc/d/ChangeLog
gcc/d/d-system.h

index c91a05079b73519338531785fa71ce9e89059b95..6c96ec4bf5b66e9682806262fb2523f3ab9aa6f2 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-12  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       PR d/87866
+       * d-system.h (realpath): Redefine as lrealpath.
+
 2019-03-12  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        * d-lang.cc (d_init_options): Set global.params.cplusplus to C++14.
index c32825d4ad1139a67ff900a306bd1d84a08b4b38..efece15f3bc45a6addb9c8f89b7401485596e6a8 100644 (file)
 #undef assert
 #define assert(EXPR) gcc_assert(EXPR)
 
+/* Use libiberty's lrealpath to avoid portability problems.  */
+#undef realpath
+#define realpath(a, b) lrealpath((a))
+
 /* Forward ctype.h macros used by the dmd front-end to safe-ctype.h.  */
 #undef isalpha
 #define isalpha(c) ISALPHA(c)