Re: [matplotlib-devel] Solaris and GCC 4.3.x: error TTStreamWriter has no putc

2009-04-30 Thread Michael Droettboom
Thanks.  I have committed this to the 0.98.x branch and the trunk, so 
this fix will make it into the next release.

Mike

Dave Peterson wrote:
 When attempting to build matplotlib 0.98.5.2 on Solaris 10 using GCC 
 4.3.3, I get an error:

 ttconv/pprdrv_tt2.cpp: In member function ‘void 
 GlyphToType3::stack(TTStreamWriter, int)’:
 ttconv/pprdrv_tt2.cpp:107: error: ‘class TTStreamWriter’ has no member 
 named ‘putc’

 So I tried invoking GCC with the -E flag to get the output of the 
 preprocessor and I see that line 107 of pprdrv_tt2.cpp gets rewritten to:
 stream.putc(('{'), (__iob[1]));
 so it seems that something in GCC 4.3.3 on Solaris is defining a 
 putchar macro that is doing this, but not correspondingly being 
 applied to the pprdrv.h.

 Searching the list archives, I see that back in July  August, 2008 
 there was a brief thread between Peter Norton and Mike Droettboom 
 about this and a proposal was made to rename TTStreamWriter::putchar 
 to TTStreamWriter:put_char. I just looked at the trunk and it looks 
 like this has never been done. Was there some other work-around that 
 didn't make it into the thread that obviated the need for the 
 mentioned change?

 I can confirm that the renaming of putchar to put_char does solve the 
 problem. I've attached a patch file, though it is against 0.98.5.2.


 -- Dave

 

 --
 Register Now  Save for Velocity, the Web Performance  Operations 
 Conference from O'Reilly Media. Velocity features a full day of 
 expert-led, hands-on workshops and two days of sessions from industry 
 leaders in dedicated Performance  Operations tracks. Use code vel09scf 
 and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
 

 ___
 Matplotlib-devel mailing list
 Matplotlib-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Register Now  Save for Velocity, the Web Performance  Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance  Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Solaris and GCC 4.3.x: error TTStreamWriter has no putc

2009-04-29 Thread Dave Peterson
When attempting to build matplotlib 0.98.5.2 on Solaris 10 using GCC 
4.3.3, I get an error:


ttconv/pprdrv_tt2.cpp: In member function ‘void 
GlyphToType3::stack(TTStreamWriter, int)’:
ttconv/pprdrv_tt2.cpp:107: error: ‘class TTStreamWriter’ has no member 
named ‘putc’


So I tried invoking GCC with the -E flag to get the output of the 
preprocessor and I see that line 107 of pprdrv_tt2.cpp gets rewritten to:

stream.putc(('{'), (__iob[1]));
so it seems that something in GCC 4.3.3 on Solaris is defining a putchar 
macro that is doing this, but not correspondingly being applied to the 
pprdrv.h.


Searching the list archives, I see that back in July  August, 2008 
there was a brief thread between Peter Norton and Mike Droettboom about 
this and a proposal was made to rename TTStreamWriter::putchar to 
TTStreamWriter:put_char. I just looked at the trunk and it looks like 
this has never been done. Was there some other work-around that didn't 
make it into the thread that obviated the need for the mentioned change?


I can confirm that the renaming of putchar to put_char does solve the 
problem. I've attached a patch file, though it is against 0.98.5.2.



-- Dave

--- ttconv/pprdrv.h Wed Apr 29 15:04:00 2009
+++ ttconv/pprdrv.h Wed Apr 29 15:08:46 2009
@@ -40,7 +40,7 @@
   virtual void write(const char*) = 0;
 
   virtual void printf(const char* format, ...);
-  virtual void putchar(int val);
+  virtual void put_char(int val);
   virtual void puts(const char* a);
   virtual void putline(const char* a);
 };

--- ttconv/pprdrv_tt.cppWed Apr 29 15:06:16 2009
+++ ttconv/pprdrv_tt.cppWed Apr 29 15:08:46 2009
@@ -482,20 +482,20 @@
 
 if(!in_string)
{
-   stream.putchar('');
+   stream.put_char('');
string_len=0;
line_len++;
in_string=TRUE;
}
 
-stream.putchar( hexdigits[ n / 16 ] );
-stream.putchar( hexdigits[ n % 16 ] );
+stream.put_char( hexdigits[ n / 16 ] );
+stream.put_char( hexdigits[ n % 16 ] );
 string_len++;
 line_len+=2;
 
 if(line_len  70)
{
-   stream.putchar('\n');
+   stream.put_char('\n');
line_len=0;
}
 
@@ -548,7 +548,7 @@
#endif
 
sfnts_pputBYTE(stream, 0);  /* extra byte for pre-2013 
compatibility */
-   stream.putchar('');
+   stream.put_char('');
line_len++;
}
 in_string=FALSE;
@@ -955,7 +955,7 @@
 /* a BuildGlyph and BuildChar proceedures. */
 if( font-target_type == PS_TYPE_3 )
{
-   stream.putchar('\n');
+   stream.put_char('\n');
 
stream.putline(/BuildGlyph);
stream.putline( {exch begin); /* start font dictionary */
@@ -964,7 +964,7 @@
stream.putline( true 3 1 roll get exec);
stream.putline( end}_d);
 
-   stream.putchar('\n');
+   stream.put_char('\n');
 
/* This proceedure is for compatiblity with */
/* level 1 interpreters. */
@@ -973,7 +973,7 @@
stream.putline( 1 index /BuildGlyph get exec);
stream.putline(}_d);
 
-   stream.putchar('\n');
+   stream.put_char('\n');
}
 
 /* If we are generating a type 42 font, we need to check to see */
@@ -985,7 +985,7 @@
 /* setup instructions and part of BuildGlyph came from. */
 else if( font-target_type == PS_TYPE_42 )
{
-   stream.putchar('\n');
+   stream.put_char('\n');
 
/* If we have no resourcestatus command, or FontType 42 */
/* is unknown, leave true on the stack. */
@@ -1066,7 +1066,7 @@
/* if the printer has no built-in TrueType */
/* rasterizer. */
stream.putline(}if);
-   stream.putchar('\n');
+   stream.put_char('\n');
} /* end of if Type 42 not understood. */
 
 stream.putline(FontName currentdict end definefont pop);

--- ttconv/pprdrv_tt2.cpp   Wed Apr 29 15:10:48 2009
+++ ttconv/pprdrv_tt2.cpp   Wed Apr 29 15:08:46 2009
@@ -104,7 +104,7 @@
{   /* have a log of points. */
if(stack_depth == 0)
{
-   stream.putchar('{');
+   stream.put_char('{');
stack_depth=1;
}
 

--- ttconv/ttutil.cpp   Wed Apr 29 15:04:25 2009
+++ ttconv/ttutil.cpp   Wed Apr 29 15:08:46 2009
@@ -52,7 +52,7 @@
   va_end(arg_list);
 }
 
-void TTStreamWriter::putchar(int val)
+void TTStreamWriter::put_char(int val)
 {
   char c[2];
   c[0] = (char)val;
--
Register Now  Save for Velocity, the Web Performance  Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance  Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf___
Matplotlib-devel mailing list