This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Fix libcpp configury/portability issue


On Sun, 31 Oct 2004, Zack Weinberg wrote:
There are no inclusions of libcpp/internal.h anywhere in gcc/java (nor
should there be - any use of that header outside of cpplib is a bug).
And my patch has exactly the same effect as yours, it's just more
readable.  Thus I am inclined to think that this must be an unrelated
problem.

After some debugging, I believe you are right.


Definitely.  This is a complete and utter mess: two config.h files
plus auto-host.h, all containing definitions of HAVE_ICONV and
HAVE_ICONV_H (though not all have both and the latter even is not
consistent) is a software engineering nightmare.
I think maybe we should do with iconv.h what we already do with
libintl - have the intl directory determine the answer, and everyone
else just defers to that.

That seems like an excellent plan. Will you be able to work on that for 4.0?


For now, okay to commit the following patch, which is based on your suggestions and passed bootstrap on i386-unknown-freesbsd4.10 as well as i386-pc-linux-gnu?

Gerald

2004-11-04  Zack Weinberg  <zack@codesourcery.com>
            Gerald Pfeifer  <gerald@pfeifer.com>

	* internal.h (HAVE_ICONV): Undefine if we do not have
	HAVE_ICONV_H as well.

Index: internal.h
===================================================================
RCS file: /cvs/gcc/gcc/libcpp/internal.h,v
retrieving revision 1.7
diff -u -3 -p -r1.7 internal.h
--- internal.h	9 Sep 2004 19:16:55 -0000	1.7
+++ internal.h	31 Oct 2004 05:41:27 -0000
@@ -26,7 +26,11 @@ Foundation, 59 Temple Place - Suite 330,
  #include "symtab.h"
  #include "cpp-id-data.h"

-#if defined HAVE_ICONV_H && defined HAVE_ICONV
+#ifndef HAVE_ICONV_H
+#undef HAVE_ICONV
+#endif
+
+#ifdef HAVE_ICONV
  #include <iconv.h>
  #else
  #define HAVE_ICONV 0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]