Am Montag, 19. Februar 2007 12:57 schrieb José Matos:
> On Monday 19 February 2007 11:48:57 am Georg Baum wrote:
> > José,
> >
> > can this go in? It moves the includes out of the lyx namespace and is
> > needed for gcc 3.2.
> 
>   Yes, if the purpose is to get gcc 3.2 working. :-)
> 
> > IMO it is a bug that later gcc accepts this code. 
> 
>   Hmm, not sure about this part. But since you are... :-)

I am not sure either. After further thinking a possible reason why later 
gccs acept this could be that unistd.h is included from somewhere else 
internally. In that case our code is still wrong, but it does not matter.

>   That is, I think that the fix is right and it makes sense, what I am 
not 
> sure is if it is a bug for gcc and msvc (sp?) to accept this code. :-)

MSVC is not affected, since the code in question is only used on unix.

With the attached patch I am now able to compile with gcc 3.2 and 3.3. I 
don't understand why it does not work without. Due to the changed C++ ABI 
from gcc 3.4 on I could not run the resulting binaries, but compilation 
works, so I see no reason why it should not work on a native gcc 3.2 or 
3.3 system. The final linking fails with gcc 3.3, but that is almost 
certainly another manifestation of the changed ABI.

I will be away now, so please put this in if it is OK.


Georg
Index: README
===================================================================
--- README	(Revision 17252)
+++ README	(Arbeitskopie)
@@ -75,8 +75,8 @@ How do I upgrade from an earlier LyX ver
 What do I need to compile LyX from the source distribution?
 
     * A good C++ compiler.  Development is being done mainly with
-      gcc/g++, but some others work also. As of LyX 1.4.0, you need at
-      least gcc 3.x.
+      gcc/g++, but some others work also. As of LyX 1.5.0, you need at
+      least gcc 3.2.x.
 
     * The Qt4 library, version 4.1.1 or newer.
 
Index: src/CutAndPaste.C
===================================================================
--- src/CutAndPaste.C	(Revision 17252)
+++ src/CutAndPaste.C	(Arbeitskopie)
@@ -331,7 +331,9 @@ PitPosPair eraseSelectionHelper(BufferPa
 void putClipboard(ParagraphList const & paragraphs, textclass_type textclass,
                   docstring const & plaintext)
 {
-	Buffer buffer(string(), false);
+	// For some strange reason gcc 3.2 and 3.3 do not accept
+	// Buffer buffer(string(), false);
+	Buffer buffer("", false);
 	buffer.setUnnamed(true);
 	buffer.paragraphs() = paragraphs;
 	buffer.params().textclass = textclass;
@@ -728,7 +730,9 @@ void pasteClipboard(LCursor & cur, Error
 	if (theClipboard().hasLyXContents()) {
 		string lyx = theClipboard().getAsLyX();
 		if (!lyx.empty()) {
-			Buffer buffer(string(), false);
+			// For some strange reason gcc 3.2 and 3.3 do not accept
+			// Buffer buffer(string(), false);
+			Buffer buffer("", false);
 			buffer.setUnnamed(true);
 			if (buffer.readString(lyx)) {
 				recordUndo(cur);

Reply via email to