🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.windows.interviews
3 messages
3 total messages Started by Johan Garpendahl Tue, 05 Jan 1993 21:58
Patches to make IV3.1 compile better with gcc-2.3.3
#1613
Author: Johan Garpendahl
Date: Tue, 05 Jan 1993 21:58
1017 lines
32692 bytes
Here are a few patches to make InterViews 3.1 compile better with gcc-2.3.3.

Most of them changes the inheritance of class Resource to be public virtual
instead of just public (That makes doc work!).

There are a few type-casts to make gcc shut up about passing floats as
arguments instead of ints. It shouldn't make any difference, but it
looks nice if you save the output from the compilation. :-)

There's also a fix gives you 14 patterns in idraw instead of 4 or 5.
I'm not quite sure if the bug is in the (libg++) iostream library or
if it's in the InterViews code. I think InterViews relies on a cfront
"feature". 

I've also fixed the RPC classes so that they work with gcc.
The iostream implementation is changed which made this a lot easier,
but the most important thing was to find out what "zapeof" does.
I read it as "zape of" (Misspelled "sizeof" :-), but it should be 
"zap eof". It's a one-liner!

Also, you should take a look at gcc.def and local.def after
applying these diffs.

Don't try to compile with -O2.
Don't try to make shared libraries.
I tried it.

You'll find these patches at

           isy.liu.se:/pub/C++-classes/InterViews/local/

You can also find the binaries here compiled with gcc, statically
linked.

Happy hacking,

	Johan

-----------------------------8<----------------------------------------
diff -rc /site/src/packages/InterViews3.1/iv/src/bin/doc/Document.h ./src/bin/doc/Document.h
*** /site/src/packages/InterViews3.1/iv/src/bin/doc/Document.h	Tue Jun  9 19:49:59 1992
--- ./src/bin/doc/Document.h	Fri Jan  1 16:01:02 1993
***************
*** 70,76 ****
      int _depth;
  };
  
! class Document : public Resource {
  public:
      Document (Application*, int size_hint = 0);
  
--- 70,76 ----
      int _depth;
  };
  
! class Document : public virtual Resource {
  public:
      Document (Application*, int size_hint = 0);
  
diff -rc /site/src/packages/InterViews3.1/iv/src/bin/doc/IdrawImage.c ./src/bin/doc/IdrawImage.c
*** /site/src/packages/InterViews3.1/iv/src/bin/doc/IdrawImage.c	Sat Apr 11 07:29:07 1992
--- ./src/bin/doc/IdrawImage.c	Fri Jan  1 16:01:03 1993
***************
*** 224,230 ****
      }
  }
  
! class Stipple : public Resource {
  public:
      Stipple (float dither);
  
--- 224,230 ----
      }
  }
  
! class Stipple : public virtual Resource {
  public:
      Stipple (float dither);
  
diff -rc /site/src/packages/InterViews3.1/iv/src/bin/ibuild/ibdialog.c ./src/bin/ibuild/ibdialog.c
*** /site/src/packages/InterViews3.1/iv/src/bin/ibuild/ibdialog.c	Wed Oct 28 02:19:27 1992
--- ./src/bin/ibuild/ibdialog.c	Mon Jan  4 20:05:06 1993
***************
*** 37,42 ****
--- 37,43 ----
  #include <Unidraw/catalog.h>
  #include <stream.h>
  #include <string.h>
+ #include <stdio.h>
  
  /*****************************************************************************/
  
diff -rc /site/src/packages/InterViews3.1/iv/src/config/InterViews/gcc.def ./src/config/InterViews/gcc.def
*** /site/src/packages/InterViews3.1/iv/src/config/InterViews/gcc.def	Wed Sep  9 00:38:37 1992
--- ./src/config/InterViews/gcc.def	Tue Jan  5 15:10:18 1993
***************
*** 6,21 ****
  #define LanguageCCDefines -Dcplusplus_2_1
  
  #ifndef CCDriver
! #define CCDriver g++
  #endif
  
  #ifndef DependCCFlags
! #define DependCCFlags $(CCDEFINES) $(CCINCLUDES)
  #endif
  
  #ifndef ExtraCCLdLibs
  #define ExtraCCLdLibs -lg++
  #endif
  
  #undef HasSunOSSharedLibraries
  #define HasSunOSSharedLibraries NO
--- 6,42 ----
  #define LanguageCCDefines -Dcplusplus_2_1
  
  #ifndef CCDriver
! #define CCDriver g++ -O -static
  #endif
  
+ /*
+ #ifndef OptimizeCCFlags
+ #define OptimizeCCFlags 
+ #endif
+ 
+ #ifndef DebugCCFlags
+ #define DebugCCFlags
+ #endif
+ */
+ 
+ #ifndef TIFFCDriver
+ #define TIFFCDriver gcc -traditional
+ #endif 
+ 
+ #ifndef TIFFOptimizeCFlags
+ #define TIFFOptimizeCFlags -O
+ #endif 
+ 
  #ifndef DependCCFlags
! #define DependCCFlags $(CCDEFINES) $(CCINCLUDES) -I/usr/local/gnu/gcc-2.3.3/lib/g++-include -I/usr/local/gnu/gcc-2.3.3/lib/gcc-lib/sun4/2.3.3/include
  #endif
  
  #ifndef ExtraCCLdLibs
  #define ExtraCCLdLibs -lg++
  #endif
+ 
+ #undef SharedCCFlags
+ #define SharedCCFlags -fPIC -fshared-data
  
  #undef HasSunOSSharedLibraries
  #define HasSunOSSharedLibraries NO
diff -rc /site/src/packages/InterViews3.1/iv/src/config/InterViews/local.def ./src/config/InterViews/local.def
*** /site/src/packages/InterViews3.1/iv/src/config/InterViews/local.def	Tue Nov 24 21:08:51 1992
--- ./src/config/InterViews/local.def	Mon Jan  4 01:45:27 1993
***************
*** 8,14 ****
  /*
   * If you are using gcc/g++, then uncomment the include below.
   */
! /* #include <InterViews/gcc.def> */
  
  /*
   * Default customization of kits.
--- 8,14 ----
  /*
   * If you are using gcc/g++, then uncomment the include below.
   */
! #include <InterViews/gcc.def>
  
  /*
   * Default customization of kits.
***************
*** 33,38 ****
--- 33,43 ----
  #define BuildRPCClasses YES
  #endif
  
+ /* I'm using gcc
+ #undef BuildRPCClasses
+ #define BuildRPCClasses NO
+ */
+ 
  /*
   * Delete this definition if your /tmp space is less than five megabytes.
   */
***************
*** 49,55 ****
   * installed data files.
   */
  #undef InstalledRoot
! #define InstalledRoot /interviews
  
  /*
   * If the X11 config files are not in /usr/lib/X11/config, the X11
--- 54,60 ----
   * installed data files.
   */
  #undef InstalledRoot
! #define InstalledRoot /usr/local/InterViews3.1
  
  /*
   * If the X11 config files are not in /usr/lib/X11/config, the X11
diff -rc /site/src/packages/InterViews3.1/iv/src/examples/ips/idraw.c ./src/examples/ips/idraw.c
*** /site/src/packages/InterViews3.1/iv/src/examples/ips/idraw.c	Fri Nov  6 19:14:33 1992
--- ./src/examples/ips/idraw.c	Fri Jan  1 16:01:03 1993
***************
*** 54,60 ****
  declareList(BrushInfoList,BrushInfo)
  implementList(BrushInfoList,BrushInfo)
  
! class Stipple : public Resource {
  public:
      Stipple(float dither);
  
--- 54,60 ----
  declareList(BrushInfoList,BrushInfo)
  implementList(BrushInfoList,BrushInfo)
  
! class Stipple : public virtual Resource {
  public:
      Stipple(float dither);
  
diff -rc /site/src/packages/InterViews3.1/iv/src/examples/morpher/idraw.c ./src/examples/morpher/idraw.c
*** /site/src/packages/InterViews3.1/iv/src/examples/morpher/idraw.c	Thu Oct 22 22:53:14 1992
--- ./src/examples/morpher/idraw.c	Fri Jan  1 16:01:04 1993
***************
*** 30,36 ****
  declareList(BrushInfoList,BrushInfo)
  implementList(BrushInfoList,BrushInfo)
  
! class Stipple : public Resource {
  public:
      Stipple(float dither);
  
--- 30,36 ----
  declareList(BrushInfoList,BrushInfo)
  implementList(BrushInfoList,BrushInfo)
  
! class Stipple : public virtual Resource {
  public:
      Stipple(float dither);
  
diff -rc /site/src/packages/InterViews3.1/iv/src/include/IV-2_6/InterViews/painter.h ./src/include/IV-2_6/InterViews/painter.h
*** /site/src/packages/InterViews3.1/iv/src/include/IV-2_6/InterViews/painter.h	Tue Feb 11 19:55:26 1992
--- ./src/include/IV-2_6/InterViews/painter.h	Fri Jan  1 16:01:04 1993
***************
*** 47,53 ****
  class Bitmap;
  class Raster;
  
! class Painter : public Resource {
  public:
      Painter();
      Painter(Painter*);
--- 47,53 ----
  class Bitmap;
  class Raster;
  
! class Painter : public virtual Resource {
  public:
      Painter();
      Painter(Painter*);
diff -rc /site/src/packages/InterViews3.1/iv/src/include/IV-2_6/InterViews/perspective.h ./src/include/IV-2_6/InterViews/perspective.h
*** /site/src/packages/InterViews3.1/iv/src/include/IV-2_6/InterViews/perspective.h	Tue Feb 11 19:55:28 1992
--- ./src/include/IV-2_6/InterViews/perspective.h	Fri Jan  1 16:01:04 1993
***************
*** 39,45 ****
  class Interactor;
  class ViewList;
  
! class Perspective : public Resource {
  public:
      IntCoord x0, y0;		/* origin of view */
      int width, height;		/* total size of view */
--- 39,45 ----
  class Interactor;
  class ViewList;
  
! class Perspective : public virtual Resource {
  public:
      IntCoord x0, y0;		/* origin of view */
      int width, height;		/* total size of view */
diff -rc /site/src/packages/InterViews3.1/iv/src/include/IV-2_6/InterViews/rubband.h ./src/include/IV-2_6/InterViews/rubband.h
*** /site/src/packages/InterViews3.1/iv/src/include/IV-2_6/InterViews/rubband.h	Tue Feb 11 19:55:30 1992
--- ./src/include/IV-2_6/InterViews/rubband.h	Fri Jan  1 16:01:05 1993
***************
*** 38,44 ****
  class Canvas;
  class Painter;
  
! class Rubberband : public Resource {
  public:
      Rubberband(Painter*, Canvas*, IntCoord offx, IntCoord offy);
      virtual ~Rubberband();
--- 38,44 ----
  class Canvas;
  class Painter;
  
! class Rubberband : public virtual Resource {
  public:
      Rubberband(Painter*, Canvas*, IntCoord offx, IntCoord offy);
      virtual ~Rubberband();
diff -rc /site/src/packages/InterViews3.1/iv/src/include/IV-2_6/InterViews/tray.h ./src/include/IV-2_6/InterViews/tray.h
*** /site/src/packages/InterViews3.1/iv/src/include/IV-2_6/InterViews/tray.h	Tue Feb 11 19:55:49 1992
--- ./src/include/IV-2_6/InterViews/tray.h	Fri Jan  1 16:01:05 1993
***************
*** 39,45 ****
  class TrayElement;
  class TSolver;
  
! class TGlue : public Resource {
  public:
      TGlue(int w = 0, int h = 0, int hstretch = hfil, int vstretch = vfil);
      TGlue(int w, int h, int hshr, int hstr, int vshr, int vstr);
--- 39,45 ----
  class TrayElement;
  class TSolver;
  
! class TGlue : public virtual Resource {
  public:
      TGlue(int w = 0, int h = 0, int hstretch = hfil, int vstretch = vfil);
      TGlue(int w, int h, int hshr, int hstr, int vshr, int vstr);
diff -rc /site/src/packages/InterViews3.1/iv/src/include/IV-X11/xfont.h ./src/include/IV-X11/xfont.h
*** /site/src/packages/InterViews3.1/iv/src/include/IV-X11/xfont.h	Thu Jul 25 18:44:05 1991
--- ./src/include/IV-X11/xfont.h	Fri Jan  1 16:01:05 1993
***************
*** 39,45 ****
  class KnownFonts;
  class String;
  
! class FontRep : public Resource {
  public:
      FontRep(Display*, XFontStruct*, float);
      ~FontRep();
--- 39,45 ----
  class KnownFonts;
  class String;
  
! class FontRep : public virtual Resource {
  public:
      FontRep(Display*, XFontStruct*, float);
      ~FontRep();
diff -rc /site/src/packages/InterViews3.1/iv/src/include/IV-look/fchooser.h ./src/include/IV-look/fchooser.h
*** /site/src/packages/InterViews3.1/iv/src/include/IV-look/fchooser.h	Wed Jul  1 00:05:02 1992
--- ./src/include/IV-look/fchooser.h	Fri Jan  1 16:01:06 1993
***************
*** 39,45 ****
  class String;
  class WidgetKit;
  
! class FileChooserAction : public Resource {
  protected:
      FileChooserAction();
      virtual ~FileChooserAction();
--- 39,45 ----
  class String;
  class WidgetKit;
  
! class FileChooserAction : public virtual Resource {
  protected:
      FileChooserAction();
      virtual ~FileChooserAction();
diff -rc /site/src/packages/InterViews3.1/iv/src/include/IV-look/field.h ./src/include/IV-look/field.h
*** /site/src/packages/InterViews3.1/iv/src/include/IV-look/field.h	Wed Jul 29 23:39:49 1992
--- ./src/include/IV-look/field.h	Fri Jan  1 16:01:06 1993
***************
*** 38,44 ****
  class Style;
  class WidgetKit;
  
! class FieldEditorAction : public Resource {
  protected:
      FieldEditorAction();
      virtual ~FieldEditorAction();
--- 38,44 ----
  class Style;
  class WidgetKit;
  
! class FieldEditorAction : public virtual Resource {
  protected:
      FieldEditorAction();
      virtual ~FieldEditorAction();
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/action.h ./src/include/InterViews/action.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/action.h	Mon Jun  1 23:07:00 1992
--- ./src/include/InterViews/action.h	Fri Jan  1 16:01:06 1993
***************
*** 33,39 ****
  
  #include <InterViews/_enter.h>
  
! class Action : public Resource {
  protected:
      Action();
      virtual ~Action();
--- 33,39 ----
  
  #include <InterViews/_enter.h>
  
! class Action : public virtual Resource {
  protected:
      Action();
      virtual ~Action();
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/bitmap.h ./src/include/InterViews/bitmap.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/bitmap.h	Wed Feb 12 00:22:48 1992
--- ./src/include/InterViews/bitmap.h	Fri Jan  1 16:01:06 1993
***************
*** 38,44 ****
  class Font;
  class Transformer;
  
! class Bitmap : public Resource {
  public:
      Bitmap(
  	const void*, unsigned int width, unsigned int height,
--- 38,44 ----
  class Font;
  class Transformer;
  
! class Bitmap : public virtual Resource {
  public:
      Bitmap(
  	const void*, unsigned int width, unsigned int height,
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/brush.h ./src/include/InterViews/brush.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/brush.h	Tue Feb 11 18:33:37 1992
--- ./src/include/InterViews/brush.h	Fri Jan  1 16:01:07 1993
***************
*** 38,44 ****
  class BrushImpl;
  class Display;
  
! class Brush : public Resource {
  public:
      Brush(Coord width);
      Brush(int pattern, Coord width);
--- 38,44 ----
  class BrushImpl;
  class Display;
  
! class Brush : public virtual Resource {
  public:
      Brush(Coord width);
      Brush(int pattern, Coord width);
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/color.h ./src/include/InterViews/color.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/color.h	Thu Feb 27 02:18:27 1992
--- ./src/include/InterViews/color.h	Fri Jan  1 16:01:07 1993
***************
*** 38,44 ****
  typedef float ColorIntensity;
  typedef unsigned int ColorOp;
  
! class Color : public Resource {
  public:
      enum { Copy, Xor, Invisible };
  
--- 38,44 ----
  typedef float ColorIntensity;
  typedef unsigned int ColorOp;
  
! class Color : public virtual Resource {
  public:
      enum { Copy, Xor, Invisible };
  
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/font.h ./src/include/InterViews/font.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/font.h	Thu Jun  4 01:42:16 1992
--- ./src/include/InterViews/font.h	Fri Jan  1 16:01:07 1993
***************
*** 93,99 ****
  inline Coord FontBoundingBox::font_ascent() const { return font_ascent_; }
  inline Coord FontBoundingBox::font_descent() const { return font_descent_; }
  
! class Font : public Resource {
  public:
      Font(const String&, float scale = 1.0);
      Font(const char*, float scale = 1.0);
--- 93,99 ----
  inline Coord FontBoundingBox::font_ascent() const { return font_ascent_; }
  inline Coord FontBoundingBox::font_descent() const { return font_descent_; }
  
! class Font : public virtual Resource {
  public:
      Font(const String&, float scale = 1.0);
      Font(const char*, float scale = 1.0);
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/glyph.h ./src/include/InterViews/glyph.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/glyph.h	Mon Apr 13 18:59:05 1992
--- ./src/include/InterViews/glyph.h	Fri Jan  1 16:01:08 1993
***************
*** 42,48 ****
  typedef long GlyphIndex;
  typedef unsigned int GlyphBreakType;
  
! class Glyph : public Resource {
  public:
      enum { no_break, pre_break, in_break, post_break };
  
--- 42,48 ----
  typedef long GlyphIndex;
  typedef unsigned int GlyphBreakType;
  
! class Glyph : public virtual Resource {
  public:
      enum { no_break, pre_break, in_break, post_break };
  
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/handler.h ./src/include/InterViews/handler.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/handler.h	Tue Feb 11 18:33:42 1992
--- ./src/include/InterViews/handler.h	Fri Jan  1 16:01:08 1993
***************
*** 31,37 ****
  
  class Event;
  
! class Handler : public Resource {
  protected:
      Handler();
      virtual ~Handler();
--- 31,37 ----
  
  class Event;
  
! class Handler : public virtual Resource {
  protected:
      Handler();
      virtual ~Handler();
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/pattern.h ./src/include/InterViews/pattern.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/pattern.h	Tue Feb 11 18:33:43 1992
--- ./src/include/InterViews/pattern.h	Fri Jan  1 16:01:08 1993
***************
*** 35,41 ****
  
  class PatternRep;
  
! class Pattern : public Resource {
  public:
      enum {
  	solid = 0xffff,
--- 35,41 ----
  
  class PatternRep;
  
! class Pattern : public virtual Resource {
  public:
      enum {
  	solid = 0xffff,
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/raster.h ./src/include/InterViews/raster.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/raster.h	Tue Feb 11 18:33:44 1992
--- ./src/include/InterViews/raster.h	Fri Jan  1 16:01:08 1993
***************
*** 37,43 ****
  
  class RasterRep;
  
! class Raster : public Resource {
  public:
      Raster(unsigned long width, unsigned long height);
      Raster(const Raster&);
--- 37,43 ----
  
  class RasterRep;
  
! class Raster : public virtual Resource {
  public:
      Raster(unsigned long width, unsigned long height);
      Raster(const Raster&);
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/selection.h ./src/include/InterViews/selection.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/selection.h	Mon May 11 19:12:38 1992
--- ./src/include/InterViews/selection.h	Fri Jan  1 16:01:09 1993
***************
*** 34,40 ****
  class SelectionManagerRep;
  class String;
  
! class SelectionManager : public Resource {
  public:
      SelectionManager(Display*, const char*);
      SelectionManager(Display*, const String&);
--- 34,40 ----
  class SelectionManagerRep;
  class String;
  
! class SelectionManager : public virtual Resource {
  public:
      SelectionManager(Display*, const char*);
      SelectionManager(Display*, const String&);
***************
*** 56,62 ****
      SelectionManagerRep* rep_;
  };
  
! class SelectionHandler : public Resource {
  protected:
      SelectionHandler();    
  public:
--- 56,62 ----
      SelectionManagerRep* rep_;
  };
  
! class SelectionHandler : public virtual Resource {
  protected:
      SelectionHandler();    
  public:
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/style.h ./src/include/InterViews/style.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/style.h	Fri Sep  4 23:13:29 1992
--- ./src/include/InterViews/style.h	Fri Jan  1 16:01:09 1993
***************
*** 41,47 ****
  class String;
  class StyleRep;
  
! class Style : public Resource {
  public:
      Style();
      Style(const String& name);
--- 41,47 ----
  class String;
  class StyleRep;
  
! class Style : public virtual Resource {
  public:
      Style();
      Style(const String& name);
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/telltale.h ./src/include/InterViews/telltale.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/telltale.h	Mon Mar 16 23:35:51 1992
--- ./src/include/InterViews/telltale.h	Fri Jan  1 16:01:09 1993
***************
*** 36,42 ****
  
  typedef unsigned int TelltaleFlags;
  
! class TelltaleState : public Resource, public Observable {
  public:
      TelltaleState(const TelltaleFlags = 0);
      virtual ~TelltaleState();
--- 36,42 ----
  
  typedef unsigned int TelltaleFlags;
  
! class TelltaleState : public virtual Resource, public Observable {
  public:
      TelltaleState(const TelltaleFlags = 0);
      virtual ~TelltaleState();
***************
*** 109,115 ****
  Telltale_access(choose,chosen,TelltaleState::is_chosen)
  Telltale_access(enable,enabled,TelltaleState::is_enabled)
  
! class TelltaleGroup : public Resource {
  public:
      TelltaleGroup();
      virtual ~TelltaleGroup();
--- 109,115 ----
  Telltale_access(choose,chosen,TelltaleState::is_chosen)
  Telltale_access(enable,enabled,TelltaleState::is_enabled)
  
! class TelltaleGroup : public virtual Resource {
  public:
      TelltaleGroup();
      virtual ~TelltaleGroup();
diff -rc /site/src/packages/InterViews3.1/iv/src/include/InterViews/transformer.h ./src/include/InterViews/transformer.h
*** /site/src/packages/InterViews3.1/iv/src/include/InterViews/transformer.h	Wed Sep 16 00:35:48 1992
--- ./src/include/InterViews/transformer.h	Fri Jan  1 16:01:10 1993
***************
*** 34,40 ****
  
  #include <InterViews/_enter.h>
  
! class Transformer : public Resource {
  public:
      Transformer();	/* identity */
      Transformer(const Transformer&);
--- 34,40 ----
  
  #include <InterViews/_enter.h>
  
! class Transformer : public virtual Resource {
  public:
      Transformer();	/* identity */
      Transformer(const Transformer&);
diff -rc /site/src/packages/InterViews3.1/iv/src/include/Unidraw/Commands/data.h ./src/include/Unidraw/Commands/data.h
*** /site/src/packages/InterViews3.1/iv/src/include/Unidraw/Commands/data.h	Tue Apr 28 00:05:13 1992
--- ./src/include/Unidraw/Commands/data.h	Fri Jan  1 16:01:10 1993
***************
*** 31,37 ****
  #include <InterViews/resource.h>
  #include <Unidraw/enter-scope.h>
  
! class Data : public Resource {
  protected:
      Data();
  };
--- 31,37 ----
  #include <InterViews/resource.h>
  #include <Unidraw/enter-scope.h>
  
! class Data : public virtual Resource {
  protected:
      Data();
  };
diff -rc /site/src/packages/InterViews3.1/iv/src/lib/Dispatch/iostreamb.c ./src/lib/Dispatch/iostreamb.c
*** /site/src/packages/InterViews3.1/iv/src/lib/Dispatch/iostreamb.c	Thu Jan 24 21:57:02 1991
--- ./src/lib/Dispatch/iostreamb.c	Mon Jan  4 14:58:34 1993
***************
*** 24,29 ****
--- 24,33 ----
  
  #include <Dispatch/iostreamb.h>
  
+ #ifdef __GNUC__
+ #define setstate set
+ #endif
+ 
  // Make sure that these assumptions about the sizes of integral types
  // hold for your machine.  If your machine does not have 32-bit and
  // 16-bit integers, then you cannot use binary I/O because other
diff -rc /site/src/packages/InterViews3.1/iv/src/lib/Dispatch/rpcbuf.c ./src/lib/Dispatch/rpcbuf.c
*** /site/src/packages/InterViews3.1/iv/src/lib/Dispatch/rpcbuf.c	Sat Dec 12 05:18:43 1992
--- ./src/lib/Dispatch/rpcbuf.c	Tue Jan  5 14:21:46 1993
***************
*** 25,31 ****
  #include <Dispatch/rpcbuf.h>
  #include <OS/memory.h>
  #include <OS/types.h>	/* must come before <netinet/in.h> on some systems */
! #include <arpa/inet.h>
  #include <ctype.h>
  #include <errno.h>
  #include <fcntl.h>
--- 25,40 ----
  #include <Dispatch/rpcbuf.h>
  #include <OS/memory.h>
  #include <OS/types.h>	/* must come before <netinet/in.h> on some systems */
! #ifdef __GNUC__
! #    define zapeof(c) ((c) & 0xFF)
! /*
!  * zapeof should be read as "zap eof", not "zape of"
!  * It's purpose is to mask out EOF.
!  */
!      extern "C" unsigned long inet_addr(const char* cp);
! #else
! #    include <arpa/inet.h>
! #endif
  #include <ctype.h>
  #include <errno.h>
  #include <fcntl.h>
***************
*** 38,43 ****
--- 47,53 ----
  #include <stdio.h>
  #include <sys/socket.h>
  
+ 
  // I need a pointer to an iostreamb so I can insert and extract values
  // in the length field of RPC requests.  If I don't have a stream, I
  // won't allow you to call start_request().
***************
*** 455,460 ****
--- 465,471 ----
      if (c != EOF) {
  	sputc(c);
      }
+ 
      return zapeof(c);
  }
  
***************
*** 492,497 ****
--- 503,509 ----
      }
  
      setg(eback(), gptr(), egptr() + nread);
+ 
      return zapeof(*gptr());
  }
  
diff -rc /site/src/packages/InterViews3.1/iv/src/lib/Dispatch/rpcstream.c ./src/lib/Dispatch/rpcstream.c
*** /site/src/packages/InterViews3.1/iv/src/lib/Dispatch/rpcstream.c	Thu Mar 28 22:46:59 1991
--- ./src/lib/Dispatch/rpcstream.c	Mon Jan  4 14:59:01 1993
***************
*** 24,29 ****
--- 24,33 ----
  
  #include <Dispatch/rpcstream.h>
  
+ #ifdef __GNUC__
+ #define setstate set
+ #endif
+ 
  // Specialize this class to RPC requests by initializing an rpcbuf.
  // Set incomplete_request to ensure the first attempt to extract an RPC
  // request will call underflow.
diff -rc /site/src/packages/InterViews3.1/iv/src/lib/InterViews/mf_kit.c ./src/lib/InterViews/mf_kit.c
*** /site/src/packages/InterViews3.1/iv/src/lib/InterViews/mf_kit.c	Thu Aug 27 18:16:23 1992
--- ./src/lib/InterViews/mf_kit.c	Fri Jan  1 16:01:11 1993
***************
*** 61,67 ****
      nil
  };
  
! class MFKitInfo : public Resource {
  public:
      MFKitInfo(Style*);
      virtual ~MFKitInfo();
--- 61,67 ----
      nil
  };
  
! class MFKitInfo : public virtual Resource {
  public:
      MFKitInfo(Style*);
      virtual ~MFKitInfo();
diff -rc /site/src/packages/InterViews3.1/iv/src/lib/InterViews/mono_kit.c ./src/lib/InterViews/mono_kit.c
*** /site/src/packages/InterViews3.1/iv/src/lib/InterViews/mono_kit.c	Wed Sep 23 17:41:34 1992
--- ./src/lib/InterViews/mono_kit.c	Fri Jan  1 16:01:11 1993
***************
*** 62,68 ****
      nil
  };
  
! class MonoKitInfo : public Resource {
  public:
      MonoKitInfo(Style*);
      virtual ~MonoKitInfo();
--- 62,68 ----
      nil
  };
  
! class MonoKitInfo : public virtual Resource {
  public:
      MonoKitInfo(Style*);
      virtual ~MonoKitInfo();
diff -rc /site/src/packages/InterViews3.1/iv/src/lib/InterViews/ol_kit.c ./src/lib/InterViews/ol_kit.c
*** /site/src/packages/InterViews3.1/iv/src/lib/InterViews/ol_kit.c	Mon Oct 26 23:32:36 1992
--- ./src/lib/InterViews/ol_kit.c	Sun Jan  3 13:20:43 1993
***************
*** 444,450 ****
  class OL_Channel;
  class OL_Elevator;
  
! class OL_Specs : public Resource {
  public:
      OL_Specs(Style*);
      ~OL_Specs();
--- 444,450 ----
  class OL_Channel;
  class OL_Elevator;
  
! class OL_Specs : public virtual Resource {
  public:
      OL_Specs(Style*);
      ~OL_Specs();
***************
*** 2201,2207 ****
      }
      if (font_ != nil) {
  	FontBoundingBox box;
! 	font_->char_bbox(box_ul_, box);
  	width_ = box.width() + 1;
  	height_ = box.ascent() + box.descent() + 1;
      } else {
--- 2201,2207 ----
      }
      if (font_ != nil) {
  	FontBoundingBox box;
! 	font_->char_bbox((int) box_ul_, box);
  	width_ = box.width() + 1;
  	height_ = box.ascent() + box.descent() + 1;
      } else {
***************
*** 2234,2246 ****
  	c->fill_rect(l + 1, b + 1, r - 1, t - 1, bg3);	// arrow
  
  	if (state_->test(TelltaleState::is_active)) {
! 	    c->character(font_, fill_, width_, bg2, l, t);
! 	    c->character(font_, box_ul_, width_, bg3, l, t);
! 	    c->character(font_, box_lr_, width_, white, l, t);
  	} else {
! 	    c->character(font_, fill_, width_, bg1, l, t);
! 	    c->character(font_, box_ul_, width_, white, l, t);
! 	    c->character(font_, box_lr_, width_, bg3, l, t);
  	}
  
  	if (state_->test(TelltaleState::is_running)) {
--- 2234,2246 ----
  	c->fill_rect(l + 1, b + 1, r - 1, t - 1, bg3);	// arrow
  
  	if (state_->test(TelltaleState::is_active)) {
! 	    c->character(font_, (int) fill_, width_, bg2, l, t);
! 	    c->character(font_, (int) box_ul_, width_, bg3, l, t);
! 	    c->character(font_, (int) box_lr_, width_, white, l, t);
  	} else {
! 	    c->character(font_, (int) fill_, width_, bg1, l, t);
! 	    c->character(font_, (int) box_ul_, width_, white, l, t);
! 	    c->character(font_, (int) box_lr_, width_, bg3, l, t);
  	}
  
  	if (state_->test(TelltaleState::is_running)) {
***************
*** 2794,2805 ****
  
  void OL_Stepper::start_stepping() {
      if (initial_delay_ > 10) {
!         Dispatcher::instance().startTimer(0, initial_delay_, timer_);
      }
  }
  
  void OL_Stepper::next_step() {
!     Dispatcher::instance().startTimer(0, interval_, timer_);
  }
  
  void OL_Stepper::stop_stepping() {
--- 2794,2805 ----
  
  void OL_Stepper::start_stepping() {
      if (initial_delay_ > 10) {
!         Dispatcher::instance().startTimer(0, (int) initial_delay_, timer_);
      }
  }
  
  void OL_Stepper::next_step() {
!     Dispatcher::instance().startTimer(0, (int) interval_, timer_);
  }
  
  void OL_Stepper::stop_stepping() {
***************
*** 3296,3304 ****
  
      const Font* f = s.font();
      if (f != nil) {
! 	c->character(f, ul, width, upper_left, l, t);
! 	c->character(f, box, width, fill, l, t);
! 	c->character(f, lr, width, lower_right, l, t);
      }
  }
  
--- 3296,3304 ----
  
      const Font* f = s.font();
      if (f != nil) {
! 	c->character(f, (int) ul, width, upper_left, l, t);
! 	c->character(f, (int) box, width, fill, l, t);
! 	c->character(f, (int) lr, width, lower_right, l, t);
      }
  }
  
diff -rc /site/src/packages/InterViews3.1/iv/src/lib/InterViews/printer.c ./src/lib/InterViews/printer.c
*** /site/src/packages/InterViews3.1/iv/src/lib/InterViews/printer.c	Mon Jul 13 19:59:46 1992
--- ./src/lib/InterViews/printer.c	Fri Jan  1 16:01:14 1993
***************
*** 144,150 ****
      delete rep_;
  }
  
! PixelCoord Printer::to_pixels(Coord p) const { return p; }
  Coord Printer::to_coord(PixelCoord p) const { return p; }
  Coord Printer::to_pixels_coord(Coord p) const { return p; }
  
--- 144,150 ----
      delete rep_;
  }
  
! PixelCoord Printer::to_pixels(Coord p) const { return PixelCoord(p); }
  Coord Printer::to_coord(PixelCoord p) const { return p; }
  Coord Printer::to_pixels_coord(Coord p) const { return p; }
  
diff -rc /site/src/packages/InterViews3.1/iv/src/lib/InterViews/smf_kit.c ./src/lib/InterViews/smf_kit.c
*** /site/src/packages/InterViews3.1/iv/src/lib/InterViews/smf_kit.c	Thu Aug 27 18:16:25 1992
--- ./src/lib/InterViews/smf_kit.c	Fri Jan  1 16:01:15 1993
***************
*** 120,126 ****
      0x00, 0x00, 0x03, 0x00
  };
  
! class SMFKitInfo : public Resource {
  public:
      SMFKitInfo(Style*);
      virtual ~SMFKitInfo();
--- 120,126 ----
      0x00, 0x00, 0x03, 0x00
  };
  
! class SMFKitInfo : public virtual Resource {
  public:
      SMFKitInfo(Style*);
      virtual ~SMFKitInfo();
diff -rc /site/src/packages/InterViews3.1/iv/src/lib/Unidraw/catalog.c ./src/lib/Unidraw/catalog.c
*** /site/src/packages/InterViews3.1/iv/src/lib/Unidraw/catalog.c	Sat Dec 12 05:27:55 1992
--- ./src/lib/Unidraw/catalog.c	Fri Jan  1 16:01:16 1993
***************
*** 1611,1622 ****
  	    istrstream in(definition, strlen(definition) + 1);
              int data[patternHeight];
  
! 	    for (int i = 0; in >> buf && i < patternHeight; i++) {
  		if (sscanf(buf, "%x", &data[i]) != 1) {
  		    break;
  		}
  	    }
! 
  	    if (i == 1 || i == 8 || i == patternHeight) {
                  pat = FindPattern(data, i);
  	    }
--- 1611,1623 ----
  	    istrstream in(definition, strlen(definition) + 1);
              int data[patternHeight];
  
! 	    for (int i = 0; !in.eof() && in.good() && i < patternHeight; i++) {
! 		in >> buf;
  		if (sscanf(buf, "%x", &data[i]) != 1) {
  		    break;
  		}
  	    }
! 	    
  	    if (i == 1 || i == 8 || i == patternHeight) {
                  pat = FindPattern(data, i);
  	    }
-- 
Johan Garpendahl                   | Email: garp@isy.liu.se
Linkoping University               | Phone: +46 - 13 - 28 13 24
Dept. of Electrical Engineering    | Fax  : +46 - 13 - 13 92 82
S-581 83  LINKOPING // SWEDEN      | May the Source be with you.
Re: Patches to make IV3.1 compile better with gcc-2.3.3
#1629
Author: N.Davis
Date: Thu, 07 Jan 1993 11:49
52 lines
2757 bytes
In article <garp.726271124@isy.liu.se> garp@isy.liu.se (Johan Garpendahl) writes:
>Here are a few patches to make InterViews 3.1 compile better with gcc-2.3.3.
>
>
>Don't try to compile with -O2.
>Don't try to make shared libraries.
>I tried it.
>

Hmm, why should I not compile InterViews 3.1 shared libraries using gcc-2.3.3?
I have done just this, and judging by the comments made about which binaries
work and which do not, I seem to be in exactly the same situation as those
of you who favour non-shared libraries.

For the record, I have set the SharedCCFlags=-fPIC, the platform is a
SS1 + X11R5pl21 + gcc-2.3.3. 

I will however admit that all the Unidraw based progs fail; I'm no C++ guru
but I appear to have an empty string being passed to the constructor
of ControlInfo which ultimately core dumps in newstr. (see the GDB output
below). This used to work in gcc-2.3.2 (At least, I seem to recall running
idraw, or am I mistaken).

The bottom line is that I do not plan on using too many features of Unidraw
at the moment (it's hard enough learning InterViews & C++ in one go ...);
I'm more than satisfied with being able to finally compile and run my own
test progs using GCC 2.3.3  ... my congratulations to both the Gcc peole and
the InterViews group!

Neil Davis
-------------------------------------------------------------------------
GDB output from punidraw
Program received signal 11, Segmentation fault
0xf73323c0 in strlen ()
(gdb) where
#0  0xf73323c0 in strlen ()
#1  0xf764e2c8 in strnew ()
#2  0xf7638348 in ivControlInfo::Init ()
#3  0xf7638440 in ivControlInfo::ivControlInfo ()
#4  0x4574 in Punidraw::FileMenu (this=0x3e368) at ../pued.c:200
#5  0x3bb4 in Punidraw::Commands (this=0x3e368) at ../pued.c:106
#6  0x39a8 in Punidraw::Interior (this=0x3e368) at ../pued.c:100
#7  0x3660 in Punidraw::Punidraw (this=0x3e368, comp=0x0) at ../pued.c:49
#8  0x24b8 in main (argc=1, argv=0xf7fffcfc) at ../main.c:25

frame #4 (from pued.c)
Include(
        new NewCompCmd(
            new ControlInfo("New", KLBL_NEWCOMP, CODE_NEWCOMP),
                                    ^^^^^^^^^^   ^^^^^^^^^
			           both NULL ? [Something to do with -fPIC
					       [putting const char* in common?
Re: Patches to make IV3.1 compile better with gcc-2.3.3
#1632
Author: Johan Garpendahl
Date: Thu, 07 Jan 1993 16:37
46 lines
2378 bytes
N.Davis@lut.ac.uk writes:

>In article <garp.726271124@isy.liu.se> garp@isy.liu.se (Johan Garpendahl) writes:
>>Here are a few patches to make InterViews 3.1 compile better with gcc-2.3.3.
>>
>>
>>Don't try to compile with -O2.
>>Don't try to make shared libraries.
>>I tried it.
>>

>Hmm, why should I not compile InterViews 3.1 shared libraries using gcc-2.3.3?
>I have done just this, and judging by the comments made about which binaries
>work and which do not, I seem to be in exactly the same situation as those
>of you who favour non-shared libraries.

OK, maybe I should have put a smiley somewhere.
Try it if you like, but don't complain if everything doesn't work.

>I will however admit that all the Unidraw based progs fail; I'm no C++ guru
>but I appear to have an empty string being passed to the constructor
>of ControlInfo which ultimately core dumps in newstr. (see the GDB output
>below). This used to work in gcc-2.3.2 (At least, I seem to recall running
>idraw, or am I mistaken).

I've done some experimenting with that and I can make a workaround
for the strings by initializing them from the Unidraw constructor.
Idraw will then start up nicely, but you won't be able to do anything
useful because the mouse-events won't get through. 

If anyone knows why, or has a workaround for that one, I'd be happy.

After all, I want to use shared libraries, but I'm not ready to give
up Idraw or Unidraw to get it. I'd even like to be able to use libg++
as a shared library, but that doesn't seen to work yet either.

Happy hacking, 

	Johan


-- 
Johan Garpendahl                   | Email: garp@isy.liu.se
Linkoping University               | Phone: +46 - 13 - 28 13 24
Dept. of Electrical Engineering    | Fax  : +46 - 13 - 13 92 82
S-581 83  LINKOPING // SWEDEN      | May the Source be with you.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads