diff -ur aplus-fsf-4.20.2.orig/src/MSGUI/MSApplication.H aplus-fsf-4.20.2/src/MSGUI/MSApplication.H
--- aplus-fsf-4.20.2.orig/src/MSGUI/MSApplication.H	2001-01-19 20:42:24.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSGUI/MSApplication.H	2006-03-19 17:20:43.000000000 +0000
@@ -36,6 +36,12 @@
   virtual void terminateLoop(void);
 };
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSApplication;
+MSGUIExport MSBoolean applicationAddServer(MSDisplayServer *);
+MSGUIExport MSBoolean applicationRemoveServer(MSDisplayServer *);  
+#endif
+
 class MSGUIExport MSApplication
 {
 friend class MSDisplayServer;
diff -ur aplus-fsf-4.20.2.orig/src/MSGUI/MSAttrValue.H aplus-fsf-4.20.2/src/MSGUI/MSAttrValue.H
--- aplus-fsf-4.20.2.orig/src/MSGUI/MSAttrValue.H	2003-09-05 15:33:42.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSGUI/MSAttrValue.H	2006-03-19 17:20:43.000000000 +0000
@@ -24,6 +24,11 @@
 using namespace std;
 #endif
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSAttrValue;
+MSGUIExport ostream& operator<<(ostream& aStream_,const MSAttrValue& aAttrValue_);
+#endif
+
 class MSGUIExport MSAttrValue
 {
 public:
@@ -99,6 +104,12 @@
 inline unsigned long MSAttrValue::valueType(void) const
 { return _valueType; }
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSAttrValueList;
+MSGUIExport MSAttrValueList& operator<<(MSAttrValueList&,const MSAttrValue&);
+MSGUIExport ostream& operator<<(ostream& aStream_,const MSAttrValueList& avList_);
+#endif
+
 class MSGUIExport MSAttrValueList
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSGUI/MSPrintManager.H aplus-fsf-4.20.2/src/MSGUI/MSPrintManager.H
--- aplus-fsf-4.20.2.orig/src/MSGUI/MSPrintManager.H	2001-01-19 20:42:40.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSGUI/MSPrintManager.H	2006-03-19 17:20:43.000000000 +0000
@@ -17,6 +17,16 @@
 class MSPrintColumn;
 class MSPrintItem;
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSPrintManager;
+MSGUIExport MSParagraph& operator<<(MSPrintManager&,const MSParagraph&);
+MSGUIExport MSParagraph& operator<<(MSPrintManager&,const MSStringVector&);
+MSGUIExport MSPrintColumn& operator<<(MSPrintManager&,MSPrintColumn *);
+MSGUIExport MSPrintItem& operator<<(MSPrintManager&,MSPrintItem *);
+MSGUIExport MSReportTable& operator<<(MSPrintManager&,MSReportTable *);
+MSGUIExport MSGraph& operator<<(MSPrintManager&,MSGraph *);
+#endif
+
 class MSGUIExport MSPrintManager
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSGUI/MSShell.H aplus-fsf-4.20.2/src/MSGUI/MSShell.H
--- aplus-fsf-4.20.2.orig/src/MSGUI/MSShell.H	2001-01-19 20:42:42.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSGUI/MSShell.H	2006-03-19 17:20:43.000000000 +0000
@@ -16,6 +16,14 @@
 class MSShellBusy;
 class MSApplicationBusy;
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSShell;
+MSGUIExport void changeBusyState(MSShell *,MSBoolean);   
+MSGUIExport void changeBusyState(MSBoolean); 
+MSGUIExport ostream &operator<<(ostream &,MSShell &);
+MSGUIExport istream &operator>>(istream &,MSShell &);
+#endif
+
 class MSGUIExport MSShell : public MSTopLevel
 {
 friend class MSShellBusy;
diff -ur aplus-fsf-4.20.2.orig/src/MSGUI/MSTable.H aplus-fsf-4.20.2/src/MSGUI/MSTable.H
--- aplus-fsf-4.20.2.orig/src/MSGUI/MSTable.H	2001-08-14 19:59:02.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSGUI/MSTable.H	2006-03-19 17:20:43.000000000 +0000
@@ -22,6 +22,10 @@
 class MSTableColumn;
 
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+ostream &operator<<(ostream &,MSManagedPointer<MSTableColumnGroup> const &);
+#endif
+
 class MSGUIExport MSTable : public MSReportTable, public MSArrayView
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSGUI/MSTableColumnGroup.H aplus-fsf-4.20.2/src/MSGUI/MSTableColumnGroup.H
--- aplus-fsf-4.20.2.orig/src/MSGUI/MSTableColumnGroup.H	2003-09-05 15:33:45.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSGUI/MSTableColumnGroup.H	2006-03-19 17:31:56.000000000 +0000
@@ -22,6 +22,13 @@
 using namespace std;
 #endif
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSTableColumnGroup;
+MSGUIExport MSBoolean operator==(const MSTableColumnGroup &,const MSTableColumnGroup &);
+MSGUIExport ostream &operator<<(ostream &,MSTableColumnGroup const &);
+MSGUIExport ostream &operator<<(ostream &,const MSTableColumnGroup * const &);
+#endif
+
 class MSGUIExport MSTableColumnGroup
 {
 public:
@@ -131,10 +138,11 @@
   friend MSGUIExport ostream &operator<<(ostream &,MSTableColumnGroup const &);
 
   //Required for MSGenericVector template
-  friend MSGUIExport ostream &operator<<(ostream &,MSTableColumnGroup::Node const &);
   friend MSGUIExport ostream &operator<<(ostream &,const MSTableColumnGroup * const &);
 };
 
+MSGUIExport ostream &operator<<(ostream &,MSTableColumnGroup::Node const &);
+
 inline long compare(MSTableColumnGroup::Node const &,MSTableColumnGroup::Node const &)
 {return 0;}
 
diff -ur aplus-fsf-4.20.2.orig/src/MSGUI/MSTextEditor.H aplus-fsf-4.20.2/src/MSGUI/MSTextEditor.H
--- aplus-fsf-4.20.2.orig/src/MSGUI/MSTextEditor.H	2001-05-01 22:08:16.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSGUI/MSTextEditor.H	2006-03-19 19:19:08.000000000 +0000
@@ -583,6 +583,12 @@
 
 };
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSTextEditor;
+MSTextEditor& operator<<(MSTextEditor&, const char *);
+MSTextEditor& operator<<(MSTextEditor&, MSTextEditorTypes::TextFlowCallback *);
+#endif
+
 class MSGUIExport MSTextEditor : public MSTextEditorTypes, public MSWidgetCommon
 {
   friend class Vsb;
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSBinaryMatrix.H aplus-fsf-4.20.2/src/MSTypes/MSBinaryMatrix.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSBinaryMatrix.H	2001-01-19 20:45:59.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSBinaryMatrix.H	2006-03-19 17:28:07.000000000 +0000
@@ -17,6 +17,40 @@
 class MSBinaryVector;
 class MSBinaryMatrixSTypePick; // MSBinaryMatrix indexed by an unsigned int
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSBinaryMatrix;
+MSTypesExport ostream& operator<<(ostream&,const MSBinaryMatrix&);
+MSTypesExport MSBoolean operator<(const MSBinaryMatrix&,const MSBinaryMatrix&);
+MSTypesExport MSBoolean operator>(const MSBinaryMatrix&,const MSBinaryMatrix&);
+MSTypesExport MSBoolean operator<=(const MSBinaryMatrix&,const MSBinaryMatrix&);
+MSTypesExport MSBoolean operator>=(const MSBinaryMatrix&,const MSBinaryMatrix&);
+MSTypesExport MSBoolean operator<(const MSBinaryMatrix&,unsigned char);
+MSTypesExport MSBoolean operator<(unsigned char,const MSBinaryMatrix&);
+MSTypesExport MSBoolean operator>(const MSBinaryMatrix&,unsigned char);
+MSTypesExport MSBoolean operator>(unsigned char,const MSBinaryMatrix&);
+MSTypesExport MSBoolean operator<=(const MSBinaryMatrix&,unsigned char);
+MSTypesExport MSBoolean operator<=(unsigned char,const MSBinaryMatrix&);
+MSTypesExport MSBoolean operator>=(const MSBinaryMatrix&,unsigned char);
+MSTypesExport MSBoolean operator>=(unsigned char,const MSBinaryMatrix&);
+MSTypesExport MSBoolean operator==(const MSBinaryMatrix&,unsigned char);
+MSTypesExport MSBoolean operator==(unsigned char,const MSBinaryMatrix&);
+MSTypesExport MSBoolean operator!=(const MSBinaryMatrix&,unsigned char);
+MSTypesExport MSBoolean operator!=(unsigned char,const MSBinaryMatrix&);
+MSTypesExport MSBinaryMatrix operator!(const MSBinaryMatrix&);
+MSTypesExport MSBinaryMatrix operator~(const MSBinaryMatrix&);
+MSTypesExport MSBinaryMatrix operator&(const MSBinaryMatrix&,unsigned char);
+MSTypesExport MSBinaryMatrix operator&(unsigned char,const MSBinaryMatrix&);
+MSTypesExport MSBinaryMatrix operator&(const MSBinaryMatrix&,const MSBinaryMatrix&);
+MSTypesExport MSBinaryMatrix operator|(const MSBinaryMatrix&,unsigned char);
+MSTypesExport MSBinaryMatrix operator|(unsigned char,const MSBinaryMatrix&);
+MSTypesExport MSBinaryMatrix operator|(const MSBinaryMatrix&,const MSBinaryMatrix&);
+MSTypesExport MSBinaryMatrix operator^(const MSBinaryMatrix&,unsigned char);
+MSTypesExport MSBinaryMatrix operator^(unsigned char,const MSBinaryMatrix&);
+MSTypesExport MSBinaryMatrix operator^(const MSBinaryMatrix&,const MSBinaryMatrix&);
+MSTypesExport MSBinaryMatrix stack(const MSBinaryMatrix&,const MSBinaryMatrix&);
+MSTypesExport MSBinaryMatrix adjoin(const MSBinaryMatrix&,const MSBinaryMatrix&);
+#endif // defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+
 class MSTypesExport MSBinaryMatrix : public MSMatrix
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSBinaryVector.H aplus-fsf-4.20.2/src/MSTypes/MSBinaryVector.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSBinaryVector.H	2003-09-05 15:34:14.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSBinaryVector.H	2006-03-19 17:20:43.000000000 +0000
@@ -36,10 +36,13 @@
 class ostream;
 #endif
 
-class istrstream;
-class ostrstream;
 class MSIndexVector;
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSBinaryVector;
+MSTypesExport ostream & operator<< (ostream &, const MSBinaryVector &);
+#endif
+
 class MSTypesExport MSBinaryVector : public MSVector
 {
  public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSBuiltinTypeVectorInlines.C aplus-fsf-4.20.2/src/MSTypes/MSBuiltinTypeVectorInlines.C
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSBuiltinTypeVectorInlines.C	2005-08-29 01:32:27.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSBuiltinTypeVectorInlines.C	2006-03-19 22:59:32.000000000 +0000
@@ -70,14 +70,14 @@
 template <class Type>
 INLINELINKAGE MSBuiltinVector<Type> MSBuiltinVector<Type>::operator[] (const MSIndexVector & iVect_) const
 {
-  return select (*this, iVect_);
+  return this->select (*this, iVect_);
 }
 
 
 template <class Type>
 INLINELINKAGE MSBuiltinVector<Type> MSBuiltinVector<Type>::operator[] (const MSBinaryVector & bVect_) const
 {
-  return compress (*this, bVect_);
+  return this->compress (*this, bVect_);
 }
 
 
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSCalendar.H aplus-fsf-4.20.2/src/MSTypes/MSCalendar.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSCalendar.H	2001-01-19 20:46:00.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSCalendar.H	2006-03-19 17:20:43.000000000 +0000
@@ -26,6 +26,11 @@
 
 DECLARE_ELEMENT_FOR_OPS_TYPE(MSHoliday)
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSResourceHolidaySet;
+MSTypesExport ostream& operator<<(ostream&,const MSResourceHolidaySet&);
+#endif
+
 class MSTypesExport MSResourceHolidaySet : public MSIHashKeySet<MSHoliday,MSDate> 
 {
 public:
@@ -69,6 +74,9 @@
 typedef MSIHashKeySet<MSResourceCodeDesc,MSResourceCode> MSResourceCodeDescriptionSet;
 typedef MSIHashKeySet<MSResourceCodeDesc,MSResourceCode>::Cursor MSResourceCodeDescriptionSetCursor;
 
+class MSCalendar;
+MSTypesExport ostream& operator<<(ostream&,const MSCalendar&);
+
 class MSTypesExport MSCalendar 
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSData.H aplus-fsf-4.20.2/src/MSTypes/MSData.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSData.H	2001-01-19 20:46:02.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSData.H	2006-03-19 17:20:43.000000000 +0000
@@ -65,7 +65,7 @@
 template <class Type>
 struct MSDataAlignment
 {
-  MSData _msData;
+  char   _msData[sizeof(MSData)];
   Type   _pElements[1];
 };
 
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSDefines.H aplus-fsf-4.20.2/src/MSTypes/MSDefines.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSDefines.H	2001-12-24 18:37:54.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSDefines.H	2006-03-19 17:20:43.000000000 +0000
@@ -746,6 +746,7 @@
 # define MSTK_MANUAL_INSTANTIATION            1
 # define MS_STD_TEMPLATE_INSTANTIATION        1
 # define MS_PREDECLARE_TEMPLATE_FRIENDS       1
+# define MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS 1
 # define MS_GCC_FUNCTION_CAST_BUG             1
 
 //egcs 1.1.1
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSFloat.H aplus-fsf-4.20.2/src/MSTypes/MSFloat.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSFloat.H	2001-09-29 23:28:02.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSFloat.H	2006-03-19 17:24:30.000000000 +0000
@@ -29,6 +29,41 @@
 
 class MSFormat;
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSFloat;
+MSTypesExport unsigned long hash(const MSFloat&,unsigned long size_);
+MSTypesExport MSFloat operator+(const MSFloat&,const MSFloat&);
+MSTypesExport MSFloat operator-(const MSFloat&,const MSFloat&);
+MSTypesExport MSFloat operator*(const MSFloat&,const MSFloat&);
+MSTypesExport MSFloat operator/(const MSFloat&,const MSFloat&);
+MSTypesExport MSFloat operator+(const MSFloat&,const MSInt&);
+MSTypesExport MSFloat operator-(const MSFloat&,const MSInt&);
+MSTypesExport MSFloat operator*(const MSFloat&,const MSInt&);
+MSTypesExport MSFloat operator/(const MSFloat&,const MSInt&);
+MSTypesExport MSFloat operator+(const MSInt&,const MSFloat&);
+MSTypesExport MSFloat operator-(const MSInt&,const MSFloat&);
+MSTypesExport MSFloat operator*(const MSInt&,const MSFloat&);
+MSTypesExport MSFloat operator/(const MSInt&,const MSFloat&);
+MSTypesExport MSFloat operator+(double,const MSFloat&);
+MSTypesExport MSFloat operator-(double,const MSFloat&);
+MSTypesExport MSFloat operator*(double,const MSFloat&);
+MSTypesExport MSFloat operator/(double,const MSFloat&);
+MSTypesExport MSFloat operator+(const MSFloat&,double);
+MSTypesExport MSFloat operator-(const MSFloat&,double);
+MSTypesExport MSFloat operator*(const MSFloat&,double);
+MSTypesExport MSFloat operator/(const MSFloat&,double);
+MSTypesExport MSFloat operator+(int,const MSFloat&);
+MSTypesExport MSFloat operator-(int,const MSFloat&);
+MSTypesExport MSFloat operator*(int,const MSFloat&);
+MSTypesExport MSFloat operator/(int,const MSFloat&);
+MSTypesExport MSFloat operator+(const MSFloat&,int);
+MSTypesExport MSFloat operator-(const MSFloat&,int);
+MSTypesExport MSFloat operator*(const MSFloat&,int);
+MSTypesExport MSFloat operator/(const MSFloat&,int);
+MSTypesExport ostream& operator<<(ostream& aStream_,const MSFloat&);
+MSTypesExport istream& operator>>(istream& aStream_,MSFloat&);
+#endif // defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+
 class MSTypesExport MSFloat : public MSScalarModel
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSFloatMatrix.H aplus-fsf-4.20.2/src/MSTypes/MSFloatMatrix.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSFloatMatrix.H	2005-08-29 01:32:27.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSFloatMatrix.H	2006-03-19 17:20:43.000000000 +0000
@@ -27,9 +27,64 @@
 template<class Type> class MSMatrixSTypePick; // MSTypeMatrix indexed by an unsigned int
 
 #if !defined(MS_NO_PREDECLARE_SPECIALIZATION)
-class MSMatrixSTypePick<double>; 
+template <> class MSTypeMatrix<double> ;
 #endif
 
+#if defined (MS_PREDECLARE_TEMPLATE_FRIENDS)
+MSTypesExport ostream& operator<<(ostream&,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> operator-(const MSTypeMatrix<double>&);
+MSTypesExport MSBoolean operator<(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSBoolean operator>(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSBoolean operator<=(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSBoolean operator>=(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSBoolean operator<(const MSTypeMatrix<double>&,double);
+MSTypesExport MSBoolean operator<(double,const MSTypeMatrix<double>&);
+MSTypesExport MSBoolean operator>(const MSTypeMatrix<double>&,double);
+MSTypesExport MSBoolean operator>(double,const MSTypeMatrix<double>&);
+MSTypesExport MSBoolean operator<=(const MSTypeMatrix<double>&,double);
+MSTypesExport MSBoolean operator<=(double,const MSTypeMatrix<double>&);
+MSTypesExport MSBoolean operator>=(const MSTypeMatrix<double>&,double);
+MSTypesExport MSBoolean operator>=(double,const MSTypeMatrix<double>&);
+MSTypesExport MSBoolean operator==(const MSTypeMatrix<double>&,double);
+MSTypesExport MSBoolean operator==(double,const MSTypeMatrix<double>&);
+MSTypesExport MSBoolean operator!=(const MSTypeMatrix<double>&,double);
+MSTypesExport MSBoolean operator!=(double,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> operator+(const MSTypeMatrix<double>&,double);
+MSTypesExport MSTypeMatrix<double> operator+(double,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> operator+(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> operator-(const MSTypeMatrix<double>&,double);
+MSTypesExport MSTypeMatrix<double> operator-(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> operator*(const MSTypeMatrix<double>&,double);
+MSTypesExport MSTypeMatrix<double> operator*(double,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> operator*(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> operator/(const MSTypeMatrix<double>&,double);
+MSTypesExport MSTypeMatrix<double> operator/(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> operator+(const MSTypeMatrix<double>& m_,const MSTypeVector<double>& v_);
+MSTypesExport MSTypeMatrix<double> operator-(const MSTypeMatrix<double>& m_,const MSTypeVector<double>& v_);
+MSTypesExport MSTypeMatrix<double> operator*(const MSTypeMatrix<double>& m_,const MSTypeVector<double>& v_);
+MSTypesExport MSTypeMatrix<double> operator/(const MSTypeMatrix<double>& m_,const MSTypeVector<double>& v_);
+MSTypesExport MSTypeMatrix<double> operator+(const MSTypeVector<double>& v_,const MSTypeMatrix<double>& m_);
+MSTypesExport MSTypeMatrix<double> operator*(const MSTypeVector<double>& v_,const MSTypeMatrix<double>& m_);
+MSTypesExport MSTypeMatrix<double> multiply(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> stack(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> adjoin(const MSTypeMatrix<double>&,const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> sin(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> sinh(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> cos(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> cosh(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> tan(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> tanh(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> asin(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> acos(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> atan(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> exp(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> log(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> sqrt(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> ceil(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> floor(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> abs(const MSTypeMatrix<double>&);
+MSTypesExport MSTypeMatrix<double> pow(const MSTypeMatrix<double>&,double);
+#endif // defined (MS_PREDECLARE_TEMPLATE_FRIENDS)
 
 #if !defined(MS_MSFloatMatrix_INSTANTIATE) && defined(MS_STD_TEMPLATE_SPECIALIZATION)
 template <> class MSTypeMatrix<double> : public MSMatrix
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSGenericVectorInlines.C aplus-fsf-4.20.2/src/MSTypes/MSGenericVectorInlines.C
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSGenericVectorInlines.C	2001-08-14 20:26:10.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSGenericVectorInlines.C	2006-03-19 17:20:43.000000000 +0000
@@ -647,7 +647,7 @@
   // we have to use MSDataAlignment<Type> structure to find out the proper offset
   // of the data elements, taking possible alignment into consideration
   //
-  return offsetof(MSDataAlignment<Type>,_pElements);
+  return sizeof(MSDataAlignment<Type>) - sizeof(Type);
 }
 
 
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSHashTable.H aplus-fsf-4.20.2/src/MSTypes/MSHashTable.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSHashTable.H	2003-09-05 15:34:17.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSHashTable.H	2006-03-19 17:20:43.000000000 +0000
@@ -48,6 +48,11 @@
   void prev(MSHashEntry *prev_) { _prev=prev_; }
 };
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSHashTable;
+MSTypesExport ostream& operator<<(ostream& aStream,const MSHashTable& aHashTable);
+#endif
+
 class MSTypesExport MSHashTable
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSHoliday.H aplus-fsf-4.20.2/src/MSTypes/MSHoliday.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSHoliday.H	2003-09-05 15:34:18.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSHoliday.H	2006-03-19 17:20:43.000000000 +0000
@@ -24,6 +24,11 @@
 
 typedef MSString MSResourceCode;
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSHoliday;
+MSTypesExport ostream& operator<<(ostream&,const MSHoliday&);
+#endif
+
 class MSTypesExport MSHoliday : public MSDate 
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSIndexVector.H aplus-fsf-4.20.2/src/MSTypes/MSIndexVector.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSIndexVector.H	2003-09-05 15:34:19.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSIndexVector.H	2006-03-19 17:20:43.000000000 +0000
@@ -49,6 +49,41 @@
 #endif
 
 class MSBinaryVector;
+class MSIndexVector;
+
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+MSTypesExport ostream & operator<< (ostream &, const MSIndexVector &);
+MSTypesExport MSBoolean operator<  (const MSIndexVector &, const MSIndexVector &);
+MSTypesExport MSBoolean operator>  (const MSIndexVector &, const MSIndexVector &);
+MSTypesExport MSBoolean operator<= (const MSIndexVector &, const MSIndexVector &);
+MSTypesExport MSBoolean operator>= (const MSIndexVector &, const MSIndexVector &);
+MSTypesExport MSBoolean operator<  (const MSIndexVector &, const unsigned int);
+MSTypesExport MSBoolean operator<  (const unsigned int,  const MSIndexVector &);
+MSTypesExport MSBoolean operator>  (const MSIndexVector &, const unsigned int);
+MSTypesExport MSBoolean operator>  (const unsigned int,  const MSIndexVector &);
+MSTypesExport MSBoolean operator<= (const MSIndexVector &, const unsigned int);
+MSTypesExport MSBoolean operator<= (const unsigned int,  const MSIndexVector &);
+MSTypesExport MSBoolean operator>= (const MSIndexVector &, const unsigned int);
+MSTypesExport MSBoolean operator>= (const unsigned int,  const MSIndexVector &);
+MSTypesExport MSBoolean operator== (const MSIndexVector &, const unsigned int);
+MSTypesExport MSBoolean operator== (const unsigned int,  const MSIndexVector &);
+MSTypesExport MSBoolean operator!= (const MSIndexVector &, const unsigned int);
+MSTypesExport MSBoolean operator!= (const unsigned int,  const MSIndexVector &);
+MSTypesExport MSIndexVector movingAverage (const MSIndexVector &, unsigned int);
+MSTypesExport MSIndexVector operator- (const MSIndexVector &);
+MSTypesExport MSIndexVector operator+ (const MSIndexVector &, const MSIndexVector &);
+MSTypesExport MSIndexVector operator- (const MSIndexVector &, const MSIndexVector &);
+MSTypesExport MSIndexVector operator* (const MSIndexVector &, const MSIndexVector &);
+MSTypesExport MSIndexVector operator/ (const MSIndexVector &, const MSIndexVector &);
+MSTypesExport MSIndexVector operator+ (const MSIndexVector &, const unsigned int);
+MSTypesExport MSIndexVector operator- (const MSIndexVector &, const unsigned int);
+MSTypesExport MSIndexVector operator* (const MSIndexVector &, const unsigned int);
+MSTypesExport MSIndexVector operator/ (const MSIndexVector &, const unsigned int);
+MSTypesExport MSIndexVector operator+ (const unsigned int,  const MSIndexVector &);
+MSTypesExport MSIndexVector operator* (const unsigned int,  const MSIndexVector &);
+MSTypesExport MSIndexVector operator- (const unsigned int,  const MSIndexVector &);
+MSTypesExport MSIndexVector operator/ (const unsigned int,  const MSIndexVector &);
+#endif // defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
 
 class MSTypesExport MSIndexVector : public MSVector
 {
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSInt.H aplus-fsf-4.20.2/src/MSTypes/MSInt.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSInt.H	2001-01-19 20:46:06.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSInt.H	2006-03-19 17:20:43.000000000 +0000
@@ -21,7 +21,31 @@
 
 #if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
 class MSInt;
-inline long compare (const MSInt &, const MSInt &);
+MSTypesExport long compare (const MSInt &, const MSInt &);
+MSTypesExport unsigned long hash(const MSInt&,unsigned long size_);
+MSTypesExport int operator+(const MSInt&,int);
+MSTypesExport int operator+(int,const MSInt&);
+MSTypesExport int operator+(const MSInt& d1,const MSInt&);
+MSTypesExport int operator-(const MSInt&,int);
+MSTypesExport int operator-(int,const MSInt&);
+MSTypesExport int operator-(const MSInt& d1,const MSInt&);
+MSTypesExport int operator*(const MSInt&,int);
+MSTypesExport int operator*(int,const MSInt&);
+MSTypesExport int operator*(const MSInt& d1,const MSInt&);
+MSTypesExport int operator/(const MSInt&,int);
+MSTypesExport int operator/(int,const MSInt&);
+MSTypesExport int operator/(const MSInt&,const MSInt&);
+MSTypesExport int operator%(const MSInt&,int);
+MSTypesExport int operator%(int,const MSInt&);
+MSTypesExport int operator%(const MSInt&,const MSInt&);
+MSTypesExport MSBoolean operator==(int,const MSInt&);
+MSTypesExport MSBoolean operator!=(int,const MSInt&);
+MSTypesExport MSBoolean operator< (int,const MSInt&);
+MSTypesExport MSBoolean operator<=(int,const MSInt&);
+MSTypesExport MSBoolean operator> (int,const MSInt&);
+MSTypesExport MSBoolean operator>=(int,const MSInt&);
+MSTypesExport ostream& operator<<(ostream& aStream_,const MSInt&);
+MSTypesExport istream& operator>>(istream& aStream_,MSInt&);
 #endif
 
 class MSTypesExport MSInt : public MSScalarModel
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSMBSDate.H aplus-fsf-4.20.2/src/MSTypes/MSMBSDate.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSMBSDate.H	2001-01-19 20:46:07.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSMBSDate.H	2006-03-19 17:20:43.000000000 +0000
@@ -16,6 +16,16 @@
 
 #include <MSTypes/MSDate.H>
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSDate;
+MSTypesExport ostream& operator<<(ostream&,const MSMBSDate&);
+MSTypesExport istream& operator>>(istream&,MSMBSDate&);
+MSTypesExport unsigned long hash(const MSMBSDate&,unsigned long size_);
+MSTypesExport MSMBSDate operator+(int,const MSMBSDate&);
+MSTypesExport MSMBSDate operator+(const MSNormalizedYears&,const MSMBSDate&);
+MSTypesExport MSMBSDate operator+(const MSTerm&,const MSMBSDate&);
+#endif
+ 
 class MSTypesExport MSMBSDate : public MSDate 
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSMBStringBuffer.H aplus-fsf-4.20.2/src/MSTypes/MSMBStringBuffer.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSMBStringBuffer.H	2001-01-19 20:46:08.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSMBStringBuffer.H	2006-03-19 17:20:43.000000000 +0000
@@ -25,6 +25,10 @@
 #include <MSTypes/MSStringBuffer.H>
 #endif
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+MSTypesExport MSStringBuffer *createMSMBStringBuffer(void);
+#endif
+
 class MSTypesExport MSMBStringBuffer : public MSStringBuffer 
 {
 friend MSTypesExport MSStringBuffer *createMSMBStringBuffer(void);
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSMoney.H aplus-fsf-4.20.2/src/MSTypes/MSMoney.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSMoney.H	2001-01-19 20:46:09.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSMoney.H	2006-03-19 17:20:43.000000000 +0000
@@ -18,6 +18,11 @@
 class MSFormat;
 struct CurrencyData;
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSMoney;
+MSTypesExport ostream& operator<<(ostream&,const MSMoney&);
+#endif
+
 class MSTypesExport MSMoney : public MSFloat 
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSNameSpace.H aplus-fsf-4.20.2/src/MSTypes/MSNameSpace.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSNameSpace.H	2003-09-05 15:34:20.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSNameSpace.H	2006-03-19 17:20:43.000000000 +0000
@@ -27,6 +27,11 @@
 #endif
 
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSNameSpace;
+MSTypesExport ostream& operator<<(ostream& aStream_,const MSNameSpace& aNameSpace_);
+#endif
+
 class MSTypesExport MSNameSpace
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSObjectTypeVectorInlines.C aplus-fsf-4.20.2/src/MSTypes/MSObjectTypeVectorInlines.C
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSObjectTypeVectorInlines.C	2005-08-29 01:32:27.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSObjectTypeVectorInlines.C	2006-03-19 22:57:39.000000000 +0000
@@ -80,14 +80,14 @@
 template <class Type>
 INLINELINKAGE MSObjectVector<Type> MSObjectVector<Type>::operator[] (const MSIndexVector & iVect_) const
 {
-  return select (*this, iVect_);
+  return this->select (*this, iVect_);
 }
 
 
 template <class Type>
 INLINELINKAGE MSObjectVector<Type> MSObjectVector<Type>::operator[] (const MSBinaryVector & bVect_) const
 {
-  return compress (*this, bVect_);
+  return this->compress (*this, bVect_);
 }
 
 
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSOid.H aplus-fsf-4.20.2/src/MSTypes/MSOid.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSOid.H	2003-09-05 15:34:21.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSOid.H	2006-03-19 17:20:43.000000000 +0000
@@ -26,6 +26,13 @@
 
 #define NPARTS  4
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSOid;
+MSTypesExport ostream &operator<<(ostream&, const MSOid&);
+MSTypesExport istream &operator>>(istream&, MSOid&);
+MSTypesExport long int compare(const MSOid& o1_, const MSOid& o2_);
+#endif
+
 class MSTypesExport MSOid 
 {
 
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSRange.H aplus-fsf-4.20.2/src/MSTypes/MSRange.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSRange.H	2003-09-05 15:34:22.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSRange.H	2006-03-19 17:20:43.000000000 +0000
@@ -21,6 +21,11 @@
 #endif
 
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSRange;
+MSTypesExport ostream& operator<<(ostream&,const MSRange&);
+#endif
+
 class MSTypesExport MSRange 
 {
 protected:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSRate.H aplus-fsf-4.20.2/src/MSTypes/MSRate.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSRate.H	2001-01-19 20:46:10.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSRate.H	2006-03-19 19:06:58.000000000 +0000
@@ -15,6 +15,11 @@
 
 class MSFormat;
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSRate;
+MSTypesExport ostream& operator<<(ostream&,const MSRate&);
+#endif
+
 class MSTypesExport MSRate: public MSFloat 
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSResourceCodeSet.H aplus-fsf-4.20.2/src/MSTypes/MSResourceCodeSet.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSResourceCodeSet.H	2003-09-05 15:34:23.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSResourceCodeSet.H	2006-03-19 17:25:44.000000000 +0000
@@ -22,6 +22,11 @@
 #endif
 
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSResourceCodeSet;
+MSTypesExport ostream& operator<<(ostream&,const MSResourceCodeSet&);
+#endif
+
 class MSTypesExport MSResourceCodeSet 
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSSimpleString.H aplus-fsf-4.20.2/src/MSTypes/MSSimpleString.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSSimpleString.H	2003-09-05 15:34:23.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSSimpleString.H	2006-03-19 17:25:32.000000000 +0000
@@ -20,6 +20,16 @@
 #endif
 
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSSimpleString;
+MSTypesExport MSSimpleString operator+(const MSSimpleString&,const MSSimpleString&); 
+MSTypesExport MSSimpleString operator+(const MSSimpleString&,const char *); 
+MSTypesExport MSSimpleString operator+(const char *,const MSSimpleString&); 
+MSTypesExport MSSimpleString operator+(const MSSimpleString&,char); 
+MSTypesExport MSSimpleString operator+(char,const MSSimpleString&); 
+MSTypesExport ostream& operator<<(ostream&,const MSSimpleString&);
+#endif
+
 class MSTypesExport MSSimpleString
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSStopWatch.H aplus-fsf-4.20.2/src/MSTypes/MSStopWatch.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSStopWatch.H	2003-09-05 15:34:24.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSStopWatch.H	2006-03-19 17:20:43.000000000 +0000
@@ -26,6 +26,12 @@
 #endif
 
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSTimeStat;
+MSTypesExport MSTimeStat operator-(const MSTimeStat&,const MSTimeStat&);
+MSTypesExport ostream& operator<<(ostream& os_,const MSTimeStat& ts_);
+#endif
+
 class MSTypesExport MSTimeStat
 {
 public:
@@ -52,6 +58,11 @@
   friend MSTypesExport ostream& operator<<(ostream& os_,const MSTimeStat& ts_);
 };
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSStopWatch;
+MSTypesExport ostream& operator<<(ostream& os_,const MSStopWatch& time_);
+#endif
+
 class MSTypesExport MSStopWatch
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSString.H aplus-fsf-4.20.2/src/MSTypes/MSString.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSString.H	2003-09-05 15:34:25.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSString.H	2006-03-19 17:25:23.000000000 +0000
@@ -42,6 +42,46 @@
 class MSSymbol;
 class MSFormat;
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSString;
+MSTypesExport ostream &operator<<(ostream &aStream,const MSString &aString);
+MSTypesExport istream &operator>>(istream &aStream,MSString &aString);
+MSTypesExport unsigned long hash(const MSString&,unsigned long size_);
+MSTypesExport MSBoolean operator==(const MSString &string1,const MSString &string2);
+MSTypesExport MSBoolean operator==(const MSString &string1,const char *pString2);
+MSTypesExport MSBoolean operator==(const char *pString1,const MSString &string2);
+  
+MSTypesExport MSBoolean operator!=(const MSString &string1,const MSString &string2);
+MSTypesExport MSBoolean operator!=(const MSString &string1,const char *pString2);
+MSTypesExport MSBoolean operator!=(const char *pString1,const MSString &string2);
+  
+MSTypesExport MSBoolean operator<(const MSString &string1,const MSString &string2);
+MSTypesExport MSBoolean operator<(const MSString &string1,const char *pString2);
+MSTypesExport MSBoolean operator<(const char *pString1,const MSString &string2);
+  
+MSTypesExport MSBoolean operator<=(const MSString &string1,const MSString &string2);
+MSTypesExport MSBoolean operator<=(const MSString &string1,const char *pString2);
+MSTypesExport MSBoolean operator<=(const char *pString1,const MSString &string2);
+  
+MSTypesExport MSBoolean operator>(const MSString &string1,const MSString &string2);
+MSTypesExport MSBoolean operator>(const MSString &string1,const char *pString2);
+MSTypesExport MSBoolean operator>(const char *pString1,const MSString &string2);
+  
+MSTypesExport MSBoolean operator>=(const MSString &string1,const MSString &string2);
+MSTypesExport MSBoolean operator>=(const MSString &string1,const char *pString2);
+MSTypesExport MSBoolean operator>=(const char *pString1,const MSString &string2);
+MSTypesExport MSString operator+(char aChar,const MSString &aString);
+MSTypesExport MSString operator+(const char *pString,const MSString &aString);
+MSTypesExport MSString operator&(const char *pString,const MSString &aString);
+MSTypesExport MSString operator|(const char *pString,const MSString &aString);
+MSTypesExport MSString operator^(const char *pString,const MSString &aString);
+MSTypesExport MSString lower(const MSString& aString);
+MSTypesExport MSString upper(const MSString& aString);
+MSTypesExport MSString rotate(const MSString& aString,int count);
+MSTypesExport MSString take(const MSString& aString,int count);
+MSTypesExport MSString drop(const MSString& aString,int count);
+#endif
+
 class MSTypesExport MSString : public MSScalarModel 
 {
 /*******************************************************************************
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSStringParser.H aplus-fsf-4.20.2/src/MSTypes/MSStringParser.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSStringParser.H	2001-01-19 20:46:13.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSStringParser.H	2006-03-20 11:59:58.000000000 +0000
@@ -99,33 +99,6 @@
   unsigned _numSkip;
 };
 
-/*-------------------------- Parsing Initialization ----------------------------
-| These operators let you construct parser objects from strings.  In effect,   |
-| they implicitly construct an MSStringParser object for you when you apply    |
-| the ">>" or "<<" operators to a string.  An expression of the form:          |
-|   aString>>x                                                                 |
-|      -or-                                                                    |
-|   aString<<n                                                                 |
-| is equivalent to                                                             |
-|   MSStringParser(aString)>>x                                                 |
-|      -or-                                                                    |
-|   MSStringParser(aString)<<n                                                 | 
-|                                                                              |
-| These functions are declared as friends simply so that their declaration     |
-| appears within this class declaration.                                       |
-------------------------------------------------------------------------------*/
-  friend MSTypesExport MSStringParser operator>>(const MSString&,MSString& aToken_);
-  friend MSTypesExport MSStringParser operator>>(const MSString&,const MSString& aPattern_);
-  friend MSTypesExport MSStringParser operator>>(const MSString&,const char *pPattern_);
-  friend MSTypesExport MSStringParser operator>>(const MSString&,char aCharPattern_);
-  friend MSTypesExport MSStringParser operator>>(const MSString&,unsigned position_);
-  friend MSTypesExport MSStringParser operator>>(const MSString&,int position_);
-  friend MSTypesExport MSStringParser operator<<(const MSString&,unsigned position_);
-						  
-  friend MSTypesExport MSStringParser operator>>(const MSString&,const MSStringTest&);
-  friend MSTypesExport MSStringParser operator>>(const MSString&,MSStringParser::Command);
-  friend MSTypesExport MSStringParser operator>>(const MSString&,const MSStringParser::Skip&);
-
 /*-------------------------------- Tokenizing ----------------------------------
 | This function parses the next "token" from the parser object and places      |
 | it into the MSString operand.  By necessity,this operatorplaces the rest     |
@@ -180,7 +153,6 @@
   MSStringParser& operator>>(Command);
   MSStringParser& operator>>(const Skip&);
 
-protected:
 /*------------------------- Constructors/Destructor ----------------------------
 | You can construct a parser object by providing:                              |
 |   o a string that defines the text to be parsed                              |
@@ -201,6 +173,30 @@
   MSStringParserData *_parseData;
 }; 
 
+/*-------------------------- Parsing Initialization ----------------------------
+| These operators let you construct parser objects from strings.  In effect,   |
+| they implicitly construct an MSStringParser object for you when you apply    |
+| the ">>" or "<<" operators to a string.  An expression of the form:          |
+|   aString>>x                                                                 |
+|      -or-                                                                    |
+|   aString<<n                                                                 |
+| is equivalent to                                                             |
+|   MSStringParser(aString)>>x                                                 |
+|      -or-                                                                    |
+|   MSStringParser(aString)<<n                                                 | 
+------------------------------------------------------------------------------*/
+
+MSTypesExport MSStringParser operator>>(const MSString&,MSString& aToken_);
+MSTypesExport MSStringParser operator>>(const MSString&,const MSString& aPattern_);
+MSTypesExport MSStringParser operator>>(const MSString&,const char *pPattern_);
+MSTypesExport MSStringParser operator>>(const MSString&,char aCharPattern_);
+MSTypesExport MSStringParser operator>>(const MSString&,unsigned position_);
+MSTypesExport MSStringParser operator>>(const MSString&,int position_);
+MSTypesExport MSStringParser operator<<(const MSString&,unsigned position_);
+MSTypesExport MSStringParser operator>>(const MSString&,const MSStringTest&);
+MSTypesExport MSStringParser operator>>(const MSString&,MSStringParser::Command);
+MSTypesExport MSStringParser operator>>(const MSString&,const MSStringParser::Skip&);
+
 #endif 
 
 
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSSymbol.H aplus-fsf-4.20.2/src/MSTypes/MSSymbol.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSSymbol.H	2003-09-05 15:34:26.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSSymbol.H	2006-03-19 17:20:43.000000000 +0000
@@ -28,6 +28,13 @@
 #endif
 
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSSymbol;
+MSTypesExport unsigned long hash(const MSSymbol&,unsigned long size_);
+MSTypesExport ostream& operator<<(ostream& aStream_,const MSSymbol& aSymbol_);
+MSTypesExport istream& operator>>(istream& aStream_,MSSymbol& aSymbol_);
+#endif
+
 class MSTypesExport MSSymbol
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSSymbolVector.H aplus-fsf-4.20.2/src/MSTypes/MSSymbolVector.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSSymbolVector.H	2005-08-29 01:32:27.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSSymbolVector.H	2006-03-19 17:20:43.000000000 +0000
@@ -54,23 +54,7 @@
 #endif
 {
 public:
-  class MSTypesExport SPick
-  {
-  protected:
-    MSTypeVector<MSSymbol> *_pVector;
-    unsigned                _index;
-    
-  public:
-    INLINELINKAGE SPick (MSTypeVector<MSSymbol> &, unsigned int);
-    INLINELINKAGE SPick (const SPick &);
-
-    SPick & operator= (const MSSymbol&);
-    SPick & operator= (const SPick &);
-
-    friend MSTypesExport istream & operator>> (istream &, SPick &);
-
-    INLINELINKAGE operator MSSymbol() const;
-  };
+  class MSTypesExport SPick;
 
 public:
   MSTypeVector ();
@@ -108,6 +92,29 @@
   INLINELINKAGE MSTypeVector<MSSymbol> operator[] (const MSBinaryVector &) const;
 };
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+MSTypesExport istream & operator>> (istream &, MSTypeVector<MSSymbol>::SPick &);
+#endif
+
+class MSTypeVector<MSSymbol>::SPick
+{
+protected:
+  MSTypeVector<MSSymbol> *_pVector;
+  unsigned                _index;
+    
+public:
+  INLINELINKAGE SPick (MSTypeVector<MSSymbol> &, unsigned int);
+  INLINELINKAGE SPick (const SPick &);
+
+  SPick & operator= (const MSSymbol&);
+  SPick & operator= (const SPick &);
+
+  friend MSTypesExport istream & operator>> (istream &, SPick &);
+
+  INLINELINKAGE operator MSSymbol() const;
+};
+
+
 typedef MSTypeVector<MSSymbol> MSSymbolVector;
 
 // MSSymbol specializations
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSTerm.H aplus-fsf-4.20.2/src/MSTypes/MSTerm.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSTerm.H	2001-01-19 20:46:14.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSTerm.H	2006-03-19 17:20:43.000000000 +0000
@@ -193,6 +193,11 @@
 class MSDate;	
 class MSFormat;
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSTerm;
+MSTypesExport ostream& operator<<(ostream&,const MSTerm&);
+#endif
+
 // The "smart" date + term operator is in MSDate, becuase MSDate
 // has all the tables of calendar data.
 class MSTypesExport MSTerm: public MSScalarModel
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSTime.H aplus-fsf-4.20.2/src/MSTypes/MSTime.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSTime.H	2001-01-19 20:46:14.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSTime.H	2006-03-19 17:20:43.000000000 +0000
@@ -21,6 +21,14 @@
 class MSFormat;
 class MSHashTable;
 
+#if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
+class MSTime;
+MSTypesExport unsigned long hash(const MSTime&,unsigned long size_);
+MSTypesExport MSTime operator+(long,const MSTime&);
+MSTypesExport MSTime operator+(const MSTerm&,const MSTime&);
+MSTypesExport ostream& operator<<(ostream&,const MSTime&);
+#endif
+
 class MSTypesExport MSTime : public MSScalarModel
 {
 public:
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSTypeDataInlines.C aplus-fsf-4.20.2/src/MSTypes/MSTypeDataInlines.C
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSTypeDataInlines.C	2001-01-19 20:46:14.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSTypeDataInlines.C	2006-03-19 17:20:43.000000000 +0000
@@ -98,7 +98,7 @@
   // we have to use MSDataAlignment<Type> structure to find out the proper offset
   // of the data elements, taking possible alignment into consideration
   //
-  return offsetof(MSDataAlignment<Type>,_pElements);
+  return sizeof(MSDataAlignment<Type>) - sizeof(Type);
 }
 
 
diff -ur aplus-fsf-4.20.2.orig/src/MSTypes/MSUnsigned.H aplus-fsf-4.20.2/src/MSTypes/MSUnsigned.H
--- aplus-fsf-4.20.2.orig/src/MSTypes/MSUnsigned.H	2001-01-19 20:46:15.000000000 +0000
+++ aplus-fsf-4.20.2/src/MSTypes/MSUnsigned.H	2006-03-19 17:20:43.000000000 +0000
@@ -18,8 +18,32 @@
 
 #if defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
 class MSUnsigned;
-inline long compare (const MSUnsigned &, const MSUnsigned &);
-#endif
+MSTypesExport long compare (const MSUnsigned &, const MSUnsigned &);
+MSTypesExport unsigned long hash(const MSUnsigned&,unsigned long size_);
+MSTypesExport unsigned operator+(const MSUnsigned&,unsigned);
+MSTypesExport unsigned operator+(unsigned,const MSUnsigned&);
+MSTypesExport unsigned operator+(const MSUnsigned& d1,const MSUnsigned&);
+MSTypesExport unsigned operator-(const MSUnsigned&,unsigned);
+MSTypesExport unsigned operator-(unsigned,const MSUnsigned&);
+MSTypesExport unsigned operator-(const MSUnsigned& d1,const MSUnsigned&);
+MSTypesExport unsigned operator*(const MSUnsigned&,unsigned);
+MSTypesExport unsigned operator*(unsigned,const MSUnsigned&);
+MSTypesExport unsigned operator*(const MSUnsigned& d1,const MSUnsigned&);
+MSTypesExport unsigned operator/(const MSUnsigned&,unsigned);
+MSTypesExport unsigned operator/(unsigned,const MSUnsigned&);
+MSTypesExport unsigned operator/(const MSUnsigned&,const MSUnsigned&);
+MSTypesExport unsigned operator%(const MSUnsigned&,unsigned);
+MSTypesExport unsigned operator%(unsigned,const MSUnsigned&);
+MSTypesExport unsigned operator%(const MSUnsigned&,const MSUnsigned&);
+MSTypesExport MSBoolean operator==(unsigned,const MSUnsigned&);
+MSTypesExport MSBoolean operator!=(unsigned,const MSUnsigned&);
+MSTypesExport MSBoolean operator< (unsigned,const MSUnsigned&);
+MSTypesExport MSBoolean operator<=(unsigned,const MSUnsigned&);
+MSTypesExport MSBoolean operator> (unsigned,const MSUnsigned&);
+MSTypesExport MSBoolean operator>=(unsigned,const MSUnsigned&);
+MSTypesExport ostream& operator<<(ostream& aStream_,const MSUnsigned&);
+MSTypesExport istream& operator>>(istream& aStream_,MSUnsigned&);
+#endif // defined (MS_PREDECLARE_NONTEMPLATE_FRIEND_FUNCTIONS)
 
 class MSTypesExport MSUnsigned : public MSScalarModel
 {
